Use DBOP to check for left button on C200v2 like we are supposed to instead of right...
[kugel-rb.git] / rbutil / mktccboot / Makefile
blob1b8ff5b34994a8b7629e4737d19718260e8f4c17
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 # We use the Telechips code available in the Rockbox tools/ directory
11 TOOLSDIR=../../tools
12 CFLAGS := -O -g -W -Wall -Wshadow -pedantic -I$(TOOLSDIR)
14 ifndef V
15 SILENT = @
16 endif
18 ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
19 OUTPUT=mktccboot.exe
20 CFLAGS+=-mno-cygwin
21 else
22 ifeq ($(findstring MINGW,$(shell uname)),MINGW)
23 OUTPUT=mktccboot.exe
24 else
25 ifeq ($(findstring mingw,$(CC)),mingw)
26 OUTPUT=mktccboot.exe
27 else
28 OUTPUT=mktccboot
29 endif
30 endif
31 endif
33 ifdef RBARCH
34 CFLAGS += -arch $(RBARCH)
35 endif
37 OUT = $(TARGET_DIR)build$(RBARCH)
39 all: $(OUTPUT)
41 # inputs
42 LIBSOURCES := mktccboot.c $(TOOLSDIR)/telechips.o
43 SOURCES := $(LIBSOURCES) main.c
44 OBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(SOURCES))))
45 LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(LIBSOURCES))))
46 EXTRADEPS :=
48 # rule for sources from tools dir
49 $(OUT)/%.o: $(TOOLSDIR)/%.c $(OUT)
50 @echo CC $<
51 $(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
53 $(OUT)/%.o: %.c $(OUT)
54 @echo CC $<
55 $(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
57 libmktccboot$(RBARCH).a: $(LIBOBJS)
58 @echo AR $@
59 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
61 # building the standalone executable
62 $(OUTPUT): $(OBJS) $(EXTRADEPS)
63 @echo LD $@
64 $(SILENT)$(CC) $(CFLAGS) -o$(OUTPUT) $(OBJS) $(EXTRADEPS)
66 # some trickery to build ppc and i386 from a single call
67 ifeq ($(RBARCH),)
68 $(TARGET_DIR)libmktccbooti386.a:
69 make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmktccbooti386.a
71 $(TARGET_DIR)libmktccbootppc.a:
72 make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmktccbootppc.a
73 endif
75 libmktccboot-universal: $(TARGET_DIR)libmktccbooti386.a $(TARGET_DIR)libmktccbootppc.a
76 @echo lipo $(TARGET_DIR)libmktccboot.a
77 $(SILENT) rm -f $(TARGET_DIR)libmktccboot.a
78 $(SILENT)lipo -create $(TARGET_DIR)libmktccbootppc.a $(TARGET_DIR)libmktccbooti386.a -output $(TARGET_DIR)libmktccboot.a
80 clean:
81 rm -f $(OUTPUT) $(TARGET_DIR)libmktccboot*.a mktccboot.dmg
82 rm -rf $(OUT)
84 mktccboot-i386:
85 $(MAKE) RBARCH=i386
86 mv mktccboot mktccboot-i386
88 mktccboot-ppc:
89 make RBARCH=ppc
90 mv mktccboot mktccboot-ppc
92 mktccboot-mac: mktccboot-i386 mktccboot-ppc
93 $(SILENT)lipo -create mktccboot-ppc mktccboot-i386 -output mktccboot-mac
95 mktccboot.dmg: mktccboot-mac
96 mkdir -p mktccboot-dmg
97 cp -p mktccboot-mac mktccboot-dmg
98 hdiutil create -srcfolder mktccboot-dmg mktccboot.dmg
100 $(OUT):
101 @echo MKDIR $(OUT)
102 $(SILENT)mkdir $(OUT)