summaryrefslogtreecommitdiffstats
path: root/rules/initramfs-kernel-modules.make
blob: ed188614f1ccad68b0fcdd3cacb751c93568d796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# -*-makefile-*-
#
# Copyright (C) 2009 by Marc Kleine-Budde <mkl@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_INITRAMFS_KERNEL_MODULES) += initramfs-kernel-modules

#
# Paths and names
#
INITRAMFS_KERNEL_MODULES_VERSION	:= 1.0.0
INITRAMFS_KERNEL_MODULES		:= initramfs-kernel-modules-$(INITRAMFS_KERNEL_MODULES_VERSION)
INITRAMFS_KERNEL_MODULES_DIR		:= $(KLIBC_BUILDDIR)/$(INITRAMFS_KERNEL_MODULES)

ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS
$(STATEDIR)/klibc.targetinstall.post: $(STATEDIR)/initramfs-kernel-modules.targetinstall
endif

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-kernel-modules.extract:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

INITRAMFS_KERNEL_MODULES_PATH	:= PATH=$(CROSS_PATH)
INITRAMFS_KERNEL_MODULES_ENV 	:= $(CROSS_ENV)

$(STATEDIR)/initramfs-kernel-modules.prepare:
	@$(call targetinfo)
	@$(call touch)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-kernel-modules.compile: $(STATEDIR)/kernel.prepare
	@$(call targetinfo)
	cd $(KERNEL_DIR) && $(KERNEL_PATH) $(MAKE) \
		$(KERNEL_MAKEVARS) $(PTXCONF_KERNEL_MODULES_BUILD)
	@$(call touch)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-kernel-modules.install:
	@$(call targetinfo)
	@$(call clean, $(INITRAMFS_KERNEL_MODULES_PKGDIR))
	@cd $(KERNEL_DIR) && $(KERNEL_PATH) $(MAKE) \
		$(filter-out INSTALL_MOD_PATH=%,$(KERNEL_MAKEVARS)) \
		INSTALL_MOD_PATH=$(INITRAMFS_KERNEL_MODULES_PKGDIR) \
		modules_install

	@$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/initramfs-kernel-modules.targetinstall:
	@$(call targetinfo)
	@cd $(INITRAMFS_KERNEL_MODULES_PKGDIR) && \
	find lib -type d | while read dir; do \
		$(call install_initramfs, initramfs-kernel-modules, 0, 0, 0755, /$${dir}); \
	done

ifdef PTXCONF_INITRAMFS_KERNEL_MODULES_ALL
	@cd $(INITRAMFS_KERNEL_MODULES_PKGDIR) && \
	find lib -type f | while read file; do \
		$(call install_initramfs, initramfs-kernel-modules, 0, 0, 0644, -, /$${file}); \
	done
endif

ifdef PTXCONF_INITRAMFS_KERNEL_MODULES_USER_SPEC
	cat $(PTXDIST_WORKSPACE)/initramfs_modules | while read file; do \
		$(call install_initramfs, initramfs-kernel-modules, 0, 0, 0644, -, /$${file}); \
	done
endif
	@$(call touch)

# vim: syntax=make