summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-12-23 18:59:58 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-12-23 18:59:58 +0000
commite1b1183f401974700a67db76f39e2bba9a5984e1 (patch)
tree95c145de01d23ebf4a77c8c69ef30eda8c6793f8
parent7f6c271badb6ff0620a978b876ea0bcea090a24c (diff)
downloadrockbox-e1b1183f401974700a67db76f39e2bba9a5984e1.tar.gz
rockbox-e1b1183f401974700a67db76f39e2bba9a5984e1.zip
Tweak Makefiles a bit to allow cross compiling Rockbox Utility.
- pass AR to the lib Makefiles to make sure the correct one gets used. - create an archive index for archives. - simplify ucl Makefile a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28883 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/mkamsboot/Makefile2
-rw-r--r--rbutil/mkmpioboot/Makefile2
-rw-r--r--rbutil/mktccboot/Makefile2
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro25
-rw-r--r--tools/rbspeex/Makefile2
-rw-r--r--tools/ucl/src/Makefile15
6 files changed, 24 insertions, 24 deletions
diff --git a/rbutil/mkamsboot/Makefile b/rbutil/mkamsboot/Makefile
index 0a9ab3b4e7..a76259794e 100644
--- a/rbutil/mkamsboot/Makefile
+++ b/rbutil/mkamsboot/Makefile
@@ -60,7 +60,7 @@ $(OBJDIR)%.o: %.c
60 60
61libmkamsboot$(RBARCH).a: $(LIBOBJS) 61libmkamsboot$(RBARCH).a: $(LIBOBJS)
62 @echo AR $@ 62 @echo AR $@
63 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^ 63 $(SILENT)$(AR) rucs $(TARGET_DIR)$@ $^
64 64
65# building the standalone executable 65# building the standalone executable
66$(OUTPUT): $(OBJS) $(EXTRADEPS) 66$(OUTPUT): $(OBJS) $(EXTRADEPS)
diff --git a/rbutil/mkmpioboot/Makefile b/rbutil/mkmpioboot/Makefile
index 7ba7c41a1f..5e138b6f12 100644
--- a/rbutil/mkmpioboot/Makefile
+++ b/rbutil/mkmpioboot/Makefile
@@ -54,7 +54,7 @@ $(OBJDIR)%.o: %.c
54 54
55libmkmpioboot$(RBARCH).a: $(LIBOBJS) 55libmkmpioboot$(RBARCH).a: $(LIBOBJS)
56 @echo AR $@ 56 @echo AR $@
57 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^ 57 $(SILENT)$(AR) rucs $(TARGET_DIR)$@ $^
58 58
59# building the standalone executable 59# building the standalone executable
60$(OUTPUT): $(OBJS) $(EXTRADEPS) 60$(OUTPUT): $(OBJS) $(EXTRADEPS)
diff --git a/rbutil/mktccboot/Makefile b/rbutil/mktccboot/Makefile
index 1b8ff5b349..7a7acf87b7 100644
--- a/rbutil/mktccboot/Makefile
+++ b/rbutil/mktccboot/Makefile
@@ -56,7 +56,7 @@ $(OUT)/%.o: %.c $(OUT)
56 56
57libmktccboot$(RBARCH).a: $(LIBOBJS) 57libmktccboot$(RBARCH).a: $(LIBOBJS)
58 @echo AR $@ 58 @echo AR $@
59 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^ 59 $(SILENT)$(AR) rucs $(TARGET_DIR)$@ $^
60 60
61# building the standalone executable 61# building the standalone executable
62$(OUTPUT): $(OBJS) $(EXTRADEPS) 62$(OUTPUT): $(OBJS) $(EXTRADEPS)
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro
index 56be36d9fc..ca7214989c 100644
--- a/rbutil/rbutilqt/rbutilqt.pro
+++ b/rbutil/rbutilqt/rbutilqt.pro
@@ -64,30 +64,35 @@ mac {
64!static:unix:!mac { 64!static:unix:!mac {
65 LIBSPEEX = $$system(pkg-config --silence-errors --libs speex speexdsp) 65 LIBSPEEX = $$system(pkg-config --silence-errors --libs speex speexdsp)
66} 66}
67# The external Makefiles use ar to create libs. To allow cross-compiling pass
68# the ar that matches the current gcc. Since qmake doesn't provide a variable
69# holding the correct ar without any additions we need to figure it ourselves
70# here. This assumes that QMAKE_CC will always be "gcc", maybe with a postfix.
71MYAR = $$replace(QMAKE_CC,gcc.*,ar)
67 72
68rbspeex.commands = @$(MAKE) \ 73rbspeex.commands = @$(MAKE) \
69 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/rbspeex \ 74 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/rbspeex \
70 librbspeex$$RBLIBPOSTFIX \ 75 librbspeex$$RBLIBPOSTFIX \
71 CC=\"$$QMAKE_CC\" \ 76 SYS_SPEEX=\"$$LIBSPEEX\" \
72 SYS_SPEEX=\"$$LIBSPEEX\" 77 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
73libucl.commands = @$(MAKE) \ 78libucl.commands = @$(MAKE) \
74 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/ucl/src \ 79 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/ucl/src \
75 libucl$$RBLIBPOSTFIX \ 80 libucl$$RBLIBPOSTFIX \
76 CC=\"$$QMAKE_CC\" 81 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
77libmkamsboot.commands = @$(MAKE) \ 82libmkamsboot.commands = @$(MAKE) \
78 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkamsboot \ 83 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkamsboot \
79 APPVERSION=\"rbutil\" \ 84 APPVERSION=\"rbutil\" \
80 libmkamsboot$$RBLIBPOSTFIX \ 85 libmkamsboot$$RBLIBPOSTFIX \
81 CC=\"$$QMAKE_CC\" 86 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
82libmktccboot.commands = @$(MAKE) \ 87libmktccboot.commands = @$(MAKE) \
83 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \ 88 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \
84 libmktccboot$$RBLIBPOSTFIX \ 89 libmktccboot$$RBLIBPOSTFIX \
85 CC=\"$$QMAKE_CC\" 90 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
86libmkmpioboot.commands = @$(MAKE) \ 91libmkmpioboot.commands = @$(MAKE) \
87 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkmpioboot \ 92 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkmpioboot \
88 APPVERSION=\"rbutil\" \ 93 APPVERSION=\"rbutil\" \
89 libmkmpioboot$$RBLIBPOSTFIX \ 94 libmkmpioboot$$RBLIBPOSTFIX \
90 CC=\"$$QMAKE_CC\" 95 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
91QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot 96QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
92PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot 97PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
93 98
@@ -111,7 +116,7 @@ INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher
111 116
112DEPENDPATH = $$INCLUDEPATH 117DEPENDPATH = $$INCLUDEPATH
113 118
114LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl 119LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl -lz
115 120
116# Add a (possibly found) libspeex now, don't do this before -lrbspeex! 121# Add a (possibly found) libspeex now, don't do this before -lrbspeex!
117!static:!isEmpty(LIBSPEEX) { 122!static:!isEmpty(LIBSPEEX) {
@@ -152,10 +157,6 @@ unix:!static:libusb1:!macx {
152 DEFINES += LIBUSB1 157 DEFINES += LIBUSB1
153 LIBS += -lusb-1.0 158 LIBS += -lusb-1.0
154} 159}
155unix {
156 # explicitly link zlib, we do need it. Don't rely on implicit linking via Qt.
157 LIBS += -lz
158}
159 160
160unix:!macx:static { 161unix:!macx:static {
161 # force statically linking of libusb. Libraries that are appended 162 # force statically linking of libusb. Libraries that are appended
@@ -177,7 +178,7 @@ macx:intel {
177} 178}
178macx { 179macx {
179 CONFIG += x86 180 CONFIG += x86
180 LIBS += -L/usr/local/lib -lz \ 181 LIBS += -L/usr/local/lib \
181 -framework IOKit -framework CoreFoundation -framework Carbon \ 182 -framework IOKit -framework CoreFoundation -framework Carbon \
182 -framework SystemConfiguration -framework CoreServices 183 -framework SystemConfiguration -framework CoreServices
183 INCLUDEPATH += /usr/local/include 184 INCLUDEPATH += /usr/local/include
diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile
index 2fb1c4dc00..e52543c40c 100644
--- a/tools/rbspeex/Makefile
+++ b/tools/rbspeex/Makefile
@@ -72,7 +72,7 @@ $(DEPFILE): $(SOURCES)
72 72
73$(OUT)/librbspeex.a: $(OBJS) $(DEPFILE) $(OUT)/rbspeex.o 73$(OUT)/librbspeex.a: $(OBJS) $(DEPFILE) $(OUT)/rbspeex.o
74 @echo AR $(OUT)/librbspeex$(RBARCH).a 74 @echo AR $(OUT)/librbspeex$(RBARCH).a
75 $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1 75 $(SILENT)$(AR) rucs $@ $+ > /dev/null 2>&1
76 76
77librbspeex$(RBARCH).a: $(OUT)/librbspeex.a 77librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
78 $(SILENT)cp $(OUT)/librbspeex.a $(TARGET_DIR)librbspeex$(RBARCH).a 78 $(SILENT)cp $(OUT)/librbspeex.a $(TARGET_DIR)librbspeex$(RBARCH).a
diff --git a/tools/ucl/src/Makefile b/tools/ucl/src/Makefile
index c519844e93..3a13acc47e 100644
--- a/tools/ucl/src/Makefile
+++ b/tools/ucl/src/Makefile
@@ -21,17 +21,16 @@ OUT = $(TARGET_DIR)build$(RBARCH)
21 21
22SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \ 22SOURCES = 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 \ 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 ucl_dll.c ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c 24 ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c #ucl_dll.c
25 25
26OBJS = $(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 \ 26OBJS = $(addprefix $(OUT)/,$(SOURCES:%.c=%.o))
27 $(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 \ 27
28 $(OUT)/ucl_dll.o $(OUT)/ucl_init.o $(OUT)/ucl_ptr.o $(OUT)/ucl_str.o $(OUT)/ucl_util.o 28# 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.
29 30
30# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools
31# not the cross-compiler tools
32libucl$(RBARCH).a: $(OUT) $(OBJS) 31libucl$(RBARCH).a: $(OUT) $(OBJS)
33 $(SILENT)ar ruv $(TARGET_DIR)$@ $(OBJS) >/dev/null 2>&1 32 @echo AR $@
34 $(SILENT)ranlib $(TARGET_DIR)$@ 33 $(SILENT)$(AR) rucs $(TARGET_DIR)$@ $(OBJS) >/dev/null 2>&1
35 34
36$(OUT)/%.o: %.c 35$(OUT)/%.o: %.c
37 @echo CC $< 36 @echo CC $<