summaryrefslogtreecommitdiff
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2009-08-15 13:54:13 +0000
committerDominik Wenger <domonoky@googlemail.com>2009-08-15 13:54:13 +0000
commitf4e2d83f0479cbedafadb071e7031500db01a28b (patch)
tree0e122a4a5a9c455cf982f1e09a32727012de4ec9 /rbutil
parenta66dfa4ab7d09e0826dcf11cd366ea4200fb9c28 (diff)
mkamsboot: move intermediate files into a build directory and allow building of a universal lib (for macs)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22318 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/mkamsboot/Makefile52
1 files changed, 38 insertions, 14 deletions
diff --git a/rbutil/mkamsboot/Makefile b/rbutil/mkamsboot/Makefile
index 17baa1177c..a5ab42157c 100644
--- a/rbutil/mkamsboot/Makefile
+++ b/rbutil/mkamsboot/Makefile
@@ -22,30 +22,54 @@ endif
CC?= gcc
+ifdef RBARCH
+CFLAGS += -arch $(RBARCH)
+endif
+
+OUT = build$(RBARCH)
+
all: $(OUTPUT)
$(LIBUCL):
make -C ../../tools/ucl/src libucl.a
# This file can be generated in the dualboot/ directory
-dualboot.o: dualboot.c
- $(CC) $(CFLAGS) -c -o dualboot.o dualboot.c
+$(OUT)/dualboot.o: dualboot.c
+ $(CC) $(CFLAGS) -c -o $(OUT)/dualboot.o dualboot.c
+
+$(OUT)/md5.o: md5.c md5.h
+ $(CC) $(CFLAGS) -c -o $(OUT)/md5.o -W -Wall md5.c
-md5.o: md5.c md5.h
- $(CC) $(CFLAGS) -c -o md5.o -W -Wall md5.c
+$(OUT)/mkamsboot.o: mkamsboot.c dualboot.h md5.h
+ $(CC) $(CFLAGS) -c -o $(OUT)/mkamsboot.o -W -Wall mkamsboot.c -DVERSION=\"$(APPVERSION)\"
-mkamsboot.o: mkamsboot.c dualboot.h md5.h
- $(CC) $(CFLAGS) -c -o mkamsboot.o -W -Wall mkamsboot.c -DVERSION=\"$(APPVERSION)\"
+$(OUTPUT): $(OUT) $(OUT)/mkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o $(LIBUCL)
+ $(CC) $(CFLAGS) -o $(OUTPUT) $(OUT)/mkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o $(LIBUCL)
-$(OUTPUT): mkamsboot.o md5.o dualboot.o $(LIBUCL)
- $(CC) $(CFLAGS) -o $(OUTPUT) mkamsboot.o md5.o dualboot.o $(LIBUCL)
+$(OUT)/libmkamsboot.o: mkamsboot.c dualboot.h md5.h
+ $(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmkamsboot.o -W -Wall mkamsboot.c
-libmkamsboot.o: mkamsboot.c dualboot.h md5.h
- $(CC) $(CFLAGS) -DLIB -c -o libmkamsboot.o -W -Wall mkamsboot.c
+libmkamsboot$(RBARCH).a: $(OUT) $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o
+ $(AR) ruv libmkamsboot$(RBARCH).a $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o
-libmkamsboot.a: libmkamsboot.o md5.o dualboot.o
- $(AR) ruv libmkamsboot.a libmkamsboot.o md5.o dualboot.o
+# some trickery to build ppc and i386 from a single call
+ifeq ($(RBARCH),)
+libmkamsbooti386.a:
+ make RBARCH=i386 libmkamsbooti386.a
+libmkamsbootppc.a:
+ make RBARCH=ppc libmkamsbootppc.a
+endif
+
+libmkamsboot-universal: libmkamsbooti386.a libmkamsbootppc.a
+ @echo lipo libmkamsboot.a
+ $(SILENT) rm -f libmkamsboot.a
+ lipo -create libmkamsbootppc.a libmkamsbooti386.a -output libmkamsboot.a
+
clean:
- rm -f $(OUTPUT) mkamsboot.o *~ md5.o dualboot.o \
- libmkamsboot.o libmkamsboot.a
+ rm -f $(OUTPUT) libmkamsboot.o libmkamsboot*.a
+ rm -rf build*
+
+build$(RBARCH):
+ @echo MKDIR build$(RBARCH)
+ $(SILENT)mkdir build$(RBARCH) \ No newline at end of file