From 66b8c614e8f2f644b9fb02225323e93c45fe0b32 Mon Sep 17 00:00:00 2001 From: David McCullough Date: Tue, 7 Jul 2009 00:49:11 +0000 Subject: [PATCH] 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 --- Makefile.in | 24 +++++++++++++----------- 1 file 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 $@ -- 2.39.5