Subversion Repositories freemyipod

Rev

Rev 462 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
870 theseven 1
#             __________               __   ___.
2
#   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
3
#   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
4
#   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
5
#   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
6
#                     \/            \/     \/    \/            \/
7
# $Id: Makefile 23982 2009-12-13 21:30:28Z bluebrother $
8
#
9
CFLAGS = -I../include
10
 
11
ifndef V
12
SILENT = @
13
endif
14
 
15
ifeq ($(shell uname),WindowsNT)
16
CCACHE :=
17
else
18
CCACHE := $(shell which ccache)
19
endif
20
 
21
ifdef RBARCH
22
CFLAGS += -arch $(RBARCH)
23
endif
24
 
25
 
26
OUT = $(TARGET_DIR)build$(RBARCH)
27
 
28
SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c	\
29
	n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c	\
30
	ucl_dll.c ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c
31
 
32
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	\
33
	$(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	\
34
	$(OUT)/ucl_dll.o $(OUT)/ucl_init.o $(OUT)/ucl_ptr.o $(OUT)/ucl_str.o $(OUT)/ucl_util.o
35
 
36
# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools
37
# not the cross-compiler tools
38
libucl$(RBARCH).a: $(OUT) $(OBJS)
39
	$(SILENT)ar ruv $(TARGET_DIR)$@ $(OBJS)
40
	$(SILENT)ranlib $(TARGET_DIR)$@
41
 
42
$(OUT)/%.o: %.c
43
	@echo CC $<
44
	$(SILENT)$(CCACHE) $(CC) $(CFLAGS) -c $< -o $@
45
 
46
# some trickery to build ppc and i386 from a single call
47
ifeq ($(RBARCH),)
48
$(TARGET_DIR)libucli386.a:
49
	make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libucli386.a
50
 
51
$(TARGET_DIR)libuclppc.a:
52
	make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a
53
endif    
54
 
55
libucl-universal: $(TARGET_DIR)libucli386.a $(TARGET_DIR)libuclppc.a
56
	@echo lipo $(TARGET_DIR)libucl.a
57
	$(SILENT) rm -f $(TARGET_DIR)libucl.a
58
	$(SILENT)lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a
59
 
60
clean:
61
	rm -f $(TARGET_DIR)libucl*.a
62
	rm -rf build*
63
 
64
$(OUT):
65
	@echo MKDIR $(OUT)
66
	$(SILENT)mkdir $(OUT)
67