4 exec_prefix = @exec_prefix@
8 includedir = @includedir@
12 TARGET = @target_alias@
13 SYMBOL_PREFIX = @SYMBOL_PREFIX@
15 INCLUDES = -I$(srcdir) @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@
16 CPPFLAGS = @CPPFLAGS@ $(DEFS) $(INCLUDES)
22 -DTARGET_CPU=\"$(CPU)\" \
23 -DSYMBOL_PREFIX=\"$(SYMBOL_PREFIX)\" \
24 -DBINUTILS_LDSCRIPTDIR=\"@binutils_ldscript_dir@\" \
25 -DTARGET_ALIAS=\"$(TARGET)\" \
26 -DNO_GOT_CHECK=@got_check@ \
27 -DUSE_EMIT_RELOCS=@emit_relocs@ \
28 -DEMIT_CTOR_DTOR=@emit_ctor_dtor@ \
29 -DALWAYS_RELOC_TEXT=@always_reloc_text@
35 ifneq (,$(findstring mingw32,$(HOST)))
39 # force link order under cygwin to avoid getopts / libiberty clash
40 ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
41 LDLIBS := -lcygwin $(LDLIBS)
45 ifeq ($(strip $(CPU)),e1)
46 SRC_LDFILE= $(srcdir)/$(CPU)-elf2flt.ld
48 SRC_LDFILE= elf2flt.ld
51 target_bindir = $(prefix)/$(TARGET)/bin
52 target_libdir = $(prefix)/$(TARGET)/lib
55 PROG_ELF2FLT = elf2flt$(EXEEXT)
56 PROG_FLTHDR = flthdr$(EXEEXT)
57 PROG_LD_ELF2FLT_C = ld-elf2flt$(EXEEXT)
58 PROG_LD_ELF2FLT_SH = ld-elf2flt.sh
60 ifeq (@use_ld_elf2flt_binary@,yes)
61 PROG_LD_ELF2FLT = $(PROG_LD_ELF2FLT_C)
63 PROG_LD_ELF2FLT = $(PROG_LD_ELF2FLT_SH)
66 PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR) $(PROG_LD_ELF2FLT_C) $(PROG_LD_ELF2FLT_SH)
70 # We need to declare the link explicitly because make only provides
71 # implicit rules when EXEEXT is set to nothing
72 link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
74 $(PROG_ELF2FLT): elf2flt.o compress.o stubs.o
77 $(PROG_FLTHDR): flthdr.o compress.o stubs.o
80 ld-elf2flt$(EXEEXT): ld-elf2flt.o stubs.o
83 ld-elf2flt.sh: $(srcdir)/ld-elf2flt.in
87 Makefile: $(srcdir)/Makefile.in
91 -rm -f $(PROGS) *.$(OBJEXT) .deps
94 -rm -f Makefile config.log config.status config.cache ld-elf2flt
97 $(INSTALL) -d $(bindir)
98 $(INSTALL) -d $(target_bindir)
99 $(INSTALL) -d $(target_libdir)
100 $(INSTALL) -m 755 $(PROG_FLTHDR) $(bindir)/$(TARGET)-$(PROG_FLTHDR)
101 $(INSTALL) -m 755 $(PROG_FLTHDR) $(target_bindir)/$(PROG_FLTHDR)
102 $(INSTALL) -m 755 $(PROG_ELF2FLT) $(bindir)/$(TARGET)-$(PROG_ELF2FLT)
103 $(INSTALL) -m 755 $(PROG_ELF2FLT) $(target_bindir)/$(PROG_ELF2FLT)
104 [ -f $(bindir)/$(TARGET)-ld.real$(EXEEXT) ] || \
105 mv $(bindir)/$(TARGET)-ld$(EXEEXT) $(bindir)/$(TARGET)-ld.real$(EXEEXT)
106 [ -f $(target_bindir)/ld.real$(EXEEXT) ] || \
107 mv $(target_bindir)/ld$(EXEEXT) $(target_bindir)/ld.real$(EXEEXT)
108 $(INSTALL) -m 755 $(PROG_LD_ELF2FLT) $(bindir)/$(TARGET)-ld$(EXEEXT)
109 $(INSTALL) -m 755 $(PROG_LD_ELF2FLT) $(target_bindir)/ld$(EXEEXT)
110 $(INSTALL) -m 644 $(SRC_LDFILE) $(target_libdir)/$(LDFILE)
114 $(CC) -MM $(CPPFLAGS) $(srcdir)/*.c > .deps