summaryrefslogtreecommitdiffstats
path: root/toolchain/elf2flt/elf2flt/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/elf2flt/elf2flt/Makefile.in')
-rw-r--r--toolchain/elf2flt/elf2flt/Makefile.in81
1 files changed, 81 insertions, 0 deletions
diff --git a/toolchain/elf2flt/elf2flt/Makefile.in b/toolchain/elf2flt/elf2flt/Makefile.in
new file mode 100644
index 000000000..24dd96d1e
--- /dev/null
+++ b/toolchain/elf2flt/elf2flt/Makefile.in
@@ -0,0 +1,81 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+libdir = @libdir@
+includedir = @includedir@
+
+CC = @CC@
+CPU = @target_cpu@
+TARGET = @target_alias@
+CFLAGS = @CFLAGS@
+INCLUDES = @bfd_include_dir@ @binutils_include_dir@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@ -static
+LIBS = @LIBS@
+INSTALL = @INSTALL@
+DEFS = @DEFS@ -DTARGET_$(CPU)
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+
+UNAME := $(shell uname -s)
+
+ifneq (,$(findstring MINGW,$(UNAME)))
+ 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
+
+
+PROG_ELF2FLT = elf2flt$(EXEEXT)
+PROG_FLTHDR = flthdr$(EXEEXT)
+PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR)
+
+all: $(PROGS)
+
+$(PROG_ELF2FLT): elf2flt.c stubs.c Makefile
+ $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(srcdir)/elf2flt.c $(srcdir)/stubs.c $(LIBS)
+
+$(PROG_FLTHDR): flthdr.c Makefile
+ $(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $(srcdir)/flthdr.c $(LIBS)
+
+clean:
+ -rm -f $(PROGS) *.$(OBJEXT)
+
+distclean: clean
+ -rm -f Makefile config.log config.status config.cache ld-elf2flt
+
+install:
+ $(INSTALL) -d $(bindir)
+ $(INSTALL) -d $(target_bindir)
+ $(INSTALL) -d $(target_libdir)
+ $(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)
+ [ -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 ld-elf2flt $(bindir)/$(TARGET)-ld
+ $(INSTALL) -m 755 ld-elf2flt $(target_bindir)/ld
+ $(INSTALL) -m 644 $(srcdir)/$(SRC_LDFILE) $(target_libdir)/$(LDFILE)
+
+