summaryrefslogtreecommitdiffstats
path: root/configs/platform-mips/rules/kernel-malta.make
blob: 0450e04ce690fe66efc6d8fce4ba495ae50847c2 (plain) (blame)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# -*-makefile-*-
#
# Copyright (C) 2020 by Oleksij Rempel <o.rempel@pengutronix.de>
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_KERNEL_MALTA) += kernel-malta

#
# Paths and names
#
KERNEL_MALTA_VERSION	:= $(KERNEL_VERSION)
KERNEL_MALTA_MD5	:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
KERNEL_MALTA		:= linux-malta-$(KERNEL_MALTA_VERSION)
KERNEL_MALTA_SUFFIX	:= tar.xz
KERNEL_MALTA_URL	:= $(call kernel-url, KERNEL_MALTA)
KERNEL_MALTA_PATCHES	:= linux-$(KERNEL_MALTA_VERSION)
KERNEL_MALTA_SOURCE	:= $(SRCDIR)/$(KERNEL_MALTA_PATCHES).$(KERNEL_MALTA_SUFFIX)
KERNEL_MALTA_DIR	:= $(BUILDDIR)/$(KERNEL_MALTA)
KERNEL_MALTA_BUILD_DIR	:= $(KERNEL_MALTA_DIR)-build
KERNEL_MALTA_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-malta)
KERNEL_MALTA_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
KERNEL_MALTA_LICENSE	:= GPL-2.0-only
KERNEL_MALTA_BUILD_OOT	:= KEEP

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

# use CONFIG_CC_STACKPROTECTOR if available. The rest makes no sense for the kernel
KERNEL_MALTA_WRAPPER_BLACKLIST := \
	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)

KERNEL_MALTA_CONF_OPT	:= \
	-C $(KERNEL_MALTA_DIR) \
	O=$(KERNEL_MALTA_BUILD_DIR) \
	$(call kernel-opts, KERNEL_MALTA)

# no gcc plugins; avoid config changes depending on the host compiler
KERNEL_MALTA_CONF_OPT += \
	HOSTCXX=false

KERNEL_MALTA_IMAGES := vmlinuz
KERNEL_MALTA_IMAGES := $(addprefix $(KERNEL_MALTA_BUILD_DIR)/,$(KERNEL_MALTA_IMAGES))

ifdef PTXCONF_KERNEL_MALTA
$(KERNEL_MALTA_CONFIG):
	@echo
	@echo "*************************************************************************"
	@echo " Please generate a kernelconfig with 'ptxdist menuconfig kernel-malta'"
	@echo "*************************************************************************"
	@echo
	@echo
	@exit 1
endif

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

KERNEL_MALTA_MAKE_OPT := \
	$(KERNEL_MALTA_CONF_OPT) \
	vmlinuz modules

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

KERNEL_MALTA_INSTALL_OPT := \
	$(call kernel-opts, KERNEL_MALTA) \
	modules_install

$(STATEDIR)/kernel-malta.install:
	@$(call targetinfo)
	@$(call world/install, KERNEL_MALTA)
	@$(foreach image, $(KERNEL_MALTA_IMAGES), \
		install -m 644 $(image) $(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
	@$(call touch)

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

$(STATEDIR)/kernel-malta.targetinstall:
	@$(call targetinfo)

	@$(call install_init,  kernel-malta)
	@$(call install_fixup, kernel-malta, PRIORITY,optional)
	@$(call install_fixup, kernel-malta, SECTION,base)
	@$(call install_fixup, kernel-malta, AUTHOR,"Oleksij Rempel <o.rempel@pengutronix.de>")
	@$(call install_fixup, kernel-malta, DESCRIPTION,missing)

	@$(call install_copy, kernel-malta, 0, 0, 0644, \
		$(IMAGEDIR)/vmlinuz-malta, /boot/vmlinuz-malta, n)

	@$(call install_glob, kernel-malta, 0, 0, -, /lib/modules, *.ko,, k)
	@$(call install_glob, kernel-malta, 0, 0, -, /lib/modules,, *.ko */build */source, n)

	@$(call install_finish, kernel-malta)

	@$(call touch)

# ----------------------------------------------------------------------------
# oldconfig / menuconfig
# ----------------------------------------------------------------------------

kernel-malta_oldconfig kernel-malta_menuconfig kernel-malta_nconfig: $(STATEDIR)/kernel-malta.extract
	@$(call world/kconfig, KERNEL_MALTA, $(subst kernel-malta_,,$@))

# vim: syntax=make