Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2023-02-10 00:59:31 +0300
committerJeff Johnston <jjohnstn@redhat.com>2023-02-22 22:53:05 +0300
commit17ac400c11bab30ac2c0bef12cbf7788f0b6f954 (patch)
treef64b33a564048dd2831f77501b2f0c266e9eff84 /libgloss/config
parent97d483c2f81c0865bead701f4d2824a21fae4938 (diff)
Fix libgloss/newlib build to conditionally use top include dir
- conditionally use -idirafter option for arm
Diffstat (limited to 'libgloss/config')
-rw-r--r--libgloss/config/arm.mh34
-rw-r--r--libgloss/config/default.mh2
2 files changed, 35 insertions, 1 deletions
diff --git a/libgloss/config/arm.mh b/libgloss/config/arm.mh
new file mode 100644
index 000000000..81f0920f9
--- /dev/null
+++ b/libgloss/config/arm.mh
@@ -0,0 +1,34 @@
+NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi`
+NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi`
+
+INCLUDES = -I. -I$(srcdir)/.. -I$(objdir)/.. -idirafter $(srcroot)/include
+# Note that when building the library, ${MULTILIB} is not the way multilib
+# options are passed; they're passed in $(CFLAGS).
+CFLAGS_FOR_TARGET = -O2 -g ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS}
+LDFLAGS_FOR_TARGET = ${MULTILIB} ${NEWLIB_LDFLAGS}
+AR_FLAGS = rc
+
+.c.o:
+ $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
+
+.C.o:
+ $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
+.s.o:
+ $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $<
+
+#
+# GCC knows to run the preprocessor on .S files before it assembles them.
+#
+.S.o:
+ $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $<
+
+#
+# this is a bogus target that'll produce an assembler from the
+# C source with the right compiler options. this is so we can
+# track down code generation or debug symbol bugs.
+#
+.c.s:
+ $(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $<
+
+# We don't build docs in subdirs, so stub out the rules.
+.PHONY: doc docs dvi html install-html info install-info clean-info pdf install-pdf
diff --git a/libgloss/config/default.mh b/libgloss/config/default.mh
index 81f0920f9..4e7f106f9 100644
--- a/libgloss/config/default.mh
+++ b/libgloss/config/default.mh
@@ -1,7 +1,7 @@
NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi`
NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi`
-INCLUDES = -I. -I$(srcdir)/.. -I$(objdir)/.. -idirafter $(srcroot)/include
+INCLUDES = -I. -I$(srcdir)/.. -I$(objdir)/..
# Note that when building the library, ${MULTILIB} is not the way multilib
# options are passed; they're passed in $(CFLAGS).
CFLAGS_FOR_TARGET = -O2 -g ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS}