forked from len0rd/rockbox
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
This commit is contained in:
parent
4dd44bffb0
commit
4d86861ce5
4 changed files with 62 additions and 54 deletions
|
@ -25,18 +25,17 @@ endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CC?= gcc
|
|
||||||
|
|
||||||
ifdef RBARCH
|
ifdef RBARCH
|
||||||
CFLAGS += -arch $(RBARCH)
|
CFLAGS += -arch $(RBARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OUT = build$(RBARCH)
|
OUT = $(TARGET_DIR)build$(RBARCH)
|
||||||
|
|
||||||
all: $(OUTPUT)
|
all: $(OUTPUT)
|
||||||
|
|
||||||
$(LIBUCL):
|
$(LIBUCL):
|
||||||
make -C ../../tools/ucl/src libucl.a
|
make -C ../../tools/ucl/src $(TARGET_DIR)libucl.a
|
||||||
|
|
||||||
# This file can be generated in the dualboot/ directory
|
# This file can be generated in the dualboot/ directory
|
||||||
$(OUT)/dualboot.o: dualboot.c
|
$(OUT)/dualboot.o: dualboot.c
|
||||||
|
@ -55,27 +54,27 @@ $(OUT)/libmkamsboot.o: mkamsboot.c dualboot.h md5.h
|
||||||
$(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmkamsboot.o -W -Wall mkamsboot.c
|
$(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmkamsboot.o -W -Wall mkamsboot.c
|
||||||
|
|
||||||
libmkamsboot$(RBARCH).a: $(OUT) $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o
|
libmkamsboot$(RBARCH).a: $(OUT) $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o
|
||||||
$(AR) ru libmkamsboot$(RBARCH).a $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o
|
$(AR) ru $(TARGET_DIR)libmkamsboot$(RBARCH).a $(OUT)/libmkamsboot.o $(OUT)/md5.o $(OUT)/dualboot.o
|
||||||
|
|
||||||
# some trickery to build ppc and i386 from a single call
|
# some trickery to build ppc and i386 from a single call
|
||||||
ifeq ($(RBARCH),)
|
ifeq ($(RBARCH),)
|
||||||
libmkamsbooti386.a:
|
libmkamsbooti386.a:
|
||||||
make RBARCH=i386 libmkamsbooti386.a
|
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmkamsbooti386.a
|
||||||
|
|
||||||
libmkamsbootppc.a:
|
libmkamsbootppc.a:
|
||||||
make RBARCH=ppc libmkamsbootppc.a
|
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmkamsbootppc.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libmkamsboot-universal: libmkamsbooti386.a libmkamsbootppc.a
|
libmkamsboot-universal: libmkamsbooti386.a libmkamsbootppc.a
|
||||||
@echo lipo libmkamsboot.a
|
@echo lipo $(TARGET_DIR)libmkamsboot.a
|
||||||
$(SILENT) rm -f libmkamsboot.a
|
$(SILENT) rm -f $(TARGET_DIR)libmkamsboot.a
|
||||||
lipo -create libmkamsbootppc.a libmkamsbooti386.a -output libmkamsboot.a
|
lipo -create $(TARGET_DIR)libmkamsbootppc.a $(TARGET_DIR)libmkamsbooti386.a -output $(TARGET_DIR)libmkamsboot.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OUTPUT) libmkamsboot.o libmkamsboot*.a
|
rm -f $(OUTPUT) libmkamsboot.o $(TARGET_DIR)libmkamsboot*.a
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
|
|
||||||
build$(RBARCH):
|
$(OUT):
|
||||||
@echo MKDIR build$(RBARCH)
|
@echo MKDIR $(OUT)
|
||||||
$(SILENT)mkdir build$(RBARCH)
|
$(SILENT)mkdir $(OUT)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
# ccache
|
||||||
unix:!mac {
|
unix:!mac {
|
||||||
CCACHE = $$system(which ccache)
|
CCACHE = $$system(which ccache)
|
||||||
!isEmpty(CCACHE) {
|
!isEmpty(CCACHE) {
|
||||||
|
@ -7,10 +10,10 @@ unix:!mac {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECTS_DIR = build/o
|
OBJECTS_DIR = $$OUT_PWD/build/o
|
||||||
UI_DIR = build/ui
|
UI_DIR = $$OUT_PWD/build/ui
|
||||||
MOC_DIR = build/moc
|
MOC_DIR = $$OUT_PWD/build/moc
|
||||||
RCC_DIR = build/rcc
|
RCC_DIR = $$OUT_PWD/build/rcc
|
||||||
|
|
||||||
# check version of Qt installation
|
# check version of Qt installation
|
||||||
VER = $$find(QT_VERSION, ^4\.[3-9]+.*)
|
VER = $$find(QT_VERSION, ^4\.[3-9]+.*)
|
||||||
|
@ -20,12 +23,17 @@ isEmpty(VER) {
|
||||||
}
|
}
|
||||||
message("Qt version used:" $$VER)
|
message("Qt version used:" $$VER)
|
||||||
|
|
||||||
|
RBBASE_DIR = $$_PRO_FILE_PWD_
|
||||||
|
RBBASE_DIR = $$replace(RBBASE_DIR,/rbutil/rbutilqt,)
|
||||||
|
|
||||||
|
message("Rockbox Base dir: "$$RBBASE_DIR)
|
||||||
|
|
||||||
# add a custom rule for pre-building librbspeex
|
# add a custom rule for pre-building librbspeex
|
||||||
!mac {
|
!mac {
|
||||||
rbspeex.commands = @$(MAKE) -C ../../tools/rbspeex librbspeex.a
|
rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a
|
||||||
}
|
}
|
||||||
mac {
|
mac {
|
||||||
rbspeex.commands = @$(MAKE) -C ../../tools/rbspeex librbspeex-universal
|
rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex-universal
|
||||||
}
|
}
|
||||||
QMAKE_EXTRA_TARGETS += rbspeex
|
QMAKE_EXTRA_TARGETS += rbspeex
|
||||||
PRE_TARGETDEPS += rbspeex
|
PRE_TARGETDEPS += rbspeex
|
||||||
|
@ -36,7 +44,7 @@ tags.depends = $(SOURCES)
|
||||||
QMAKE_EXTRA_TARGETS += tags
|
QMAKE_EXTRA_TARGETS += tags
|
||||||
|
|
||||||
# add a custom rule for making the translations
|
# add a custom rule for making the translations
|
||||||
lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent rbutilqt.pro
|
lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent $$_PRO_FILE_
|
||||||
QMAKE_EXTRA_TARGETS += lrelease
|
QMAKE_EXTRA_TARGETS += lrelease
|
||||||
!dbg {
|
!dbg {
|
||||||
PRE_TARGETDEPS += lrelease
|
PRE_TARGETDEPS += lrelease
|
||||||
|
@ -44,20 +52,20 @@ QMAKE_EXTRA_TARGETS += lrelease
|
||||||
|
|
||||||
#custom rules for libucl.a
|
#custom rules for libucl.a
|
||||||
!mac {
|
!mac {
|
||||||
libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl.a
|
libucl.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/ucl/src libucl.a
|
||||||
}
|
}
|
||||||
mac {
|
mac {
|
||||||
libucl.commands = @$(MAKE) -C ../../tools/ucl/src libucl-universal
|
libucl.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/ucl/src libucl-universal
|
||||||
}
|
}
|
||||||
QMAKE_EXTRA_TARGETS += libucl
|
QMAKE_EXTRA_TARGETS += libucl
|
||||||
PRE_TARGETDEPS += libucl
|
PRE_TARGETDEPS += libucl
|
||||||
|
|
||||||
#custom rules for libmkamsboot.a
|
#custom rules for libmkamsboot.a
|
||||||
!mac {
|
!mac {
|
||||||
libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot.a
|
libmkamsboot.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot.a
|
||||||
}
|
}
|
||||||
mac {
|
mac {
|
||||||
libmkamsboot.commands = @$(MAKE) -C ../mkamsboot libmkamsboot-universal
|
libmkamsboot.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot-universal
|
||||||
}
|
}
|
||||||
QMAKE_EXTRA_TARGETS += libmkamsboot
|
QMAKE_EXTRA_TARGETS += libmkamsboot
|
||||||
PRE_TARGETDEPS += libmkamsboot
|
PRE_TARGETDEPS += libmkamsboot
|
||||||
|
@ -167,10 +175,10 @@ HEADERS += rbutilqt.h \
|
||||||
../../tools/iriver.h
|
../../tools/iriver.h
|
||||||
|
|
||||||
# Needed by QT on Win
|
# Needed by QT on Win
|
||||||
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools
|
INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools $$_PRO_FILE_PWD_/zip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base
|
||||||
INCLUDEPATH += base
|
INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
|
||||||
|
|
||||||
LIBS += -L../../tools/rbspeex -lrbspeex -L../mkamsboot -lmkamsboot -L../../tools/ucl/src/ -lucl
|
LIBS += -L$$OUT_PWD -lrbspeex -lmkamsboot -lucl
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
dbg {
|
dbg {
|
||||||
|
@ -201,12 +209,12 @@ FORMS += rbutilqtfrm.ui \
|
||||||
sysinfofrm.ui \
|
sysinfofrm.ui \
|
||||||
systracefrm.ui
|
systracefrm.ui
|
||||||
|
|
||||||
RESOURCES += rbutilqt.qrc
|
RESOURCES += $$_PRO_FILE_PWD_/rbutilqt.qrc
|
||||||
win32 {
|
win32 {
|
||||||
RESOURCES += rbutilqt-win.qrc
|
RESOURCES += $$_PRO_FILE_PWD_/rbutilqt-win.qrc
|
||||||
}
|
}
|
||||||
!dbg {
|
!dbg {
|
||||||
RESOURCES += rbutilqt-lang.qrc
|
RESOURCES += $$_PRO_FILE_PWD_/rbutilqt-lang.qrc
|
||||||
}
|
}
|
||||||
|
|
||||||
TRANSLATIONS += lang/rbutil_de.ts \
|
TRANSLATIONS += lang/rbutil_de.ts \
|
||||||
|
|
|
@ -35,7 +35,7 @@ endif
|
||||||
# This sets up 'SRC' based on the files mentioned in SOURCES
|
# This sets up 'SRC' based on the files mentioned in SOURCES
|
||||||
SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
|
SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
|
||||||
|
|
||||||
OUT = build$(RBARCH)
|
OUT = $(TARGET_DIR)build$(RBARCH)
|
||||||
SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
|
SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
|
||||||
OBJS = $(addprefix $(OUT)/,$(SRC:%.c=%.o))
|
OBJS = $(addprefix $(OUT)/,$(SRC:%.c=%.o))
|
||||||
DEPFILE = $(OUT)/dep-speex
|
DEPFILE = $(OUT)/dep-speex
|
||||||
|
@ -46,8 +46,8 @@ DIRS =
|
||||||
all: ../rbspeexenc ../rbspeexdec
|
all: ../rbspeexenc ../rbspeexdec
|
||||||
|
|
||||||
$(DEPFILE): $(SOURCES)
|
$(DEPFILE): $(SOURCES)
|
||||||
@echo MKDIR build$(RBARCH)
|
@echo MKDIR $(OUT)
|
||||||
$(SILENT)mkdir -p build$(RBARCH)
|
$(SILENT)mkdir -p $(OUT)
|
||||||
@echo Creating dependencies
|
@echo Creating dependencies
|
||||||
$(SILENT)rm -f $(DEPFILE)
|
$(SILENT)rm -f $(DEPFILE)
|
||||||
$(SILENT)(for each in $(SOURCES) x; do \
|
$(SILENT)(for each in $(SOURCES) x; do \
|
||||||
|
@ -69,7 +69,7 @@ $(OUT)/librbspeex.a: $(OBJS) $(DEPFILE) $(OUT)/rbspeex.o
|
||||||
$(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1
|
$(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1
|
||||||
|
|
||||||
librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
|
librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
|
||||||
$(SILENT)cp $(OUT)/librbspeex.a librbspeex$(RBARCH).a
|
$(SILENT)cp $(OUT)/librbspeex.a $(TARGET_DIR)librbspeex$(RBARCH).a
|
||||||
|
|
||||||
../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
|
../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
|
||||||
@echo Linking ../rbspeexenc
|
@echo Linking ../rbspeexenc
|
||||||
|
@ -86,22 +86,22 @@ librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
|
||||||
# some trickery to build ppc and i386 from a single call
|
# some trickery to build ppc and i386 from a single call
|
||||||
ifeq ($(RBARCH),)
|
ifeq ($(RBARCH),)
|
||||||
librbspeexi386.a:
|
librbspeexi386.a:
|
||||||
make RBARCH=i386 librbspeexi386.a
|
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) librbspeexi386.a
|
||||||
|
|
||||||
librbspeexppc.a:
|
librbspeexppc.a:
|
||||||
make RBARCH=ppc librbspeexppc.a
|
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) librbspeexppc.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
librbspeex-universal: librbspeexi386.a librbspeexppc.a
|
librbspeex-universal: librbspeexi386.a librbspeexppc.a
|
||||||
@echo lipo librbspeex.a
|
@echo lipo librbspeex.a
|
||||||
$(SILENT) rm -f librbspeex.a
|
$(SILENT) rm -f $(TARGET_DIR)librbspeex.a
|
||||||
lipo -create librbspeexppc.a librbspeexi386.a -output librbspeex.a
|
lipo -create $(TARGET_DIR)librbspeexppc.a $(TARGET_DIR)librbspeexi386.a -output $(TARGET_DIR)librbspeex.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJS) librbspeex* ../rbspeexenc ../rbspeexdec dep-speex
|
rm -f $(OBJS) $(TARGET_DIR)librbspeex* ../rbspeexenc ../rbspeexdec $(TARGET_DIR)dep-speex
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
|
|
||||||
build$(RBARCH):
|
$(OUT):
|
||||||
@echo MKDIR build$(RBARCH)
|
@echo MKDIR $(OUT)
|
||||||
$(SILENT)mkdir build$(RBARCH)
|
$(SILENT)mkdir $(OUT)
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ ifdef RBARCH
|
||||||
CFLAGS += -arch $(RBARCH)
|
CFLAGS += -arch $(RBARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OUT = build$(RBARCH)
|
|
||||||
|
OUT = $(TARGET_DIR)build$(RBARCH)
|
||||||
|
|
||||||
SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \
|
SOURCES = alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \
|
||||||
n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \
|
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
|
||||||
# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools
|
# we don't use $(AR) and $(RANLIB) below since we want the _native_ tools
|
||||||
# not the cross-compiler tools
|
# not the cross-compiler tools
|
||||||
libucl$(RBARCH).a: $(OUT) $(OBJS)
|
libucl$(RBARCH).a: $(OUT) $(OBJS)
|
||||||
$(SILENT)ar ruv $@ $(OBJS) >/dev/null 2>&1
|
$(SILENT)ar ruv $(TARGET_DIR)$@ $(OBJS) >/dev/null 2>&1
|
||||||
$(SILENT)ranlib $@
|
$(SILENT)ranlib $(TARGET_DIR)$@
|
||||||
|
|
||||||
$(OUT)/%.o: %.c
|
$(OUT)/%.o: %.c
|
||||||
@echo CC $<
|
@echo CC $<
|
||||||
|
@ -40,22 +41,22 @@ $(OUT)/%.o: %.c
|
||||||
# some trickery to build ppc and i386 from a single call
|
# some trickery to build ppc and i386 from a single call
|
||||||
ifeq ($(RBARCH),)
|
ifeq ($(RBARCH),)
|
||||||
libucli386.a:
|
libucli386.a:
|
||||||
make RBARCH=i386 libucli386.a
|
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libucli386.a
|
||||||
|
|
||||||
libuclppc.a:
|
libuclppc.a:
|
||||||
make RBARCH=ppc libuclppc.a
|
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libucl-universal: libucli386.a libuclppc.a
|
libucl-universal: libucli386.a libuclppc.a
|
||||||
@echo lipo libucl.a
|
@echo lipo $(TARGET_DIR)libucl.a
|
||||||
$(SILENT) rm -f libucl.a
|
$(SILENT) rm -f $(TARGET_DIR)libucl.a
|
||||||
lipo -create libuclppc.a libucli386.a -output libucl.a
|
lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f libucl*.a
|
rm -f $(TARGET_DIR)libucl*.a
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
|
|
||||||
build$(RBARCH):
|
$(OUT):
|
||||||
@echo MKDIR build$(RBARCH)
|
@echo MKDIR $(OUT)
|
||||||
$(SILENT)mkdir build$(RBARCH)
|
$(SILENT)mkdir $(OUT)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue