diff options
Diffstat (limited to 'tools/ucl')
-rw-r--r-- | tools/ucl/src/Makefile | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/ucl/src/Makefile b/tools/ucl/src/Makefile index 01fb66f513..33972bb617 100644 --- a/tools/ucl/src/Makefile +++ b/tools/ucl/src/Makefile | |||
@@ -17,25 +17,29 @@ CFLAGS += -arch $(RBARCH) | |||
17 | endif | 17 | endif |
18 | 18 | ||
19 | 19 | ||
20 | OUT = $(TARGET_DIR)build$(RBARCH) | 20 | TARGET_DIR ?= $(shell pwd) |
21 | OBJDIR = $(TARGET_DIR)build$(RBARCH) | ||
21 | 22 | ||
22 | SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \ | 23 | SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \ |
23 | n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \ | 24 | n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \ |
24 | ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c #ucl_dll.c | 25 | ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c #ucl_dll.c |
25 | 26 | ||
26 | OBJS = $(addprefix $(OUT)/,$(SOURCES:%.c=%.o)) | 27 | OBJS = $(addprefix $(OBJDIR)/,$(SOURCES:%.c=%.o)) |
27 | 28 | ||
28 | # This Makefile is _not_ used to build uclpack for Rockbox builds anymore (they | 29 | # This Makefile is _not_ used to build uclpack for Rockbox builds anymore (they |
29 | # use tools.make), so we can use $(CC) and $(AR) here. | 30 | # use tools.make), so we can use $(CC) and $(AR) here. |
30 | 31 | ||
31 | libucl$(RBARCH).a: $(OUT) $(OBJS) | 32 | libucl$(RBARCH).a: $(TARGET_DIR)libucl$(RBARCH).a |
32 | @echo AR $@ | ||
33 | $(SILENT)$(AR) rucs $(TARGET_DIR)$@ $(OBJS) >/dev/null 2>&1 | ||
34 | 33 | ||
35 | $(OUT)/%.o: %.c | 34 | $(TARGET_DIR)libucl$(RBARCH).a: $(OBJS) |
35 | @echo AR $(notdir $@) | ||
36 | $(SILENT)$(AR) rucs $@ $(OBJS) >/dev/null 2>&1 | ||
37 | |||
38 | $(OBJDIR)/%.o: %.c | ||
36 | @echo CC $< | 39 | @echo CC $< |
40 | $(SILENT)mkdir -p $(dir $@) | ||
37 | $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ | 41 | $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ |
38 | 42 | ||
39 | # some trickery to build ppc and i386 from a single call | 43 | # some trickery to build ppc and i386 from a single call |
40 | ifeq ($(RBARCH),) | 44 | ifeq ($(RBARCH),) |
41 | $(TARGET_DIR)libucli386.a: | 45 | $(TARGET_DIR)libucli386.a: |
@@ -43,18 +47,14 @@ $(TARGET_DIR)libucli386.a: | |||
43 | 47 | ||
44 | $(TARGET_DIR)libuclppc.a: | 48 | $(TARGET_DIR)libuclppc.a: |
45 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a | 49 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a |
46 | endif | 50 | endif |
47 | 51 | ||
48 | libucl-universal: $(TARGET_DIR)libucli386.a $(TARGET_DIR)libuclppc.a | 52 | libucl-universal: $(TARGET_DIR)libucli386.a $(TARGET_DIR)libuclppc.a |
49 | @echo lipo $(TARGET_DIR)libucl.a | 53 | @echo lipo $(TARGET_DIR)libucl.a |
50 | $(SILENT) rm -f $(TARGET_DIR)libucl.a | 54 | $(SILENT) rm -f $(TARGET_DIR)libucl.a |
51 | $(SILENT)lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a | 55 | $(SILENT)lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a |
52 | 56 | ||
53 | clean: | 57 | clean: |
54 | rm -f $(TARGET_DIR)libucl*.a | 58 | rm -f $(TARGET_DIR)libucl*.a |
55 | rm -rf build* | 59 | rm -rf build* |
56 | 60 | ||
57 | $(OUT): | ||
58 | @echo MKDIR $(OUT) | ||
59 | $(SILENT)mkdir -p $(OUT) | ||
60 | |||