summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
6# \/ \/ \/ \/ \/ 6# \/ \/ \/ \/ \/
7# $Id$ 7# $Id$
8# 8#
9TARGET = libucl.a
10
11CFLAGS = -I../include 9CFLAGS = -I../include
12 10
11ifdef RBARCH
12CFLAGS += -arch $(RBARCH)
13endif
14
15OUT = build$(RBARCH)
16
13SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \ 17SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \
14 n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \ 18 n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \
15 ucl_dll.c ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c 19 ucl_dll.c ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c
16 20
17OBJS = alloc.o io.o n2b_99.o n2b_d.o n2b_ds.o n2b_to.o n2d_99.o \ 21OBJS = $(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 \
18 n2d_d.o n2d_ds.o n2d_to.o n2e_99.o n2e_d.o n2e_ds.o n2e_to.o ucl_crc.o \ 22 $(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 \
19 ucl_dll.o ucl_init.o ucl_ptr.o ucl_str.o ucl_util.o 23 $(OUT)/ucl_dll.o $(OUT)/ucl_init.o $(OUT)/ucl_ptr.o $(OUT)/ucl_str.o $(OUT)/ucl_util.o
20 24
21# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools 25# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools
22# not the cross-compiler tools 26# not the cross-compiler tools
23$(TARGET): $(OBJS) 27libucl$(RBARCH).a: $(OUT) $(OBJS)
24 $(SILENT)ar ruv $@ $(OBJS) >/dev/null 2>&1 28 $(SILENT)ar ruv $@ $(OBJS) >/dev/null 2>&1
25 $(SILENT)ranlib $@ 29 $(SILENT)ranlib $@
26 30
31$(OUT)/%.o: %.c
32 @echo CC $<
33 $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
34
35# some trickery to build ppc and i386 from a single call
36ifeq ($(RBARCH),)
37libucli386.a:
38 make RBARCH=i386 libucli386.a
39
40libuclppc.a:
41 make RBARCH=ppc libuclppc.a
42endif
43
44libucl-universal: libucli386.a libuclppc.a
45 @echo lipo libucl.a
46 $(SILENT) rm -f libucl.a
47 lipo -create libuclppc.a libucli386.a -output libucl.a
48
27clean: 49clean:
28 rm -f $(OBJS) $(TARGET) 50 rm -f libucl*.a
51 rm -rf build*
52
53build$(RBARCH):
54 @echo MKDIR build$(RBARCH)
55 $(SILENT)mkdir build$(RBARCH) \ No newline at end of file