diff options
author | Rich Felker <dalias@aerifal.cx> | 2016-01-19 19:08:52 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-01-19 19:08:52 -0500 |
commit | 9514e70c60649ea13c25e1ac1e944cee7c82c9a7 (patch) | |
tree | 280ea3fb0a58fce2c4978ccc8e49bf1c7c4ea8ea | |
parent | 9f5eb77992b42d484d69e879d24ef86466f20f21 (diff) | |
download | musl-9514e70c60649ea13c25e1ac1e944cee7c82c9a7.tar.gz musl-9514e70c60649ea13c25e1ac1e944cee7c82c9a7.tar.bz2 musl-9514e70c60649ea13c25e1ac1e944cee7c82c9a7.tar.xz musl-9514e70c60649ea13c25e1ac1e944cee7c82c9a7.zip |
eliminate separate static/shared CFLAGS vars in makefile
this allows the rules for .o and .lo files to be identical, with -fPIC
and -DSHARED added for .lo files via target-specific variable append.
this is arguably cleaner now and will allow more cleanup and removal
of redundant rule bodies after other prerequisite changes are made.
-rw-r--r-- | Makefile | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -39,8 +39,6 @@ CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc CFLAGS_ALL = $(CFLAGS_C99FSE) CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -Iobj/src/internal -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) -CFLAGS_ALL_STATIC = $(CFLAGS_ALL) -CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) @@ -138,40 +136,42 @@ $(patsubst $(srcdir)/%,obj/%,$(dir $(patsubst %/,%,$(dir $(1))))$(ARCH)$(ASMSUBA endef $(foreach s,$(wildcard $(srcdir)/src/*/$(ARCH)*/*.s),$(eval $(call mkasmdep,$(s)))) +$(LOBJS): CFLAGS_ALL += -fPIC -DSHARED + # Choose invocation of assembler to be used # $(1) is input file, $(2) is output file, $(3) is assembler flags ifeq ($(ADD_CFI),yes) - AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) -x assembler -c -o $@ - + AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ - else - AS_CMD = $(CC) -c -o $@ $< + AS_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $< endif obj/%.o: $(srcdir)/%.sub - $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $(dir $<)$$(cat $<) + $(CC) $(CFLAGS_ALL) -c -o $@ $(dir $<)$$(cat $<) obj/%.o: $(srcdir)/%.s - $(AS_CMD) $(CFLAGS_ALL_STATIC) + $(AS_CMD) $(CFLAGS_ALL) obj/%.o: $(srcdir)/%.S - $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< + $(CC) $(CFLAGS_ALL) -c -o $@ $< obj/%.o: $(srcdir)/%.c $(GENH) $(IMPH) - $(CC) $(CFLAGS_ALL_STATIC) -c -o $@ $< + $(CC) $(CFLAGS_ALL) -c -o $@ $< obj/%.lo: $(srcdir)/%.sub - $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $(dir $<)$$(cat $<) + $(CC) $(CFLAGS_ALL) -c -o $@ $(dir $<)$$(cat $<) obj/%.lo: $(srcdir)/%.s - $(AS_CMD) $(CFLAGS_ALL_SHARED) + $(AS_CMD) $(CFLAGS_ALL) obj/%.lo: $(srcdir)/%.S - $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $< + $(CC) $(CFLAGS_ALL) -c -o $@ $< obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH) - $(CC) $(CFLAGS_ALL_SHARED) -c -o $@ $< + $(CC) $(CFLAGS_ALL) -c -o $@ $< lib/libc.so: $(LOBJS) - $(CC) $(CFLAGS_ALL_SHARED) $(LDFLAGS_ALL) -nostdlib -shared \ + $(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \ -Wl,-e,_dlstart -Wl,-Bsymbolic-functions \ -o $@ $(LOBJS) $(LIBCC) |