mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-29 05:29:47 +00:00
115 lines
3.0 KiB
Makefile
115 lines
3.0 KiB
Makefile
srcdir = @srcdir@
|
|
VPATH = @srcdir@
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
|
|
bindir = @bindir@
|
|
libdir = @libdir@
|
|
includedir = @includedir@
|
|
|
|
CC = @CC@
|
|
CPU = @target_cpu@
|
|
TARGET = @target_alias@
|
|
SYMBOL_PREFIX = @SYMBOL_PREFIX@
|
|
CFLAGS = @CFLAGS@
|
|
INCLUDES = -I$(srcdir) @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@
|
|
CPPFLAGS = @CPPFLAGS@ $(DEFS) $(INCLUDES)
|
|
LDFLAGS = @LDFLAGS@
|
|
LDLIBS = @LIBS@
|
|
INSTALL = @INSTALL@
|
|
DEFS = @DEFS@ \
|
|
-DTARGET_$(CPU) \
|
|
-DTARGET_CPU=\"$(CPU)\" \
|
|
-DSYMBOL_PREFIX=\"$(SYMBOL_PREFIX)\" \
|
|
-DBINUTILS_LDSCRIPTDIR=\"@binutils_ldscript_dir@\" \
|
|
-DTARGET_ALIAS=\"$(TARGET)\" \
|
|
-DNO_GOT_CHECK=@got_check@ \
|
|
-DUSE_EMIT_RELOCS=@emit_relocs@ \
|
|
-DEMIT_CTOR_DTOR=@emit_ctor_dtor@ \
|
|
-DALWAYS_RELOC_TEXT=@always_reloc_text@
|
|
EXEEXT = @EXEEXT@
|
|
OBJEXT = @OBJEXT@
|
|
|
|
HOST = @host_alias@
|
|
|
|
ifneq (,$(findstring mingw32,$(HOST)))
|
|
LDLIBS += -lws2_32
|
|
endif
|
|
|
|
# force link order under cygwin to avoid getopts / libiberty clash
|
|
ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
|
|
LDLIBS := -lcygwin $(LDLIBS)
|
|
endif
|
|
|
|
LDFILE= elf2flt.ld
|
|
ifeq ($(strip $(CPU)),e1)
|
|
SRC_LDFILE= $(srcdir)/$(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)
|
|
PROG_LD_ELF2FLT_C = ld-elf2flt$(EXEEXT)
|
|
PROG_LD_ELF2FLT_SH = ld-elf2flt.sh
|
|
|
|
ifeq (@use_ld_elf2flt_binary@,yes)
|
|
PROG_LD_ELF2FLT = $(PROG_LD_ELF2FLT_C)
|
|
else
|
|
PROG_LD_ELF2FLT = $(PROG_LD_ELF2FLT_SH)
|
|
endif
|
|
|
|
PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR) $(PROG_LD_ELF2FLT_C) $(PROG_LD_ELF2FLT_SH)
|
|
|
|
all: $(PROGS)
|
|
|
|
# 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): flthdr.o compress.o stubs.o
|
|
$(link)
|
|
|
|
ld-elf2flt$(EXEEXT): ld-elf2flt.o stubs.o
|
|
$(link)
|
|
|
|
ld-elf2flt.sh: $(srcdir)/ld-elf2flt.in
|
|
./config.status $@
|
|
chmod 755 $@
|
|
|
|
Makefile: $(srcdir)/Makefile.in
|
|
./config.status $@
|
|
|
|
clean:
|
|
-rm -f $(PROGS) *.$(OBJEXT) .deps
|
|
|
|
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) -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 $(PROG_LD_ELF2FLT) $(bindir)/$(TARGET)-ld$(EXEEXT)
|
|
$(INSTALL) -m 755 $(PROG_LD_ELF2FLT) $(target_bindir)/ld$(EXEEXT)
|
|
$(INSTALL) -m 644 $(SRC_LDFILE) $(target_libdir)/$(LDFILE)
|
|
|
|
sinclude .deps
|
|
.deps:
|
|
$(CC) -MM $(CPPFLAGS) $(srcdir)/*.c > .deps
|