freemyipod r5 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r4‎ | r5 | r6 >
Date:16:12, 28 July 2010
Author:theseven
Status:new
Tags:
Comment:
- Remove bad comment from the Makefile, which made compilation fail on Windows
- Use TARGET_whatever defines to allow ifdef'ing target-specific code properly
Modified paths:
  • /embios/trunk/Makefile (modified) (history)
  • /embios/trunk/SOURCES (modified) (history)

Diff [purge]

Index: embios/trunk/SOURCES
@@ -1,4 +1,4 @@
2 -#if TARGET == ipodnano2g
 2+#ifdef TARGET_ipodnano2g
33 target/ipodnano2g/mmu.c
44 target/ipodnano2g/lcd.c
55 target/ipodnano2g/nand.c
Index: embios/trunk/Makefile
@@ -14,7 +14,7 @@
1515 preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:")
1616
1717 define TARGET_template
18 -SRC_$(1) := $$(call preprocess,SOURCES,-D TARGET=$(1))
 18+SRC_$(1) := $$(call preprocess,SOURCES,-DTARGET_$(1))
1919 OBJ_$(1) := $$(SRC_$(1):%.c=build/$(1)/%.o)
2020 OBJ_$(1) := $$(OBJ_$(1):%.S=build/$(1)/%.o)
2121
@@ -37,12 +37,10 @@
3838 else
3939 @-mkdir -p $$(dir $$@)
4040 endif
41 - $(CC) -c $(CFLAGS) -Itarget/$(1) -D TARGET=$(1) -o $$@ $$<
42 - @$(CC) -MM $(CFLAGS) -Itarget/$(1) -D TARGET=$(1) $$< > $$@.dep
 41+ $(CC) -c $(CFLAGS) -Itarget/$(1) -DTARGET_$(1) -o $$@ $$<
 42+ @$(CC) -MM $(CFLAGS) -Itarget/$(1) -DTARGET_$(1) $$< > $$@.dep
4343 @mv -f $$@.dep $$@.dep.tmp
4444 @sed -e "s|.*:|$$@:|" < $$@.dep.tmp > $$@.dep
45 - @# Those many backslashes are necessary as make escapes them itself, then the shell
46 - @# So make makes 4 out of 8, then the shell makes 2 out of 4 which is what we want
4745 @sed -e "s/.*://" -e "s/\\\\\\\\$$$$//" < $$@.dep.tmp | fmt -1 | sed -e "s/^ *//" -e "s/$$$$/:/" >> $$@.dep
4846 @rm -f $$@.dep.tmp
4947
@@ -52,12 +50,10 @@
5351 else
5452 @-mkdir -p $$(dir $$@)
5553 endif
56 - $(CC) -c $(CFLAGS) -Itarget/$(1) -D TARGET=$(1) -o $$@ $$<
57 - @$(CC) -MM $(CFLAGS) -Itarget/$(1) -D TARGET=$(1) $$< > $$@.dep
 54+ $(CC) -c $(CFLAGS) -Itarget/$(1) -DTARGET_$(1) -o $$@ $$<
 55+ @$(CC) -MM $(CFLAGS) -Itarget/$(1) -DTARGET_$(1) $$< > $$@.dep
5856 @mv -f $$@.dep $$@.dep.tmp
5957 @sed -e "s|.*:|$$@:|" < $$@.dep.tmp > $$@.dep
60 - @# Those many backslashes are necessary as make escapes them itself, then the shell
61 - @# So make makes 4 out of 8, then the shell makes 2 out of 4 which is what we want
6258 @sed -e "s/.*://" -e "s/\\\\\\\\$$$$//" < $$@.dep.tmp | fmt -1 | sed -e "s/^ *//" -e "s/$$$$/:/" >> $$@.dep
6359 @rm -f $$@.dep.tmp
6460 endef