mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-27 17:40:37 +08:00
751a3427e0
Since $(AS) is the assembler, passing it a list of preprocessor include flags doesn't make much sense. The files aren't preprocessed which means `#include` lines aren't respected, and while it would affect `.include` usage, we never use that, and it's extremely unlikely to change. Plus, it's extremely unlikely we'd have .s files in common places to include vs contained entirely within a specific arch dir, and at that point, it can be included directly (with no flags), or the arch can add the unique set of include paths that it needs for itself.
35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
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) $(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
|