aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/musl/Makefile
diff options
context:
space:
mode:
authorJames <>2015-11-04 11:49:21 +0000
committerJames <>2015-11-04 11:49:21 +0000
commit716ca530e1c4515d8683c9d5be3d56b301758b66 (patch)
tree700eb5bcc1a462a5f21dcec15ce7c97ecfefa772 /toolchain/musl/Makefile
downloadtrunk-47381-master.tar.gz
trunk-47381-master.tar.bz2
trunk-47381-master.zip
trunk-47381HEADmaster
Diffstat (limited to 'toolchain/musl/Makefile')
-rw-r--r--toolchain/musl/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile
new file mode 100644
index 0000000..1533f51
--- /dev/null
+++ b/toolchain/musl/Makefile
@@ -0,0 +1,31 @@
+PATH_PREFIX=.
+
+include ./common.mk
+
+HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
+HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.musl_installed
+
+HOST_BUILD_PARALLEL:=1
+
+MUSL_MAKEOPTS = -C $(HOST_BUILD_DIR) \
+ DESTDIR="$(TOOLCHAIN_DIR)/" \
+ LIBCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))"
+
+define Host/SetToolchainInfo
+ $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.musl-libc.org/,' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk
+endef
+
+define Host/Compile
+ +$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) all
+endef
+
+define Host/Install
+ $(call Host/SetToolchainInfo)
+ $(MAKE) $(MUSL_MAKEOPTS) DESTDIR="$(TOOLCHAIN_DIR)/" install
+ $(CP) ./include $(TOOLCHAIN_DIR)/
+endef
+
+$(eval $(call HostBuild))