summaryrefslogtreecommitdiff
path: root/core/toolchain/linux/headers.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/toolchain/linux/headers.mk')
-rw-r--r--core/toolchain/linux/headers.mk52
1 files changed, 52 insertions, 0 deletions
diff --git a/core/toolchain/linux/headers.mk b/core/toolchain/linux/headers.mk
new file mode 100644
index 0000000..866d039
--- /dev/null
+++ b/core/toolchain/linux/headers.mk
@@ -0,0 +1,52 @@
+################################################################################
+# Embtoolkit
+# Copyright(C) 2009-2014 Abdoulaye Walsimou GAYE.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+################################################################################
+#
+# \file headers.mk
+# \brief linux headers installation
+# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
+# \date May 2009
+################################################################################
+
+LINUX_HEADERS_NAME := linux
+LINUX_HEADERS_VERSION := $(LINUX_VERSION)
+LINUX_HEADERS_SITE := $(LINUX_SITE)
+LINUX_HEADERS_PACKAGE := $(LINUX_PACKAGE)
+LINUX_HEADERS_SRC_DIR := $(LINUX_SRC_DIR)
+LINUX_HEADERS_BUILD_DIR := $(LINUX_BUILD_DIR)
+LINUX_HEADERS_KEEP_SRC_DIR := $(LINUX_KEEP_SRC_DIR)
+LINUX_HEADERS_KCONFIGS_NAME := LINUX
+
+#
+# linux headers install
+#
+ifeq ($(embtk_buildhost_os),macos)
+define embtk_beforeinstall_linux_headers
+ cp $(EMBTK_ROOT)/scripts/unifdef.c \
+ $(LINUX_HEADERS_SRC_DIR)/scripts/unifdef.c
+endef
+endif
+
+define embtk_install_linux_headers
+ $(MAKE) -C $(LINUX_HEADERS_BUILD_DIR) $(LINUX_MAKE_OPTS) \
+ INSTALL_HDR_PATH=$(embtk_sysroot)/usr headers_install
+endef
+
+define embtk_cleanup_linux_headers
+ [ -d $(LINUX_BUILD_DIR) ] && $(call __embtk_unsetinstalled_pkg,linux_headers) ||:
+endef