Subversion Repositories freemyipod

Rev

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

Rev 462 Rev 670
Line 1... Line 1...
1
NAME := uninstaller-nano2g
1
NAME := uninstaller-ipodnano2g
-
 
2
STACKSIZE := 4096
-
 
3
COMPRESS := true
2
 
4
 
3
EMBIOSDIR ?= ../../embios/trunk/
5
EMCOREDIR ?= ../../emcore/trunk/
-
 
6
LIBBOOTDIR ?= ../../libs/boot/
4
 
7
 
5
ifeq ($(shell uname),WindowsNT)
8
ifeq ($(shell uname),WindowsNT)
6
CCACHE :=
9
CCACHE :=
7
else
10
else
8
CCACHE := $(shell which ccache)
11
CCACHE := $(shell which ccache)
Line 11... Line 14...
11
CROSS   ?= arm-elf-eabi-
14
CROSS   ?= arm-elf-eabi-
12
CC      := $(CCACHE) $(CROSS)gcc
15
CC      := $(CCACHE) $(CROSS)gcc
13
AS      := $(CROSS)as
16
AS      := $(CROSS)as
14
LD      := $(CROSS)ld
17
LD      := $(CROSS)ld
15
OBJCOPY := $(CROSS)objcopy
18
OBJCOPY := $(CROSS)objcopy
16
UCLPACK := ucl2e10singleblk
19
ELF2ECA := $(CROSS)elf2emcoreapp
17
 
20
 
-
 
21
LIBINCLUDES := -I$(LIBBOOTDIR)/export
-
 
22
 
18
CFLAGS  += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMBIOSDIR)/export -ffunction-sections -fdata-sections -mcpu=arm940t
23
CFLAGS  += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMCOREDIR)/export $(LIBINCLUDES) -ffunction-sections -fdata-sections -mcpu=arm940t -DARM_ARCH=4
19
LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections
24
LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --emit-relocs --gc-sections
20
 
25
 
21
preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#")
26
preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#")
22
preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:")
27
preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:" | sed -e "s:^\\./::")
23
 
28
 
24
REVISION := $(shell svnversion .)
29
REVISION := $(shell svnversion .)
25
REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//")
30
REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//")
26
 
31
 
27
HELPERS := build/__embios_armhelpers.o
32
HELPERS := build/__emcore_armhelpers.o
28
 
33
 
29
SRC := $(call preprocesspaths,SOURCES,-I. -I..)
34
SRC := $(call preprocesspaths,SOURCES,-I. -I..)
30
OBJ := $(SRC:%.c=build/%.o)
35
OBJ := $(SRC:%.c=build/%.o)
31
OBJ := $(OBJ:%.S=build/%.o) $(HELPERS)
36
OBJ := $(OBJ:%.S=build/%.o) $(HELPERS)
32
 
37
 
33
all: $(NAME)
38
all: $(NAME)
34
 
39
 
35
-include $(OBJ:%=%.dep)
40
-include $(OBJ:%=%.dep)
36
 
41
 
37
$(NAME): build/$(NAME).embiosapp.ucl
42
$(NAME): build/$(NAME).emcoreapp
38
 
43
 
39
build/$(NAME).embiosapp.ucl: build/$(NAME).embiosapp
44
build/$(NAME).emcoreapp: build/$(NAME).elf
40
	@echo [UCL]    $<
45
	@echo [EMCAPP] $<
41
	@$(UCLPACK) $^ $@
46
ifeq ($(COMPRESS),true)
42
 
-
 
43
build/$(NAME).embiosapp: build/$(NAME).elf
47
	@$(ELF2ECA) -z -s $(STACKSIZE) -o $@ $^
44
	@echo [OC]     $<
48
else
45
	@$(OBJCOPY) -O binary $^ $@
49
	@$(ELF2ECA) -s $(STACKSIZE) -o $@ $^
-
 
50
endif
46
 
51
 
47
build/$(NAME).elf: ls.x $(OBJ)
52
build/$(NAME).elf: ls.x $(OBJ)
48
	@echo [LD]     $@
53
	@echo [LD]     $@
49
	@$(LD) $(LDFLAGS) -o $@ -T ls.x $(OBJ)
54
	@$(LD) $(LDFLAGS) -o $@ -T ls.x $(OBJ)
50
 
55
 
Line 80... Line 85...
80
else
85
else
81
	@sed -e 's/.*://' -e 's/\\$$//' < $@.dep.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.dep
86
	@sed -e 's/.*://' -e 's/\\$$//' < $@.dep.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.dep
82
endif
87
endif
83
	@rm -f $@.dep.tmp
88
	@rm -f $@.dep.tmp
84
 
89
 
-
 
90
build/__emcore_%.o: $(EMCOREDIR)/export/%.c
-
 
91
	@echo [CC]     $<
-
 
92
ifeq ($(shell uname),WindowsNT)
-
 
93
	@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
-
 
94
else
-
 
95
	@-mkdir -p $(dir $@)
-
 
96
endif
-
 
97
	@$(CC) -c $(CFLAGS) -o $@ $<
-
 
98
 
85
build/__embios_%.o: $(EMBIOSDIR)/export/%.S
99
build/__emcore_%.o: $(EMCOREDIR)/export/%.S
86
	@echo [CC]     $<
100
	@echo [CC]     $<
87
ifeq ($(shell uname),WindowsNT)
101
ifeq ($(shell uname),WindowsNT)
88
	@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
102
	@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
89
else
103
else
90
	@-mkdir -p $(dir $@)
104
	@-mkdir -p $(dir $@)