| 366 |
theseven |
1 |
NAME := installer-classic
|
|
|
2 |
|
|
|
3 |
EMBIOSDIR ?= ../../embios/trunk/
|
|
|
4 |
ILOADERDIR ?= ../iloader/
|
| 383 |
theseven |
5 |
UNINSTDIR ?= ../uninstaller-classic/
|
| 366 |
theseven |
6 |
UMSBOOTDIR ?= ../../umsboot/
|
|
|
7 |
TOOLSDIR ?= ../../tools/
|
|
|
8 |
|
|
|
9 |
BITMAPS = build/sidepane.ucl build/warning.ucl build/installing.ucl build/formatting.ucl build/copying.ucl build/flashing.ucl
|
|
|
10 |
|
| 383 |
theseven |
11 |
FLASHFILES = flashfiles/uninstaller-classic.embiosapp.ucl flashfiles/iloader.cfg.ucl flashfiles/iloader.embiosapp.ucl \
|
| 366 |
theseven |
12 |
flashfiles/embiosldr-ipodclassic.bin flashfiles/embios-ipodclassic.ucl flashfiles/umsboot-ipodclassic.ucl
|
|
|
13 |
|
| 462 |
theseven |
14 |
ifeq ($(shell uname),WindowsNT)
|
|
|
15 |
CCACHE :=
|
|
|
16 |
else
|
|
|
17 |
CCACHE := $(shell which ccache)
|
|
|
18 |
endif
|
|
|
19 |
|
| 457 |
theseven |
20 |
CROSS ?= arm-elf-eabi-
|
| 462 |
theseven |
21 |
CC := $(CCACHE) $(CROSS)gcc
|
| 366 |
theseven |
22 |
AS := $(CROSS)as
|
|
|
23 |
LD := $(CROSS)ld
|
|
|
24 |
OBJCOPY := $(CROSS)objcopy
|
|
|
25 |
UCLPACK := ucl2e10singleblk
|
|
|
26 |
GENINSTALLER := python tools/geninstaller.py
|
|
|
27 |
STUBEMBED := python tools/stubembed.py
|
|
|
28 |
COMPILECONFIG := python $(ILOADERDIR)/tools/compileconfig.py
|
|
|
29 |
EMBIOSBOOTCFG := python $(EMBIOSDIR)/tools/embiosbootcfg.py
|
|
|
30 |
EMBIOSEMBEDAPP := python $(EMBIOSDIR)/tools/embiosembedapp.py
|
|
|
31 |
GENPWN := python $(EMBIOSDIR)/tools/ipodcrypt.py s5l8702-genpwnage
|
|
|
32 |
|
|
|
33 |
CFLAGS += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMBIOSDIR)/export -ffunction-sections -fdata-sections -mcpu=arm940t
|
|
|
34 |
LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections
|
|
|
35 |
|
|
|
36 |
preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#")
|
|
|
37 |
preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:")
|
|
|
38 |
|
|
|
39 |
REVISION := $(shell svnversion .)
|
|
|
40 |
REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//")
|
|
|
41 |
|
|
|
42 |
HELPERS := build/__embios_armhelpers.o
|
|
|
43 |
|
|
|
44 |
SRC := $(call preprocesspaths,SOURCES,-I. -I..)
|
|
|
45 |
OBJ := $(SRC:%.c=build/%.o)
|
|
|
46 |
OBJ := $(OBJ:%.S=build/%.o) $(HELPERS)
|
|
|
47 |
|
|
|
48 |
all: $(NAME)
|
|
|
49 |
|
|
|
50 |
-include $(OBJ:%=%.dep)
|
|
|
51 |
|
|
|
52 |
$(NAME): build/bootstrap-ipodclassic.dfu build/$(NAME).ubi
|
|
|
53 |
|
|
|
54 |
build/bootstrap-ipodclassic.dfu: build/bootstrap.bin
|
|
|
55 |
@echo [GENPWN] $<
|
|
|
56 |
@$(GENPWN) $< $@
|
|
|
57 |
|
|
|
58 |
build/bootstrap.bin: build/bootstub.bin $(UMSBOOTDIR)/build/ipodclassic/umsboot.bin
|
|
|
59 |
@echo [STUBEM] $@
|
|
|
60 |
@$(STUBEMBED) $^ $@
|
|
|
61 |
|
|
|
62 |
build/$(NAME).ubi: $(EMBIOSDIR)/build/ipodclassic/embios.bin build/$(NAME).embiosapp.ucl
|
|
|
63 |
@echo [EMBAPP] $@
|
|
|
64 |
@$(EMBIOSEMBEDAPP) $^ $@ --run-from=0x08f00000 --compressed
|
|
|
65 |
|
|
|
66 |
build/$(NAME).embiosapp.ucl: build/$(NAME).embiosapp
|
|
|
67 |
@echo [UCL] $<
|
|
|
68 |
@$(UCLPACK) $< $@
|
|
|
69 |
|
|
|
70 |
build/$(NAME).embiosapp: build/$(NAME).plain.embiosapp $(BITMAPS) flashfiles.built
|
|
|
71 |
@echo [GENINS] $<
|
|
|
72 |
@$(GENINSTALLER) $< $@ /notes/$(BASENAME).bootnote fsfiles
|
|
|
73 |
|
|
|
74 |
build/bootstub.bin: build/bootstub.elf
|
|
|
75 |
@echo [OC] $<
|
|
|
76 |
@$(OBJCOPY) -O binary $^ $@
|
|
|
77 |
|
|
|
78 |
build/bootstub.elf: bootstub/ls.x build/bootstub/bootstub.o
|
|
|
79 |
@echo [LD] $@
|
|
|
80 |
@$(LD) $(LDFLAGS) -o $@ -T bootstub/ls.x build/bootstub/bootstub.o
|
|
|
81 |
|
|
|
82 |
build/%.ucl: oobe/%.bmp
|
|
|
83 |
@echo [UCL] $<
|
|
|
84 |
ifeq ($(shell uname),WindowsNT)
|
|
|
85 |
@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
|
|
86 |
else
|
|
|
87 |
@-mkdir -p $(dir $@)
|
|
|
88 |
endif
|
|
|
89 |
@$(UCLPACK) $< $@
|
|
|
90 |
|
|
|
91 |
build/$(NAME).plain.embiosapp: build/$(NAME).elf
|
|
|
92 |
@echo [OC] $<
|
|
|
93 |
@$(OBJCOPY) -O binary $^ $@
|
|
|
94 |
|
|
|
95 |
build/$(NAME).elf: ls.x $(OBJ)
|
|
|
96 |
@echo [LD] $@
|
|
|
97 |
@$(LD) $(LDFLAGS) -o $@ -T ls.x $(OBJ)
|
|
|
98 |
|
|
|
99 |
build/%.o: %.c build/version.h
|
|
|
100 |
@echo [CC] $<
|
|
|
101 |
ifeq ($(shell uname),WindowsNT)
|
|
|
102 |
@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
|
|
103 |
else
|
|
|
104 |
@-mkdir -p $(dir $@)
|
|
|
105 |
endif
|
|
|
106 |
@$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
107 |
@$(CC) -MM $(CFLAGS) $< > $@.dep.tmp
|
|
|
108 |
@sed -e "s|.*:|$@:|" < $@.dep.tmp > $@.dep
|
|
|
109 |
ifeq ($(shell uname),WindowsNT)
|
|
|
110 |
@sed -e "s/.*://" -e "s/\\$$//" < $@.dep.tmp | fmt -1 | sed -e "s/^ *//" -e "s/$$/:/" >> $@.dep
|
|
|
111 |
else
|
|
|
112 |
@sed -e 's/.*://' -e 's/\\$$//' < $@.dep.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.dep
|
|
|
113 |
endif
|
|
|
114 |
@rm -f $@.dep.tmp
|
|
|
115 |
|
|
|
116 |
build/%.o: %.S build/version.h
|
|
|
117 |
@echo [CC] $<
|
|
|
118 |
ifeq ($(shell uname),WindowsNT)
|
|
|
119 |
@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
|
|
120 |
else
|
|
|
121 |
@-mkdir -p $(dir $@)
|
|
|
122 |
endif
|
|
|
123 |
@$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
124 |
@$(CC) -MM $(CFLAGS) $< > $@.dep.tmp
|
|
|
125 |
@sed -e "s|.*:|$@:|" < $@.dep.tmp > $@.dep
|
|
|
126 |
ifeq ($(shell uname),WindowsNT)
|
|
|
127 |
@sed -e "s/.*://" -e "s/\\$$//" < $@.dep.tmp | fmt -1 | sed -e "s/^ *//" -e "s/$$/:/" >> $@.dep
|
|
|
128 |
else
|
|
|
129 |
@sed -e 's/.*://' -e 's/\\$$//' < $@.dep.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.dep
|
|
|
130 |
endif
|
|
|
131 |
@rm -f $@.dep.tmp
|
|
|
132 |
|
|
|
133 |
build/__embios_%.o: $(EMBIOSDIR)/export/%.S
|
|
|
134 |
@echo [CC] $<
|
|
|
135 |
ifeq ($(shell uname),WindowsNT)
|
|
|
136 |
@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
|
|
|
137 |
else
|
|
|
138 |
@-mkdir -p $(dir $@)
|
|
|
139 |
endif
|
|
|
140 |
@$(CC) -c $(CFLAGS) -o $@ $<
|
|
|
141 |
|
|
|
142 |
build/version.h: version.h .svn/entries
|
|
|
143 |
@echo [PP] $<
|
|
|
144 |
ifeq ($(shell uname),WindowsNT)
|
|
|
145 |
@-if not exist build md build
|
|
|
146 |
@sed -e "s/\$$REVISION\$$/$(REVISION)/" -e "s/\$$REVISIONINT\$$/$(REVISIONINT)/" < $< > $@
|
|
|
147 |
else
|
|
|
148 |
@-mkdir -p build
|
|
|
149 |
@sed -e 's/\$$REVISION\$$/$(REVISION)/' -e 's/\$$REVISIONINT\$$/$(REVISIONINT)/' < $< > $@
|
|
|
150 |
endif
|
|
|
151 |
|
|
|
152 |
flashfiles: $(FLASHFILES)
|
|
|
153 |
@touch flashfiles.built
|
|
|
154 |
|
| 383 |
theseven |
155 |
$(UNINSTDIR)/build/uninstaller-classic.embiosapp.ucl: uninstaller-classic
|
|
|
156 |
|
|
|
157 |
flashfiles/uninstaller-classic.embiosapp.ucl: $(UNINSTDIR)/build/uninstaller-classic.embiosapp.ucl uninstaller-classic
|
|
|
158 |
@echo [CP] $@
|
|
|
159 |
@cp $< $@
|
|
|
160 |
|
| 366 |
theseven |
161 |
$(UMSBOOTDIR)/build/ipodclassic/umsboot-ipodclassic.ucl: umsboot
|
|
|
162 |
|
|
|
163 |
flashfiles/umsboot-ipodclassic.ucl: $(UMSBOOTDIR)/build/ipodclassic/umsboot-ipodclassic.ucl umsboot
|
|
|
164 |
@echo [CP] $@
|
|
|
165 |
@cp $< $@
|
|
|
166 |
|
|
|
167 |
flashfiles/iloader.cfg: flashfiles/iloader.conf
|
|
|
168 |
@echo [COMCFG] $@
|
|
|
169 |
@$(COMPILECONFIG) $< $@
|
|
|
170 |
|
|
|
171 |
flashfiles/iloader.cfg.ucl: flashfiles/iloader.cfg
|
|
|
172 |
@echo [UCL] $<
|
|
|
173 |
@$(UCLPACK) $< $@
|
|
|
174 |
|
|
|
175 |
$(ILOADERDIR)/build/iloader.embiosapp.ucl: iloader
|
|
|
176 |
|
|
|
177 |
flashfiles/iloader.embiosapp.ucl: $(ILOADERDIR)/build/iloader.embiosapp.ucl iloader
|
|
|
178 |
@echo [CP] $@
|
|
|
179 |
@cp $< $@
|
|
|
180 |
|
|
|
181 |
$(EMBIOSDIR)/loader/ipodclassic/build/embiosldr-ipodclassic.bin: embiosldr-ipodclassic
|
|
|
182 |
|
|
|
183 |
flashfiles/embiosldr-ipodclassic.bin: $(EMBIOSDIR)/loader/ipodclassic/build/embiosldr-ipodclassic.bin embiosldr-ipodclassic
|
|
|
184 |
@echo [CP] $@
|
|
|
185 |
@cp $< $@
|
|
|
186 |
|
|
|
187 |
flashfiles/embios-ipodclassic.ucl: flashfiles/embios-ipodclassic.bin
|
|
|
188 |
@echo [UCL] $<
|
|
|
189 |
@$(UCLPACK) $< $@
|
|
|
190 |
|
|
|
191 |
$(EMBIOSDIR)/build/ipodclassic/embios.bin: embios
|
|
|
192 |
|
|
|
193 |
flashfiles/embios-ipodclassic.bin: $(EMBIOSDIR)/build/ipodclassic/embios.bin embios
|
|
|
194 |
@echo [EMBCFG] $@
|
|
|
195 |
@$(EMBIOSBOOTCFG) $< $@ --file=/iLoader/boot.embiosapp --file-compressed --file-run-from=0x08000000 \
|
|
|
196 |
--flash=iloader --flash-compressed --flash-run-from=0x09e00000
|
|
|
197 |
|
|
|
198 |
embios:
|
|
|
199 |
@make -C $(EMBIOSDIR) ipodclassic
|
|
|
200 |
|
|
|
201 |
embiosldr-ipodclassic:
|
|
|
202 |
@make -C $(EMBIOSDIR)/loader/ipodclassic
|
|
|
203 |
|
|
|
204 |
iloader:
|
|
|
205 |
@make -C $(ILOADERDIR)
|
|
|
206 |
|
| 383 |
theseven |
207 |
uninstaller-classic:
|
|
|
208 |
@make -C $(UNINSTDIR)
|
|
|
209 |
|
| 366 |
theseven |
210 |
$(UMSBOOTDIR)/build/ipodclassic/umsboot.bin: umsboot
|
|
|
211 |
|
|
|
212 |
umsboot:
|
|
|
213 |
@make -C $(UMSBOOTDIR) ipodclassic
|
|
|
214 |
|
|
|
215 |
clean:
|
|
|
216 |
@rm -rf build
|
|
|
217 |
|
| 383 |
theseven |
218 |
.PHONY: all clean uninstaller-classic iloader embios embiosldr-ipodclassic umsboot libucl flashfiles $(NAME)
|