summaryrefslogtreecommitdiffstats
path: root/tools/ucl/src
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2009-08-15 15:10:00 +0000
committerDominik Wenger <domonoky@googlemail.com>2009-08-15 15:10:00 +0000
commit044aae2951f2feefc486dd8b80883264fd51b028 (patch)
treec8548ea04ce95bf29bef55cf0df3fc817c4901b4 /tools/ucl/src
parent6932fa397ba9b9cc99ec248602f43aba8e1f86c9 (diff)
downloadrockbox-044aae2951f2feefc486dd8b80883264fd51b028.tar.gz
rockbox-044aae2951f2feefc486dd8b80883264fd51b028.tar.bz2
rockbox-044aae2951f2feefc486dd8b80883264fd51b028.zip
libucl: move intermediate files into a build directory and allow to build a universal lib for macs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22324 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/ucl/src')
-rw-r--r--tools/ucl/src/Makefile41
1 files changed, 34 insertions, 7 deletions
diff --git a/tools/ucl/src/Makefile b/tools/ucl/src/Makefile
index 4481550dfc..ec065f4028 100644
--- a/tools/ucl/src/Makefile
+++ b/tools/ucl/src/Makefile
@@ -6,23 +6,50 @@
# \/ \/ \/ \/ \/
# $Id$
#
-TARGET = libucl.a
-
CFLAGS = -I../include
+ifdef RBARCH
+CFLAGS += -arch $(RBARCH)
+endif
+
+OUT = build$(RBARCH)
+
SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \
n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \
ucl_dll.c ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c
-OBJS = alloc.o io.o n2b_99.o n2b_d.o n2b_ds.o n2b_to.o n2d_99.o \
- n2d_d.o n2d_ds.o n2d_to.o n2e_99.o n2e_d.o n2e_ds.o n2e_to.o ucl_crc.o \
- ucl_dll.o ucl_init.o ucl_ptr.o ucl_str.o ucl_util.o
+OBJS = $(OUT)/alloc.o $(OUT)/io.o $(OUT)/n2b_99.o $(OUT)/n2b_d.o $(OUT)/n2b_ds.o $(OUT)/n2b_to.o $(OUT)/n2d_99.o \
+ $(OUT)/n2d_d.o $(OUT)/n2d_ds.o $(OUT)/n2d_to.o $(OUT)/n2e_99.o $(OUT)/n2e_d.o $(OUT)/n2e_ds.o $(OUT)/n2e_to.o $(OUT)/ucl_crc.o \
+ $(OUT)/ucl_dll.o $(OUT)/ucl_init.o $(OUT)/ucl_ptr.o $(OUT)/ucl_str.o $(OUT)/ucl_util.o
# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools
# not the cross-compiler tools
-$(TARGET): $(OBJS)
+libucl$(RBARCH).a: $(OUT) $(OBJS)
$(SILENT)ar ruv $@ $(OBJS) >/dev/null 2>&1
$(SILENT)ranlib $@
+$(OUT)/%.o: %.c
+ @echo CC $<
+ $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
+
+# some trickery to build ppc and i386 from a single call
+ifeq ($(RBARCH),)
+libucli386.a:
+ make RBARCH=i386 libucli386.a
+
+libuclppc.a:
+ make RBARCH=ppc libuclppc.a
+endif
+
+libucl-universal: libucli386.a libuclppc.a
+ @echo lipo libucl.a
+ $(SILENT) rm -f libucl.a
+ lipo -create libuclppc.a libucli386.a -output libucl.a
+
clean:
- rm -f $(OBJS) $(TARGET)
+ rm -f libucl*.a
+ rm -rf build*
+
+build$(RBARCH):
+ @echo MKDIR build$(RBARCH)
+ $(SILENT)mkdir build$(RBARCH) \ No newline at end of file