This cleans up the Makefile handling of the different compiler flags such that it uses standard names across the board as well as unifies the link method.
Signed-off-by: Mike Frysinger <vap...@gentoo.org> --- Makefile.in | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1b192c4..148fd38 100644 --- a/Makefile.in +++ b/Makefile.in @@ -11,10 +11,10 @@ CC = @CC@ CPU = @target_cpu@ TARGET = @target_alias@ CFLAGS = @CFLAGS@ -INCLUDES = @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@ -CPPFLAGS = @CPPFLAGS@ +INCLUDES = -I$(srcdir) @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@ +CPPFLAGS = @CPPFLAGS@ $(DEFS) $(INCLUDES) LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ +LDLIBS = @LIBS@ INSTALL = @INSTALL@ DEFS = @DEFS@ -DTARGET_$(CPU) EXEEXT = @EXEEXT@ @@ -23,16 +23,14 @@ OBJEXT = @OBJEXT@ HOST = @host_alias@ ifneq (,$(findstring mingw32,$(HOST))) - LIBS := $(LIBS) -lws2_32 + LDLIBS += -lws2_32 endif # force link order under cygwin to avoid getopts / libiberty clash ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),) - LIBS := -lcygwin $(LIBS) + LDLIBS := -lcygwin $(LDLIBS) endif -CCFLAGS = $(CFLAGS) $(DEFS) $(INCLUDES) - LDFILE= elf2flt.ld ifeq ($(strip $(CPU)),e1) SRC_LDFILE= $(srcdir)/$(CPU)-elf2flt.ld @@ -50,11 +48,15 @@ PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR) all: $(PROGS) ld-elf2flt -$(PROG_ELF2FLT): $(srcdir)/elf2flt.c compress.o $(srcdir)/stubs.c - $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) +# We need to declare the link explicitly because make only provides +# implicit rules when EXEEXT is set to nothing +link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +$(PROG_ELF2FLT): elf2flt.o compress.o stubs.o + $(link) -$(PROG_FLTHDR): $(srcdir)/flthdr.c compress.o - $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) +$(PROG_FLTHDR): flthdr.o compress.o + $(link) ld-elf2flt: $(srcdir)/ld-elf2flt.in ./config.status $@ -- 1.6.3.3 _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev