diff options
-rw-r--r-- | tools/ucl/src/Makefile | 41 |
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 | # |
9 | TARGET = libucl.a | ||
10 | |||
11 | CFLAGS = -I../include | 9 | CFLAGS = -I../include |
12 | 10 | ||
11 | ifdef RBARCH | ||
12 | CFLAGS += -arch $(RBARCH) | ||
13 | endif | ||
14 | |||
15 | OUT = build$(RBARCH) | ||
16 | |||
13 | SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \ | 17 | SOURCES = 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 | ||
17 | OBJS = alloc.o io.o n2b_99.o n2b_d.o n2b_ds.o n2b_to.o n2d_99.o \ | 21 | 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 \ |
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) | 27 | libucl$(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 | ||
36 | ifeq ($(RBARCH),) | ||
37 | libucli386.a: | ||
38 | make RBARCH=i386 libucli386.a | ||
39 | |||
40 | libuclppc.a: | ||
41 | make RBARCH=ppc libuclppc.a | ||
42 | endif | ||
43 | |||
44 | libucl-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 | |||
27 | clean: | 49 | clean: |
28 | rm -f $(OBJS) $(TARGET) | 50 | rm -f libucl*.a |
51 | rm -rf build* | ||
52 | |||
53 | build$(RBARCH): | ||
54 | @echo MKDIR build$(RBARCH) | ||
55 | $(SILENT)mkdir build$(RBARCH) \ No newline at end of file | ||