diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2009-09-04 21:31:17 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2009-09-04 21:31:17 +0000 |
commit | 4d86861ce5e736503de058e221d13d600807efb4 (patch) | |
tree | 3945fa408a239ce751b1ce53a58d6b255e364da1 | |
parent | 4dd44bffb0f985366587e788a1e34a25c2733919 (diff) | |
download | rockbox-4d86861ce5e736503de058e221d13d600807efb4.tar.gz rockbox-4d86861ce5e736503de058e221d13d600807efb4.zip |
rbutil: modify buildsystem so you can build outside of the rbutilqt directoy. (similar to the normal buildsystem). Attention: Spaces in the path will cause errors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22624 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/mkamsboot/Makefile | 25 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 42 | ||||
-rw-r--r-- | tools/rbspeex/Makefile | 24 | ||||
-rw-r--r-- | tools/ucl/src/Makefile | 25 |
4 files changed, 62 insertions, 54 deletions
diff --git a/rbutil/mkamsboot/Makefile b/rbutil/mkamsboot/Makefile index 3b4cc11404..8f4953a9e3 100644 --- a/rbutil/mkamsboot/Makefile +++ b/rbutil/mkamsboot/Makefile | |||
@@ -25,18 +25,17 @@ endif | |||
25 | endif | 25 | endif |
26 | endif | 26 | endif |
27 | 27 | ||
28 | CC?= gcc | ||
29 | 28 | ||
30 | ifdef RBARCH | 29 | ifdef RBARCH |
31 | CFLAGS += -arch $(RBARCH) | 30 | CFLAGS += -arch $(RBARCH) |
32 | endif | 31 | endif |
33 | 32 | ||
34 | OUT = build$(RBARCH) | 33 | OUT = $(TARGET_DIR)build$(RBARCH) |
35 | 34 | ||
36 | all: $(OUTPUT) | 35 | all: $(OUTPUT) |
37 | 36 | ||
38 | $(LIBUCL): | 37 | $(LIBUCL): |
39 | make -C ../../tools/ucl/src libucl.a | 38 | make -C ../../tools/ucl/src $(TARGET_DIR)libucl.a |
40 | 39 | ||
41 | # This file can be generated in the dualboot/ directory | 40 | # This file can be generated in the dualboot/ directory |
42 | $(OUT)/dualboot.o: dualboot.c | 41 | $(OUT)/dualboot.o: dualboot.c |
@@ -55,27 +54,27 @@ $(OUT)/libmkamsboot.o: mkamsboot.c dualboot.h md5.h | |||
55 | $(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmkamsboot.o -W -Wall mkamsboot.c | 54 | $(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmkamsboot.o -W -Wall mkamsboot.c |
56 | 55 | ||
57 | libmkamsboot$(RBARCH).a: $(OUT) $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o | 56 | libmkamsboot$(RBARCH).a: $(OUT) $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o |
58 | $(AR) ru libmkamsboot$(RBARCH).a $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o | 57 | $(AR) ru $(TARGET_DIR)libmkamsboot$(RBARCH).a $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o |
59 | 58 | ||
60 | # some trickery to build ppc and i386 from a single call | 59 | # some trickery to build ppc and i386 from a single call |
61 | ifeq ($(RBARCH),) | 60 | ifeq ($(RBARCH),) |
62 | libmkamsbooti386.a: | 61 | libmkamsbooti386.a: |
63 | make RBARCH=i386 libmkamsbooti386.a | 62 | make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmkamsbooti386.a |
64 | 63 | ||
65 | libmkamsbootppc.a: | 64 | libmkamsbootppc.a: |
66 | make RBARCH=ppc libmkamsbootppc.a | 65 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmkamsbootppc.a |
67 | endif | 66 | endif |
68 | 67 | ||
69 | libmkamsboot-universal: libmkamsbooti386.a libmkamsbootppc.a | 68 | libmkamsboot-universal: libmkamsbooti386.a libmkamsbootppc.a |
70 | @echo lipo libmkamsboot.a | 69 | @echo lipo $(TARGET_DIR)libmkamsboot.a |
71 | $(SILENT) rm -f libmkamsboot.a | 70 | $(SILENT) rm -f $(TARGET_DIR)libmkamsboot.a |
72 | lipo -create libmkamsbootppc.a libmkamsbooti386.a -output libmkamsboot.a | 71 | lipo -create $(TARGET_DIR)libmkamsbootppc.a $(TARGET_DIR)libmkamsbooti386.a -output $(TARGET_DIR)libmkamsboot.a |
73 | 72 | ||
74 | clean: | 73 | clean: |
75 | rm -f $(OUTPUT) libmkamsboot.o libmkamsboot*.a | 74 | rm -f $(OUTPUT) libmkamsboot.o $(TARGET_DIR)libmkamsboot*.a |
76 | rm -rf build* | 75 | rm -rf build* |
77 | 76 | ||
78 | build$(RBARCH): | 77 | $(OUT): |
79 | @echo MKDIR build$(RBARCH) | 78 | @echo MKDIR $(OUT) |
80 | $(SILENT)mkdir build$(RBARCH) | 79 | $(SILENT)mkdir $(OUT) |
81 | 80 | ||
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index 78c399ebd7..cdae11dc5c 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro | |||
@@ -1,3 +1,6 @@ | |||
1 | |||
2 | |||
3 | # ccache | ||
1 | unix:!mac { | 4 | unix:!mac { |
2 | CCACHE = $$system(which ccache) | 5 | CCACHE = $$system(which ccache) |
3 | !isEmpty(CCACHE) { | 6 | !isEmpty(CCACHE) { |
@@ -7,10 +10,10 @@ unix:!mac { | |||
7 | } | 10 | } |
8 | } | 11 | } |
9 | 12 | ||
10 | OBJECTS_DIR = build/o | 13 | OBJECTS_DIR = $$OUT_PWD/build/o |
11 | UI_DIR = build/ui | 14 | UI_DIR = $$OUT_PWD/build/ui |
12 | MOC_DIR = build/moc | 15 | MOC_DIR = $$OUT_PWD/build/moc |
13 | RCC_DIR = build/rcc | 16 | RCC_DIR = $$OUT_PWD/build/rcc |
14 | 17 | ||
15 | # check version of Qt installation | 18 | # check version of Qt installation |
16 | VER = $$find(QT_VERSION, ^4\.[3-9]+.*) | 19 | VER = $$find(QT_VERSION, ^4\.[3-9]+.*) |
@@ -20,12 +23,17 @@ isEmpty(VER) { | |||
20 | } | 23 | } |
21 | message("Qt version used:" $$VER) | 24 | message("Qt version used:" $$VER) |
22 | 25 | ||
26 | RBBASE_DIR = $$_PRO_FILE_PWD_ | ||
27 | RBBASE_DIR = $$replace(RBBASE_DIR,/rbutil/rbutilqt,) | ||
28 | |||
29 | message("Rockbox Base dir: "$$RBBASE_DIR) | ||
30 | |||
23 | # add a custom rule for pre-building librbspeex | 31 | # add a custom rule for pre-building librbspeex |
24 | !mac { | 32 | !mac { |
25 | rbspeex.commands = @$(MAKE) -C ../../tools/rbspeex librbspeex.a | 33 | rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a |
26 | } | 34 | } |
27 | mac { | 35 | mac { |
28 | rbspeex.commands = @$(MAKE) -C ../../tools/rbspeex librbspeex-universal | 36 | rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex-universal |
29 | } | 37 | } |
30 | QMAKE_EXTRA_TARGETS += rbspeex | 38 | QMAKE_EXTRA_TARGETS += rbspeex |
31 | PRE_TARGETDEPS += rbspeex | 39 | PRE_TARGETDEPS += rbspeex |
@@ -36,7 +44,7 @@ tags.depends = $(SOURCES) | |||
36 | QMAKE_EXTRA_TARGETS += tags | 44 | QMAKE_EXTRA_TARGETS += tags |
37 | 45 | ||
38 | # add a custom rule for making the translations | 46 | # add a custom rule for making the translations |
39 | lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent rbutilqt.pro | 47 | lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent $$_PRO_FILE_ |
40 | QMAKE_EXTRA_TARGETS += lrelease | 48 | QMAKE_EXTRA_TARGETS += lrelease |
41 | !dbg { | 49 | !dbg { |
42 | PRE_TARGETDEPS += lrelease | 50 | PRE_TARGETDEPS += lrelease |
@@ -44,20 +52,20 @@ QMAKE_EXTRA_TARGETS += lrelease | |||
44 | 52 | ||
45 | #custom rules for libucl.a | 53 | #custom rules for libucl.a |
46 | !mac { | 54 | !mac { |
47 | libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl.a | 55 | libucl.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/ucl/src libucl.a |
48 | } | 56 | } |
49 | mac { | 57 | mac { |
50 | libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl-universal | 58 | libucl.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/ucl/src libucl-universal |
51 | } | 59 | } |
52 | QMAKE_EXTRA_TARGETS += libucl | 60 | QMAKE_EXTRA_TARGETS += libucl |
53 | PRE_TARGETDEPS += libucl | 61 | PRE_TARGETDEPS += libucl |
54 | 62 | ||
55 | #custom rules for libmkamsboot.a | 63 | #custom rules for libmkamsboot.a |
56 | !mac { | 64 | !mac { |
57 | libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot.a | 65 | libmkamsboot.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot.a |
58 | } | 66 | } |
59 | mac { | 67 | mac { |
60 | libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot-universal | 68 | libmkamsboot.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot-universal |
61 | } | 69 | } |
62 | QMAKE_EXTRA_TARGETS += libmkamsboot | 70 | QMAKE_EXTRA_TARGETS += libmkamsboot |
63 | PRE_TARGETDEPS += libmkamsboot | 71 | PRE_TARGETDEPS += libmkamsboot |
@@ -167,10 +175,10 @@ HEADERS += rbutilqt.h \ | |||
167 | ../../tools/iriver.h | 175 | ../../tools/iriver.h |
168 | 176 | ||
169 | # Needed by QT on Win | 177 | # Needed by QT on Win |
170 | INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools | 178 | INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools $$_PRO_FILE_PWD_/zip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base |
171 | INCLUDEPATH += base | 179 | INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools |
172 | 180 | ||
173 | LIBS += -L../../tools/rbspeex -lrbspeex -L../mkamsboot -lmkamsboot -L../../tools/ucl/src/ -lucl | 181 | LIBS += -L$$OUT_PWD -lrbspeex -lmkamsboot -lucl |
174 | 182 | ||
175 | TEMPLATE = app | 183 | TEMPLATE = app |
176 | dbg { | 184 | dbg { |
@@ -201,12 +209,12 @@ FORMS += rbutilqtfrm.ui \ | |||
201 | sysinfofrm.ui \ | 209 | sysinfofrm.ui \ |
202 | systracefrm.ui | 210 | systracefrm.ui |
203 | 211 | ||
204 | RESOURCES += rbutilqt.qrc | 212 | RESOURCES += $$_PRO_FILE_PWD_/rbutilqt.qrc |
205 | win32 { | 213 | win32 { |
206 | RESOURCES += rbutilqt-win.qrc | 214 | RESOURCES += $$_PRO_FILE_PWD_/rbutilqt-win.qrc |
207 | } | 215 | } |
208 | !dbg { | 216 | !dbg { |
209 | RESOURCES += rbutilqt-lang.qrc | 217 | RESOURCES += $$_PRO_FILE_PWD_/rbutilqt-lang.qrc |
210 | } | 218 | } |
211 | 219 | ||
212 | TRANSLATIONS += lang/rbutil_de.ts \ | 220 | TRANSLATIONS += lang/rbutil_de.ts \ |
diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile index a82e80e017..41bf775d38 100644 --- a/tools/rbspeex/Makefile +++ b/tools/rbspeex/Makefile | |||
@@ -35,7 +35,7 @@ endif | |||
35 | # This sets up 'SRC' based on the files mentioned in SOURCES | 35 | # This sets up 'SRC' based on the files mentioned in SOURCES |
36 | SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") | 36 | SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") |
37 | 37 | ||
38 | OUT = build$(RBARCH) | 38 | OUT = $(TARGET_DIR)build$(RBARCH) |
39 | SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c | 39 | SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c |
40 | OBJS = $(addprefix $(OUT)/,$(SRC:%.c=%.o)) | 40 | OBJS = $(addprefix $(OUT)/,$(SRC:%.c=%.o)) |
41 | DEPFILE = $(OUT)/dep-speex | 41 | DEPFILE = $(OUT)/dep-speex |
@@ -46,8 +46,8 @@ DIRS = | |||
46 | all: ../rbspeexenc ../rbspeexdec | 46 | all: ../rbspeexenc ../rbspeexdec |
47 | 47 | ||
48 | $(DEPFILE): $(SOURCES) | 48 | $(DEPFILE): $(SOURCES) |
49 | @echo MKDIR build$(RBARCH) | 49 | @echo MKDIR $(OUT) |
50 | $(SILENT)mkdir -p build$(RBARCH) | 50 | $(SILENT)mkdir -p $(OUT) |
51 | @echo Creating dependencies | 51 | @echo Creating dependencies |
52 | $(SILENT)rm -f $(DEPFILE) | 52 | $(SILENT)rm -f $(DEPFILE) |
53 | $(SILENT)(for each in $(SOURCES) x; do \ | 53 | $(SILENT)(for each in $(SOURCES) x; do \ |
@@ -69,7 +69,7 @@ $(OUT)/librbspeex.a: $(OBJS) $(DEPFILE) $(OUT)/rbspeex.o | |||
69 | $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1 | 69 | $(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1 |
70 | 70 | ||
71 | librbspeex$(RBARCH).a: $(OUT)/librbspeex.a | 71 | librbspeex$(RBARCH).a: $(OUT)/librbspeex.a |
72 | $(SILENT)cp $(OUT)/librbspeex.a librbspeex$(RBARCH).a | 72 | $(SILENT)cp $(OUT)/librbspeex.a $(TARGET_DIR)librbspeex$(RBARCH).a |
73 | 73 | ||
74 | ../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a | 74 | ../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a |
75 | @echo Linking ../rbspeexenc | 75 | @echo Linking ../rbspeexenc |
@@ -86,22 +86,22 @@ librbspeex$(RBARCH).a: $(OUT)/librbspeex.a | |||
86 | # some trickery to build ppc and i386 from a single call | 86 | # some trickery to build ppc and i386 from a single call |
87 | ifeq ($(RBARCH),) | 87 | ifeq ($(RBARCH),) |
88 | librbspeexi386.a: | 88 | librbspeexi386.a: |
89 | make RBARCH=i386 librbspeexi386.a | 89 | make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) librbspeexi386.a |
90 | 90 | ||
91 | librbspeexppc.a: | 91 | librbspeexppc.a: |
92 | make RBARCH=ppc librbspeexppc.a | 92 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) librbspeexppc.a |
93 | endif | 93 | endif |
94 | 94 | ||
95 | librbspeex-universal: librbspeexi386.a librbspeexppc.a | 95 | librbspeex-universal: librbspeexi386.a librbspeexppc.a |
96 | @echo lipo librbspeex.a | 96 | @echo lipo librbspeex.a |
97 | $(SILENT) rm -f librbspeex.a | 97 | $(SILENT) rm -f $(TARGET_DIR)librbspeex.a |
98 | lipo -create librbspeexppc.a librbspeexi386.a -output librbspeex.a | 98 | lipo -create $(TARGET_DIR)librbspeexppc.a $(TARGET_DIR)librbspeexi386.a -output $(TARGET_DIR)librbspeex.a |
99 | 99 | ||
100 | clean: | 100 | clean: |
101 | rm -f $(OBJS) librbspeex* ../rbspeexenc ../rbspeexdec dep-speex | 101 | rm -f $(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec $(TARGET_DIR)dep-speex |
102 | rm -rf build* | 102 | rm -rf build* |
103 | 103 | ||
104 | build$(RBARCH): | 104 | $(OUT): |
105 | @echo MKDIR build$(RBARCH) | 105 | @echo MKDIR $(OUT) |
106 | $(SILENT)mkdir build$(RBARCH) | 106 | $(SILENT)mkdir $(OUT) |
107 | 107 | ||
diff --git a/tools/ucl/src/Makefile b/tools/ucl/src/Makefile index b4b841a4f1..147959aaa1 100644 --- a/tools/ucl/src/Makefile +++ b/tools/ucl/src/Makefile | |||
@@ -17,7 +17,8 @@ ifdef RBARCH | |||
17 | CFLAGS += -arch $(RBARCH) | 17 | CFLAGS += -arch $(RBARCH) |
18 | endif | 18 | endif |
19 | 19 | ||
20 | OUT = build$(RBARCH) | 20 | |
21 | OUT = $(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 \ |
@@ -30,8 +31,8 @@ OBJS = $(OUT)/alloc.o $(OUT)/io.o $(OUT)/n2b_99.o $(OUT)/n2b_d.o $(OUT)/n2b_ds.o | |||
30 | # we don't use $(AR) and $(RANLIB) below since we want the _native_ tools | 31 | # we don't use $(AR) and $(RANLIB) below since we want the _native_ tools |
31 | # not the cross-compiler tools | 32 | # not the cross-compiler tools |
32 | libucl$(RBARCH).a: $(OUT) $(OBJS) | 33 | libucl$(RBARCH).a: $(OUT) $(OBJS) |
33 | $(SILENT)ar ruv $@ $(OBJS) >/dev/null 2>&1 | 34 | $(SILENT)ar ruv $(TARGET_DIR)$@ $(OBJS) >/dev/null 2>&1 |
34 | $(SILENT)ranlib $@ | 35 | $(SILENT)ranlib $(TARGET_DIR)$@ |
35 | 36 | ||
36 | $(OUT)/%.o: %.c | 37 | $(OUT)/%.o: %.c |
37 | @echo CC $< | 38 | @echo CC $< |
@@ -40,22 +41,22 @@ $(OUT)/%.o: %.c | |||
40 | # some trickery to build ppc and i386 from a single call | 41 | # some trickery to build ppc and i386 from a single call |
41 | ifeq ($(RBARCH),) | 42 | ifeq ($(RBARCH),) |
42 | libucli386.a: | 43 | libucli386.a: |
43 | make RBARCH=i386 libucli386.a | 44 | make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libucli386.a |
44 | 45 | ||
45 | libuclppc.a: | 46 | libuclppc.a: |
46 | make RBARCH=ppc libuclppc.a | 47 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a |
47 | endif | 48 | endif |
48 | 49 | ||
49 | libucl-universal: libucli386.a libuclppc.a | 50 | libucl-universal: libucli386.a libuclppc.a |
50 | @echo lipo libucl.a | 51 | @echo lipo $(TARGET_DIR)libucl.a |
51 | $(SILENT) rm -f libucl.a | 52 | $(SILENT) rm -f $(TARGET_DIR)libucl.a |
52 | lipo -create libuclppc.a libucli386.a -output libucl.a | 53 | lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a |
53 | 54 | ||
54 | clean: | 55 | clean: |
55 | rm -f libucl*.a | 56 | rm -f $(TARGET_DIR)libucl*.a |
56 | rm -rf build* | 57 | rm -rf build* |
57 | 58 | ||
58 | build$(RBARCH): | 59 | $(OUT): |
59 | @echo MKDIR build$(RBARCH) | 60 | @echo MKDIR $(OUT) |
60 | $(SILENT)mkdir build$(RBARCH) | 61 | $(SILENT)mkdir $(OUT) |
61 | 62 | ||