Theme Editor: Added rendering support for some more tags
[kugel-rb.git] / rbutil / mkamsboot / Makefile
blob0a9ab3b4e7dfd13b9774e60caa8f31c386510f0f
2 #change for releases
3 ifndef APPVERSION
4 APPVERSION=`../../tools/version.sh ../../`
5 endif
7 # We use the UCL code available in the Rockbox tools/ directory
8 CFLAGS=-I../../tools/ucl/include -Wall -DVERSION=\"$(APPVERSION)\"
10 ifndef V
11 SILENT = @
12 endif
14 ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
15 OUTPUT=mkamsboot.exe
16 CFLAGS+=-mno-cygwin
17 else
18 ifeq ($(findstring MINGW,$(shell uname)),MINGW)
19 OUTPUT=mkamsboot.exe
20 else
21 ifeq ($(findstring mingw,$(CC)),mingw)
22 OUTPUT=mkamsboot.exe
23 else
24 OUTPUT=mkamsboot
25 endif
26 endif
27 endif
29 ifdef RBARCH
30 CFLAGS += -arch $(RBARCH)
31 OBJDIR = $(TARGET_DIR)build/$(RBARCH)/
32 else
33 OBJDIR = $(TARGET_DIR)build/
34 endif
37 all: $(OUTPUT)
39 # additional link dependencies for the standalone executable
40 LIBUCL=../../tools/ucl/src/libucl$(RBARCH).a
42 $(LIBUCL):
43 $(MAKE) -C ../../tools/ucl/src $(TARGET_DIR)libucl$(RBARCH).a
45 # inputs
46 LIBSOURCES := dualboot.c md5.c mkamsboot.c
47 SOURCES := $(LIBSOURCES) main.c
48 OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES)))
49 LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(LIBSOURCES)))
50 EXTRADEPS := $(LIBUCL)
52 # explicit dependencies on dualboot.{c,h} and mkamsboot.h
53 $(OBJDIR)mkamsboot.o: dualboot.h dualboot.c mkamsboot.c mkamsboot.h
54 $(OBJDIR)main.o: dualboot.h dualboot.c main.c mkamsboot.h
56 $(OBJDIR)%.o: %.c
57 @echo CC $<
58 $(SILENT)mkdir -p $(dir $@)
59 $(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
61 libmkamsboot$(RBARCH).a: $(LIBOBJS)
62 @echo AR $@
63 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
65 # building the standalone executable
66 $(OUTPUT): $(OBJS) $(EXTRADEPS)
67 @echo LD $@
68 $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(OBJS) $(EXTRADEPS)
70 # some trickery to build ppc and i386 from a single call
71 ifeq ($(RBARCH),)
72 $(TARGET_DIR)libmkamsbooti386.a:
73 make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmkamsbooti386.a
75 $(TARGET_DIR)libmkamsbootppc.a:
76 make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmkamsbootppc.a
77 endif
79 libmkamsboot-universal: $(TARGET_DIR)libmkamsbooti386.a $(TARGET_DIR)libmkamsbootppc.a
80 @echo lipo $(TARGET_DIR)libmkamsboot.a
81 $(SILENT) rm -f $(TARGET_DIR)libmkamsboot.a
82 $(SILENT)lipo -create $(TARGET_DIR)libmkamsbootppc.a $(TARGET_DIR)libmkamsbooti386.a -output $(TARGET_DIR)libmkamsboot.a
84 clean:
85 rm -f $(OBJS) $(OUTPUT) libmkamsboot.o $(TARGET_DIR)libmkamsboot*.a mkamsboot.dmg
86 rm -rf mkamsboot-* i386 ppc $(OBJDIR)
88 mkamsboot-i386:
89 $(MAKE) RBARCH=i386
90 mv mkamsboot mkamsboot-i386
92 mkamsboot-ppc:
93 $(MAKE) RBARCH=ppc
94 mv mkamsboot mkamsboot-ppc
96 mkamsboot-mac: mkamsboot-i386 mkamsboot-ppc
97 $(SILENT)lipo -create mkamsboot-ppc mkamsboot-i386 -output mkamsboot-mac
99 mkamsboot.dmg: mkamsboot-mac
100 mkdir -p mkamsboot-dmg
101 cp -p mkamsboot-mac mkamsboot-dmg
102 hdiutil create -srcfolder mkamsboot-dmg mkamsboot.dmg