X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Makefile.in;h=f041890ee94d79b2f761f175fa7f8078d104e170;hb=6a93642380b57bb272b96df6a350e50a4c984015;hp=30fd79751bc2e6cb1a3cae533b047f5d8de746d4;hpb=63a912be10fc989be1d17da8e07017e3a6f63e58;p=uclinux-h8%2Felf2flt.git diff --git a/Makefile.in b/Makefile.in index 30fd797..f041890 100644 --- a/Makefile.in +++ b/Makefile.in @@ -11,17 +11,35 @@ CC = @CC@ CPU = @target_cpu@ TARGET = @target_alias@ CFLAGS = @CFLAGS@ -INCLUDES = @bfd_include_dir@ @binutils_include_dir@ +INCLUDES = @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@ CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -static +LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ INSTALL = @INSTALL@ DEFS = @DEFS@ -DTARGET_$(CPU) EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ +HOST = @host_alias@ + +ifneq (,$(findstring mingw32,$(HOST))) + LIBS := $(LIBS) -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) +endif + CCFLAGS = $(CFLAGS) $(DEFS) $(INCLUDES) +LDFILE= elf2flt.ld +ifeq ($(strip $(CPU)),e1) +SRC_LDFILE= $(CPU)-elf2flt.ld +else +SRC_LDFILE= elf2flt.ld +endif + target_bindir = $(prefix)/$(TARGET)/bin target_libdir = $(prefix)/$(TARGET)/lib @@ -32,11 +50,14 @@ PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR) all: $(PROGS) -$(PROG_ELF2FLT): $(srcdir)/elf2flt.c Makefile - $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(srcdir)/elf2flt.c $(LIBS) +$(PROG_ELF2FLT): $(srcdir)/elf2flt.c compress.o $(srcdir)/stubs.c + $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) + +$(PROG_FLTHDR): $(srcdir)/flthdr.c compress.o + $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -flthdr: $(srcdir)/flthdr.c Makefile - $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(srcdir)/flthdr.c $(LIBS) +Makefile: $(srcdir)/Makefile.in + ./config.status $@ clean: -rm -f $(PROGS) *.$(OBJEXT) @@ -45,15 +66,19 @@ distclean: clean -rm -f Makefile config.log config.status config.cache ld-elf2flt install: - $(INSTALL) -s -m 755 $(PROG_FLTHDR) $(bindir)/$(TARGET)-$(PROG_FLTHDR) - $(INSTALL) -s -m 755 $(PROG_FLTHDR) $(target_bindir)/$(PROG_FLTHDR) - $(INSTALL) -s -m 755 $(PROG_ELF2FLT) $(bindir)/$(TARGET)-$(PROG_ELF2FLT) - $(INSTALL) -s -m 755 $(PROG_ELF2FLT) $(target_bindir)/$(PROG_ELF2FLT) + $(INSTALL) -d $(bindir) + $(INSTALL) -d $(target_bindir) + $(INSTALL) -d $(target_libdir) + $(INSTALL) -m 755 $(PROG_FLTHDR) $(bindir)/$(TARGET)-$(PROG_FLTHDR) + $(INSTALL) -m 755 $(PROG_FLTHDR) $(target_bindir)/$(PROG_FLTHDR) + $(INSTALL) -m 755 $(PROG_ELF2FLT) $(bindir)/$(TARGET)-$(PROG_ELF2FLT) + $(INSTALL) -m 755 $(PROG_ELF2FLT) $(target_bindir)/$(PROG_ELF2FLT) [ -f $(bindir)/$(TARGET)-ld.real$(EXEEXT) ] || \ mv $(bindir)/$(TARGET)-ld$(EXEEXT) $(bindir)/$(TARGET)-ld.real$(EXEEXT) [ -f $(target_bindir)/ld.real$(EXEEXT) ] || \ mv $(target_bindir)/ld$(EXEEXT) $(target_bindir)/ld.real$(EXEEXT) - $(INSTALL) -m 755 $(srcdir)/ld-elf2flt$(EXEEXT) $(bindir)/$(TARGET)-ld$(EXEEXT) - $(INSTALL) -m 755 $(srcdir)/ld-elf2flt$(EXEEXT) $(target_bindir)/ld$(EXEEXT) - $(INSTALL) -m 644 $(srcdir)/elf2flt.ld $(target_libdir) + $(INSTALL) -m 755 ld-elf2flt $(bindir)/$(TARGET)-ld + $(INSTALL) -m 755 ld-elf2flt $(target_bindir)/ld + $(INSTALL) -m 644 $(srcdir)/$(SRC_LDFILE) $(target_libdir)/$(LDFILE) +