4 exec_prefix = @exec_prefix@
8 includedir = @includedir@
12 TARGET = @target_alias@
14 INCLUDES = @bfd_include_dir@ @binutils_include_dir@
16 LDFLAGS = @LDFLAGS@ -static
19 DEFS = @DEFS@ -DTARGET_$(CPU)
23 # force link order under cygwin to avoid getopts / libiberty clash
24 ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
25 LIBS := -lcygwin $(LIBS)
28 CCFLAGS = $(CFLAGS) $(DEFS) $(INCLUDES)
31 ifeq ($(strip $(CPU)),e1)
32 SRC_LDFILE= $(CPU)-elf2flt.ld
34 SRC_LDFILE= elf2flt.ld
37 target_bindir = $(prefix)/$(TARGET)/bin
38 target_libdir = $(prefix)/$(TARGET)/lib
41 PROG_ELF2FLT = elf2flt$(EXEEXT)
42 PROG_FLTHDR = flthdr$(EXEEXT)
43 PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR)
47 $(PROG_ELF2FLT): elf2flt.c stubs.c Makefile
48 $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(srcdir)/elf2flt.c $(srcdir)/stubs.c $(LIBS)
50 $(PROG_FLTHDR): flthdr.c Makefile
51 $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(srcdir)/flthdr.c $(LIBS)
54 -rm -f $(PROGS) *.$(OBJEXT)
57 -rm -f Makefile config.log config.status config.cache ld-elf2flt
60 $(INSTALL) -d $(bindir)
61 $(INSTALL) -d $(target_bindir)
62 $(INSTALL) -d $(target_libdir)
63 $(INSTALL) -s -m 755 $(PROG_FLTHDR) $(bindir)/$(TARGET)-$(PROG_FLTHDR)
64 $(INSTALL) -s -m 755 $(PROG_FLTHDR) $(target_bindir)/$(PROG_FLTHDR)
65 $(INSTALL) -s -m 755 $(PROG_ELF2FLT) $(bindir)/$(TARGET)-$(PROG_ELF2FLT)
66 $(INSTALL) -s -m 755 $(PROG_ELF2FLT) $(target_bindir)/$(PROG_ELF2FLT)
67 [ -f $(bindir)/$(TARGET)-ld.real$(EXEEXT) ] || \
68 mv $(bindir)/$(TARGET)-ld$(EXEEXT) $(bindir)/$(TARGET)-ld.real$(EXEEXT)
69 [ -f $(target_bindir)/ld.real$(EXEEXT) ] || \
70 mv $(target_bindir)/ld$(EXEEXT) $(target_bindir)/ld.real$(EXEEXT)
71 $(INSTALL) -m 755 ld-elf2flt $(bindir)/$(TARGET)-ld
72 $(INSTALL) -m 755 ld-elf2flt $(target_bindir)/ld
73 $(INSTALL) -m 644 $(srcdir)/$(SRC_LDFILE) $(target_libdir)/$(LDFILE)