Subversion Repositories freemyipod

Rev

Rev 145 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 145 Rev 147
Line 7... Line 7...
7
AS      := $(CROSS)as
7
AS      := $(CROSS)as
8
LD      := $(CROSS)ld
8
LD      := $(CROSS)ld
9
OBJCOPY := $(CROSS)objcopy
9
OBJCOPY := $(CROSS)objcopy
10
UCLPACK := ucl2e10singleblk
10
UCLPACK := ucl2e10singleblk
11
 
11
 
12
CFLAGS  += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMBIOSDIR)/export -ffunction-sections -fdata-sections
12
CFLAGS  += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMBIOSDIR)/export -ffunction-sections -fdata-sections -mcpu=arm940t
13
LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections
13
LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --gc-sections
14
 
14
 
15
preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#")
15
preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#")
16
preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:")
16
preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:")
17
 
17
 
18
REVISION := $(shell svnversion .)
18
REVISION := $(shell svnversion .)
19
REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//")
19
REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//")
20
 
20
 
-
 
21
HELPERS := build/__embios_armhelpers.o
-
 
22
 
21
SRC := $(call preprocesspaths,SOURCES,-I. -I..)
23
SRC := $(call preprocesspaths,SOURCES,-I. -I..)
22
OBJ := $(SRC:%.c=build/%.o)
24
OBJ := $(SRC:%.c=build/%.o)
23
OBJ := $(OBJ:%.S=build/%.o)
25
OBJ := $(OBJ:%.S=build/%.o) $(HELPERS)
24
 
26
 
25
all: $(NAME)
27
all: $(NAME)
26
 
28
 
27
-include $(OBJ:%=%.dep)
29
-include $(OBJ:%=%.dep)
28
 
30
 
Line 72... Line 74...
72
else
74
else
73
	@sed -e 's/.*://' -e 's/\\$$//' < $@.dep.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.dep
75
	@sed -e 's/.*://' -e 's/\\$$//' < $@.dep.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $@.dep
74
endif
76
endif
75
	@rm -f $@.dep.tmp
77
	@rm -f $@.dep.tmp
76
 
78
 
-
 
79
build/__embios_%.o: $(EMBIOSDIR)/export/%.S
-
 
80
	@echo [CC]     $<
-
 
81
ifeq ($(shell uname),WindowsNT)
-
 
82
	@-if not exist $(subst /,\,$(dir $@)) md $(subst /,\,$(dir $@))
-
 
83
else
-
 
84
	@-mkdir -p $(dir $@)
-
 
85
endif
-
 
86
	@$(CC) -c $(CFLAGS) -o $@ $<
-
 
87
 
77
build/version.h: version.h .svn/entries
88
build/version.h: version.h .svn/entries
78
	@echo [PP]     $<
89
	@echo [PP]     $<
79
ifeq ($(shell uname),WindowsNT)
90
ifeq ($(shell uname),WindowsNT)
80
	@-if not exist build md build
91
	@-if not exist build md build
81
	@sed -e "s/\$$REVISION\$$/$(REVISION)/" -e "s/\$$REVISIONINT\$$/$(REVISIONINT)/" < $< > $@
92
	@sed -e "s/\$$REVISION\$$/$(REVISION)/" -e "s/\$$REVISIONINT\$$/$(REVISIONINT)/" < $< > $@