Subversion Repositories freemyipod

Rev

Rev 445 | Rev 462 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 445 Rev 450
Line 10... Line 10...
10
CC = @CC@
10
CC = @CC@
11
CPU = @target_cpu@
11
CPU = @target_cpu@
12
TARGET = @target_alias@
12
TARGET = @target_alias@
13
SYMBOL_PREFIX = @SYMBOL_PREFIX@
13
SYMBOL_PREFIX = @SYMBOL_PREFIX@
14
CFLAGS = @CFLAGS@
14
CFLAGS = @CFLAGS@
15
INCLUDES = -I$(srcdir) @bfd_include_dir@ @binutils_include_dir@ @zlib_include_dir@
15
INCLUDES = -I$(srcdir) @bfd_include_dir@ @binutils_include_dir@ -I../ucl/include
16
CPPFLAGS = @CPPFLAGS@ $(DEFS) $(INCLUDES)
16
CPPFLAGS = @CPPFLAGS@ $(DEFS) $(INCLUDES)
17
LDFLAGS = @LDFLAGS@
17
LDFLAGS = @LDFLAGS@
18
LDLIBS = @LIBS@
18
LDLIBS = @LIBS@ ../ucl/src/libucl.a
19
INSTALL = @INSTALL@
19
INSTALL = @INSTALL@
20
DEFS = @DEFS@ \
20
DEFS = @DEFS@ \
21
	-DTARGET_$(CPU) \
21
	-DTARGET_$(CPU) \
22
	-DTARGET_CPU=\"$(CPU)\" \
22
	-DTARGET_CPU=\"$(CPU)\" \
23
	-DSYMBOL_PREFIX=\"$(SYMBOL_PREFIX)\" \
23
	-DSYMBOL_PREFIX=\"$(SYMBOL_PREFIX)\" \
Line 39... Line 39...
39
# force link order under cygwin to avoid getopts / libiberty clash
39
# force link order under cygwin to avoid getopts / libiberty clash
40
ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
40
ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
41
   LDLIBS := -lcygwin $(LDLIBS)
41
   LDLIBS := -lcygwin $(LDLIBS)
42
endif
42
endif
43
 
43
 
44
LDFILE= elf2flt.ld
-
 
45
ifeq ($(strip $(CPU)),e1)
-
 
46
SRC_LDFILE= $(srcdir)/$(CPU)-elf2flt.ld
-
 
47
else 
-
 
48
SRC_LDFILE= elf2flt.ld
-
 
49
endif
-
 
50
 
-
 
51
target_bindir = $(prefix)/$(TARGET)/bin
44
target_bindir = $(prefix)/$(TARGET)/bin
52
target_libdir = $(prefix)/$(TARGET)/lib
45
target_libdir = $(prefix)/$(TARGET)/lib
53
 
46
 
54
 
47
 
55
PROG_ELF2FLT       = elf2flt$(EXEEXT)
48
PROG_ELF2EMCOREAPP = elf2emcoreapp$(EXEEXT)
56
PROG_FLTHDR        = flthdr$(EXEEXT)
-
 
57
PROG_LD_ELF2FLT_C  = ld-elf2flt$(EXEEXT)
-
 
58
PROG_LD_ELF2FLT_SH = ld-elf2flt.sh
-
 
59
 
-
 
60
ifeq (@use_ld_elf2flt_binary@,yes)
-
 
61
PROG_LD_ELF2FLT    = $(PROG_LD_ELF2FLT_C)
-
 
62
else
-
 
63
PROG_LD_ELF2FLT    = $(PROG_LD_ELF2FLT_SH)
-
 
64
endif
-
 
65
 
49
 
66
PROGS = $(PROG_ELF2FLT) $(PROG_FLTHDR) $(PROG_LD_ELF2FLT_C) $(PROG_LD_ELF2FLT_SH)
50
PROGS = $(PROG_ELF2EMCOREAPP)
67
 
51
 
68
all: $(PROGS)
52
all: $(PROGS)
69
 
53
 
70
# We need to declare the link explicitly because make only provides
54
# We need to declare the link explicitly because make only provides
71
# implicit rules when EXEEXT is set to nothing
55
# implicit rules when EXEEXT is set to nothing
72
link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
56
link = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
73
 
57
 
74
$(PROG_ELF2FLT): elf2flt.o compress.o stubs.o
58
$(PROG_ELF2EMCOREAPP): elf2emcoreapp.o compress.o stubs.o
75
	$(link)
-
 
76
 
-
 
77
$(PROG_FLTHDR): flthdr.o compress.o stubs.o
-
 
78
	$(link)
59
	$(link)
79
 
60
 
80
ld-elf2flt$(EXEEXT): ld-elf2flt.o stubs.o
-
 
81
	$(link)
-
 
82
 
-
 
83
ld-elf2flt.sh: $(srcdir)/ld-elf2flt.in
-
 
84
	./config.status $@
-
 
85
	chmod 755 $@
-
 
86
 
-
 
87
Makefile: $(srcdir)/Makefile.in
61
Makefile: $(srcdir)/Makefile.in
88
	./config.status $@
62
	./config.status $@
89
 
63
 
90
clean:
64
clean:
91
	-rm -f $(PROGS) *.$(OBJEXT) .deps
65
	-rm -f $(PROGS) *.$(OBJEXT) .deps
92
 
66
 
93
distclean: clean
67
distclean: clean
94
	-rm -f Makefile config.log config.status config.cache ld-elf2flt
68
	-rm -f Makefile config.log config.status config.cache
-
 
69
	-rm -rf autom4te.cache
95
 
70
 
96
install:
71
install:
97
	$(INSTALL) -d $(bindir)
-
 
98
	$(INSTALL) -d $(target_bindir)
72
	$(INSTALL) -d $(target_bindir)
99
	$(INSTALL) -d $(target_libdir)
73
	$(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)
74
	$(INSTALL) -m 755 $(PROG_ELF2EMCOREAPP) $(bindir)/$(TARGET)-$(PROG_ELF2EMCOREAPP)
103
	$(INSTALL) -m 755 $(PROG_ELF2FLT) $(target_bindir)/$(PROG_ELF2FLT)
75
	$(INSTALL) -m 755 $(PROG_ELF2EMCOREAPP) $(target_bindir)/$(PROG_ELF2EMCOREAPP)
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)
-
 
111
 
76
 
112
sinclude .deps
77
sinclude .deps
113
.deps:
78
.deps:
114
	$(CC) -MM $(CPPFLAGS) $(srcdir)/*.c > .deps
79
	$(CC) -MM $(CPPFLAGS) $(srcdir)/*.c > .deps