summaryrefslogtreecommitdiff
path: root/toolchain/uClibc/Makefile
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /toolchain/uClibc/Makefile
Initial import
Diffstat (limited to 'toolchain/uClibc/Makefile')
-rw-r--r--toolchain/uClibc/Makefile72
1 files changed, 72 insertions, 0 deletions
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile
new file mode 100644
index 000000000..8bf81f309
--- /dev/null
+++ b/toolchain/uClibc/Makefile
@@ -0,0 +1,72 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+_IN_CVTC= 1
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+ $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
+ sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${TOOLCHAIN_SYSROOT}/usr/include\"' \
+ $(TOPDIR)/target/$(DEVICE)/uclibc.config >${WRKBUILD}/.config
+ifeq ($(ADK_IPV6),y)
+ $(SED) 's,# UCLIBC_HAS_IPV6.*,UCLIBC_HAS_IPV6=y,' \
+ ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_SSP),y)
+ $(SED) 's,# UCLIBC_HAS_SSP.*,UCLIBC_HAS_SSP=y,' \
+ ${WRKBUILD}/.config
+ echo 'UCLIBC_BUILD_SSP=y' >> ${WRKBUILD}/.config
+ echo '# UCLIBC_HAS_SSP_COMPAT is not set' >> ${WRKBUILD}/.config
+ echo '# SSP_QUICK_CANARY is not set' >> ${WRKBUILD}/.config
+ echo 'PROPOLICE_BLOCK_ABRT=y' >> ${WRKBUILD}/.config
+ echo '# PROPOLICE_BLOCK_SEGV is not set' >> ${WRKBUILD}/.config
+endif
+ifeq ($(DEBUG),1)
+ $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
+endif
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(TOOLCHAIN_SYSROOT)/ \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(TOOLCHAIN_SYSROOT)/ \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ install_headers
+ touch $(WRKBUILD)/.configure_done
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX= \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ all
+ touch $@
+
+$(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_DIR) \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ install_dev
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_DIR) \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ install_runtime
+ echo $(PKG_VERSION) >$(STAGING_DIR)/uclibc_version
+ rm -rf $(STAGING_DIR)/lib/libc.so
+ ln -s libc.so.0 $(STAGING_DIR)/lib/libc.so
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk