summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-02-20 09:56:39 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2014-02-20 09:56:39 +0100
commit7d3fa6ece82fd4f834a928fa764f8db5f8b34d7f (patch)
tree07f69997bdecf9dfb34ed4c6d83c8a47441bf266 /mk
parent63595c8c3f19a85d105a41da337aa2ca968f4098 (diff)
parent84af1b9633858c9ef5798c8c8793023044cd9fad (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'mk')
-rw-r--r--mk/build.mk27
-rw-r--r--mk/vars.mk10
2 files changed, 23 insertions, 14 deletions
diff --git a/mk/build.mk b/mk/build.mk
index f4ae561e3..1f94fb184 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -120,6 +120,9 @@ POSTCONFIG= -@\
if [ "$$(grep ^ADK_KERNEL_VERSION_ .config|md5sum)" != "$$(grep ^ADK_KERNEL_VERSION_ .config.old|md5sum)" ];then \
make kernelclean;\
fi; \
+ if [ "$$(grep ^ADK_LINUX_ARM_WITH_THUMB .config|md5sum)" != "$$(grep ^ADK_LINUX_ARM_WITH_THUMB .config.old|md5sum)" ];then \
+ echo "You should make cleantarget, after changing thumb mode";\
+ fi; \
if [ $$rebuild -eq 1 ];then \
cp .config .config.old;\
fi; \
@@ -527,7 +530,7 @@ endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
bulktoolchain:
for libc in glibc eglibc uclibc musl;do \
while read arch; do \
- mkdir -p $(TOPDIR)/bin/toolchain_$${arch}_$$libc; \
+ mkdir -p $(TOPDIR)/firmware/toolchain_$${arch}_$$libc; \
( \
echo === building $$arch $$libc toolchain-$$arch on $$(date); \
tarch=$$(echo $$arch|sed -e "s#el##" -e "s#eb##" -e "s#mips64.*#mips#"); \
@@ -535,7 +538,7 @@ bulktoolchain:
$(GMAKE) ARCH=$$tarch SYSTEM=toolchain-$$arch LIBC=$$libc defconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit;fi; \
rm .config; \
- ) 2>&1 | tee $(TOPDIR)/bin/toolchain_$${arch}_$${libc}/build.log; \
+ ) 2>&1 | tee $(TOPDIR)/firmware/toolchain_$${arch}_$${libc}/build.log; \
if [ -f .exit ];then break;fi \
done <${TOPDIR}/target/tarch.lst ;\
if [ -f .exit ];then echo "Bulk build failed!"; rm .exit; exit 1;fi \
@@ -543,14 +546,14 @@ bulktoolchain:
release:
for libc in uclibc eglibc glibc musl;do \
- mkdir -p $(TOPDIR)/bin/$(SYSTEM)_$(ARCH)_$$libc; \
+ mkdir -p $(TOPDIR)/firmware/$(SYSTEM)_$(ARCH)_$$libc; \
( \
echo === building $$libc on $$(date); \
$(GMAKE) prereq && \
$(GMAKE) ARCH=$(ARCH) SYSTEM=$(SYSTEM) LIBC=$$libc FS=archive allmodconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit; exit 1;fi; \
rm .config; \
- ) 2>&1 | tee $(TOPDIR)/bin/$(SYSTEM)_$(ARCH)_$$libc/build.log; \
+ ) 2>&1 | tee $(TOPDIR)/firmware/$(SYSTEM)_$(ARCH)_$$libc/build.log; \
if [ -f .exit ];then echo "Bulk build failed!"; break;fi \
done
if [ -f .exit ];then rm .exit;exit 1;fi
@@ -561,14 +564,14 @@ bulk:
while read arch; do \
systems=$$(./scripts/getsystems $$arch|grep -v toolchain); \
for system in $$systems;do \
- mkdir -p $(TOPDIR)/bin/$${system}_$${arch}_$$libc; \
+ mkdir -p $(TOPDIR)/firmware/$${system}_$${arch}_$$libc; \
( \
echo === building $$arch $$system $$libc on $$(date); \
$(GMAKE) prereq && \
$(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive defconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit; exit 1;fi; \
rm .config; \
- ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
+ ) 2>&1 | tee $(TOPDIR)/firmware/$${system}_$${arch}_$$libc/build.log; \
if [ -f .exit ]; then break;fi \
done; \
if [ -f .exit ]; then break;fi \
@@ -581,14 +584,14 @@ bulkall:
while read arch; do \
systems=$$(./scripts/getsystems $$arch| grep -v toolchain); \
for system in $$systems;do \
- mkdir -p $(TOPDIR)/bin/$${system}_$${arch}_$$libc; \
+ mkdir -p $(TOPDIR)/firmware/$${system}_$${arch}_$$libc; \
( \
echo === building $$arch $$system $$libc on $$(date); \
$(GMAKE) prereq && \
$(GMAKE) ARCH=$$arch SYSTEM=$$system LIBC=$$libc FS=archive allconfig; \
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then touch .exit; exit 1;fi; \
rm .config; \
- ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
+ ) 2>&1 | tee $(TOPDIR)/firmware/$${system}_$${arch}_$$libc/build.log; \
if [ -f .exit ]; then break;fi \
done; \
if [ -f .exit ]; then break;fi \
@@ -601,7 +604,7 @@ bulkallmod:
while read arch; do \
systems=$$(./scripts/getsystems $$arch| grep -v toolchain); \
for system in $$systems;do \
- mkdir -p $(TOPDIR)/bin/$${system}_$${arch}_$$libc; \
+ mkdir -p $(TOPDIR)/firmware/$${system}_$${arch}_$$libc; \
( \
echo === building $$arch $$system $$libc on $$(date); \
$(GMAKE) prereq && \
@@ -609,7 +612,7 @@ bulkallmod:
$(GMAKE) VERBOSE=1 all; if [ $$? -ne 0 ]; then echo $$system-$$libc >.exit; exit 1;fi; \
$(GMAKE) cleantarget; \
rm .config; \
- ) 2>&1 | tee $(TOPDIR)/bin/$${system}_$${arch}_$$libc/build.log; \
+ ) 2>&1 | tee $(TOPDIR)/firmware/$${system}_$${arch}_$$libc/build.log; \
if [ -f .exit ]; then break;fi \
done; \
if [ -f .exit ]; then break;fi \
@@ -618,7 +621,7 @@ bulkallmod:
done
${TOPDIR}/bin/pkgmaker: $(TOPDIR)/tools/adk/pkgmaker.c $(TOPDIR)/tools/adk/sortfile.c $(TOPDIR)/tools/adk/strmap.c
- mkdir -p ${TOPDIR}/bin
+ @mkdir -p ${TOPDIR}/bin
@$(CC_FOR_BUILD) -g -o $@ tools/adk/pkgmaker.c tools/adk/sortfile.c tools/adk/strmap.c
${TOPDIR}/bin/pkgrebuild: $(TOPDIR)/tools/adk/pkgrebuild.c $(TOPDIR)/tools/adk/strmap.c
@@ -632,7 +635,7 @@ package/Config.in.auto menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile) ${TO
${TOPDIR}/bin/depmaker: $(TOPDIR)/tools/adk/depmaker.c
$(CC_FOR_BUILD) -g -o $(TOPDIR)/bin/depmaker $(TOPDIR)/tools/adk/depmaker.c
-dep: $(BIN_DIR)/depmaker
+dep: $(TOPDIR)/bin/depmaker
@echo "Generating dependencies ..."
@$(TOPDIR)/bin/depmaker > ${TOPDIR}/package/Depends.mk
diff --git a/mk/vars.mk b/mk/vars.mk
index 540d0e03b..4b0c4dbb9 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -87,15 +87,21 @@ TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident $(ADK_TARGET_ABI_CFLAG
TARGET_CFLAGS_LIBC:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident $(TARGET_OPTIMIZATION)
else
TARGET_CFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts $(ADK_TARGET_ABI_CFLAGS) $(MODE_FLAGS)
-TARGET_CFLAGS_LIBC:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts $(TARGET_OPTIMIZATION)
+TARGET_CFLAGS_LIBC:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident -fhonour-copts $(TARGET_OPTIMIZATION) $(MODE_FLAGS)
endif
TARGET_CXXFLAGS:= $(TARGET_CFLAGS_ARCH) -fwrapv -fno-ident $(MODE_FLAGS)
TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \
-Wl,-O1 -Wl,-rpath -Wl,/usr/lib \
-Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib \
- $(ADK_TARGET_ABI_LDFLAGS) $(TARGET_CFLAGS_ARCH)
+ $(ADK_TARGET_ABI_LDFLAGS)
# security optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
TARGET_LDFLAGS+= -Wl,-z,relro,-z,now
+# needed for musl ppc
+ifeq ($(ADK_LINUX_PPC),y)
+ifeq ($(ADK_TARGET_LIB_MUSL),y)
+TARGET_LDFLAGS+= -Wl,--secure-plt
+endif
+endif
ifneq ($(ADK_NATIVE),)
TARGET_CPPFLAGS:=