diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-04-26 21:40:16 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-04-26 21:40:16 +0000 |
commit | 28d54c6016459ffe93c0be2efea7de27c38d783c (patch) | |
tree | 9a7a71481f0a82599616a3e9f4e5bdad9fee8d6c /rbutil/mkmpioboot/Makefile | |
parent | b09d3aec392538ca0934644ff6357c41aaa4c323 (diff) | |
download | rockbox-28d54c6016459ffe93c0be2efea7de27c38d783c.tar.gz rockbox-28d54c6016459ffe93c0be2efea7de27c38d783c.zip |
Add MPIO HD200 port - new files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25725 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/mkmpioboot/Makefile')
-rw-r--r-- | rbutil/mkmpioboot/Makefile | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/rbutil/mkmpioboot/Makefile b/rbutil/mkmpioboot/Makefile new file mode 100644 index 0000000000..f50392793e --- /dev/null +++ b/rbutil/mkmpioboot/Makefile | |||
@@ -0,0 +1,94 @@ | |||
1 | |||
2 | #change for releases | ||
3 | ifndef APPVERSION | ||
4 | APPVERSION=`../../tools/version.sh ../../` | ||
5 | endif | ||
6 | |||
7 | # We use the UCL code available in the Rockbox tools/ directory | ||
8 | CFLAGS=-I../../tools/ucl/include -Wall -DVERSION=\"$(APPVERSION)\" | ||
9 | |||
10 | ifndef V | ||
11 | SILENT = @ | ||
12 | endif | ||
13 | |||
14 | ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) | ||
15 | OUTPUT=mkmpioboot.exe | ||
16 | CFLAGS+=-mno-cygwin | ||
17 | else | ||
18 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | ||
19 | OUTPUT=mkmpioboot.exe | ||
20 | else | ||
21 | ifeq ($(findstring mingw,$(CC)),mingw) | ||
22 | OUTPUT=mkmpioboot.exe | ||
23 | else | ||
24 | OUTPUT=mkmpioboot | ||
25 | endif | ||
26 | endif | ||
27 | endif | ||
28 | |||
29 | ifdef RBARCH | ||
30 | CFLAGS += -arch $(RBARCH) | ||
31 | OBJDIR = $(RBARCH)/ | ||
32 | endif | ||
33 | |||
34 | |||
35 | all: $(OUTPUT) | ||
36 | |||
37 | # inputs | ||
38 | LIBSOURCES := mkmpioboot.c | ||
39 | SOURCES := $(LIBSOURCES) main.c | ||
40 | OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES))) | ||
41 | LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(LIBSOURCES))) | ||
42 | EXTRADEPS := $(LIBUCL) | ||
43 | |||
44 | # explicit dependencies | ||
45 | $(OBJDIR)mkmpioboot.o: mkmpioboot.c mkmpioboot.h | ||
46 | $(OBJDIR)main.o: main.c | ||
47 | |||
48 | $(OBJDIR)%.o: %.c | ||
49 | @echo CC $< $ | ||
50 | $(SILENT)mkdir -p $(dir $@) | ||
51 | $(SILENT)$(CC) $(CFLAGS) -c -o $@ $< | ||
52 | |||
53 | libmkamsboot$(RBARCH).a: $(LIBOBJS) | ||
54 | @echo AR $@ | ||
55 | $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^ | ||
56 | |||
57 | # building the standalone executable | ||
58 | $(OUTPUT): $(OBJS) $(EXTRADEPS) | ||
59 | @echo LD $@ | ||
60 | $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(OBJS) $(EXTRADEPS) | ||
61 | |||
62 | # some trickery to build ppc and i386 from a single call | ||
63 | ifeq ($(RBARCH),) | ||
64 | $(TARGET_DIR)libmkmpiobooti386.a: | ||
65 | make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmkmpiobooti386.a | ||
66 | |||
67 | $(TARGET_DIR)libmkmpiobootppc.a: | ||
68 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmkmpiobootppc.a | ||
69 | endif | ||
70 | |||
71 | libmkmpioboot-universal: $(TARGET_DIR)libmkmpiobooti386.a $(TARGET_DIR)libmkmpiobootppc.a | ||
72 | @echo lipo $(TARGET_DIR)libmkmpioboot.a | ||
73 | $(SILENT) rm -f $(TARGET_DIR)libmkmpioboot.a | ||
74 | $(SILENT)lipo -create $(TARGET_DIR)libmkmpiobootppc.a $(TARGET_DIR)libmkmpiobooti386.a -output $(TARGET_DIR)libmkmpioboot.a | ||
75 | |||
76 | clean: | ||
77 | rm -f $(OBJS) $(OUTPUT) libmkmpioboot.o $(TARGET_DIR)libmkmpioboot*.a mkmpioboot.dmg | ||
78 | rm -rf mkmpioboot-* i386 ppc $(OBJDIR) | ||
79 | |||
80 | mkmpioboot-i386: | ||
81 | $(MAKE) RBARCH=i386 | ||
82 | mv mkmpioboot mkmpioboot-i386 | ||
83 | |||
84 | mkmpioboot-ppc: | ||
85 | $(MAKE) RBARCH=ppc | ||
86 | mv mkmpioboot mkmpioboot-ppc | ||
87 | |||
88 | mkmpioboot-mac: mkmpioboot-i386 mkmpioboot-ppc | ||
89 | $(SILENT)lipo -create mkmpioboot-ppc mkmpioboot-i386 -output mkmpioboot-mac | ||
90 | |||
91 | mkmpioboot.dmg: mkmpioboot-mac | ||
92 | mkdir -p mkmpioboot-dmg | ||
93 | cp -p mkmpioboot-mac mkmpioboot-dmg | ||
94 | hdiutil create -srcfolder mkmpioboot-dmg mkmpioboot.dmg | ||