summaryrefslogtreecommitdiffstats
path: root/configs/platform-mips/rules/kernel-ar9331.make
blob: 98452a90a0a4746f298d8b065f86cf645f2962a8 (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_AR9331) += kernel-ar9331

#
# Paths and names
#
KERNEL_AR9331_VERSION	:= $(KERNEL_VERSION)
KERNEL_AR9331_MD5	:= $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
KERNEL_AR9331		:= linux-ar9331-$(KERNEL_AR9331_VERSION)
KERNEL_AR9331_SUFFIX	:= tar.xz
KERNEL_AR9331_URL	:= $(call kernel-url, KERNEL_AR9331)
KERNEL_AR9331_PATCHES	:= linux-$(KERNEL_AR9331_VERSION)
KERNEL_AR9331_SOURCE	:= $(SRCDIR)/$(KERNEL_AR9331_PATCHES).$(KERNEL_AR9331_SUFFIX)
KERNEL_AR9331_DIR	:= $(BUILDDIR)/$(KERNEL_AR9331)
KERNEL_AR9331_BUILD_DIR	:= $(KERNEL_AR9331_DIR)-build
KERNEL_AR9331_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig-ar9331)
KERNEL_AR9331_REF_CONFIG	:= $(call ptx/in-platformconfigdir, kernelconfig)
KERNEL_AR9331_LICENSE	:= GPL-2.0-only
KERNEL_AR9331_BUILD_OOT	:= KEEP

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

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

KERNEL_AR9331_CONF_OPT	:= \
	-C $(KERNEL_AR9331_DIR) \
	O=$(KERNEL_AR9331_BUILD_DIR) \
	$(call kernel-opts, KERNEL_AR9331)

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

KERNEL_AR9331_IMAGES := vmlinuz
KERNEL_AR9331_IMAGES := $(addprefix $(KERNEL_AR9331_BUILD_DIR)/,$(KERNEL_AR9331_IMAGES))

ifdef PTXCONF_KERNEL_AR9331
$(KERNEL_AR9331_CONFIG):
	@echo
	@echo "*************************************************************************"
	@echo " Please generate a kernelconfig with 'ptxdist menuconfig kernel-ar9331'"
	@echo "*************************************************************************"
	@echo
	@echo
	@exit 1
endif

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

KERNEL_AR9331_MAKE_OPT := \
	$(KERNEL_AR9331_CONF_OPT) \
	vmlinuz modules

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

KERNEL_AR9331_INSTALL_OPT := \
	$(call kernel-opts, KERNEL_AR9331) \
	modules_install

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

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

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

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

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

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

	@$(call install_finish, kernel-ar9331)

	@$(call touch)

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

kernel-ar9331_oldconfig kernel-ar9331_menuconfig kernel-ar9331_nconfig: $(STATEDIR)/kernel-ar9331.extract
	@$(call world/kconfig, KERNEL_AR9331, $(subst kernel-ar9331_,,$@))

# vim: syntax=make