summaryrefslogtreecommitdiffstats
path: root/rules/host-modutils.make
blob: 906fb23482f4b32ff2d42c5a4560678669badfc7 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Marc Kleine-Budde <kleine-budde@gmx.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
#
HOST_PACKAGES-$(PTXCONF_HOST_MODUTILS) += host-modutils

#
# Paths and names
#
HOST_MODUTILS_VERSION	= 2.4.27
HOST_MODUTILS		= modutils-$(HOST_MODUTILS_VERSION)
HOST_MODUTILS_SUFFIX	= tar.bz2
HOST_MODUTILS_URL		= http://www.kernel.org/pub/linux/utils/kernel/modutils/v2.4/$(HOST_MODUTILS).$(HOST_MODUTILS_SUFFIX)
HOST_MODUTILS_SOURCE	= $(SRCDIR)/$(HOST_MODUTILS).$(HOST_MODUTILS_SUFFIX)
HOST_MODUTILS_DIR		= $(HOST_BUILDDIR)/$(HOST_MODUTILS)

-include $(call package_depfile)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

host-modutils_get: $(STATEDIR)/host-modutils.get

host-modutils_get_deps = $(HOST_MODUTILS_SOURCE)

$(STATEDIR)/host-modutils.get: $(host-modutils_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(HOST_MODUTILS))
	@$(call touch, $@)

$(HOST_MODUTILS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(HOST_MODUTILS_URL))

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

host-modutils_extract: $(STATEDIR)/host-modutils.extract

host-modutils_extract_deps = $(STATEDIR)/host-modutils.get

$(STATEDIR)/host-modutils.extract: $(host-modutils_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(HOST_MODUTILS_DIR))
	@$(call extract, $(HOST_MODUTILS_SOURCE), $(HOST_BUILDDIR))
	@$(call patchin, $(HOST_MODUTILS), $(HOST_MODUTILS_DIR))
	@$(call touch, $@)

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

host-modutils_prepare: $(STATEDIR)/host-modutils.prepare

#
# dependencies
#
host-modutils_prepare_deps =  \
	$(STATEDIR)/host-flex254.install \
	$(STATEDIR)/host-modutils.extract

HOST_MODUTILS_PATH	=  PATH=$(CROSS_PATH)
HOST_MODUTILS_ENV 	=  CC=$(HOSTCC)

#
# autoconf
#
HOST_MODUTILS_AUTOCONF = $(HOST_AUTOCONF)

$(STATEDIR)/host-modutils.prepare: $(host-modutils_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(HOST_MODUTILS_DIR)/config.cache)
	cd $(HOST_MODUTILS_DIR) && \
		$(HOST_MODUTILS_PATH) $(HOST_MODUTILS_ENV) \
		./configure $(HOST_MODUTILS_AUTOCONF)
	@$(call touch, $@)

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

host-modutils_compile: $(STATEDIR)/host-modutils.compile

host-modutils_compile_deps =  $(STATEDIR)/host-modutils.prepare

$(STATEDIR)/host-modutils.compile: $(host-modutils_compile_deps)
	@$(call targetinfo, $@)
	cd $(HOST_MODUTILS_DIR) && \
		$(HOST_MODUTILS_PATH) make -C $(HOST_MODUTILS_DIR)
	@$(call touch, $@)

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

host-modutils_install: $(STATEDIR)/host-modutils.install

$(STATEDIR)/host-modutils.install: $(STATEDIR)/host-modutils.compile
	@$(call targetinfo, $@)
#	FIXME
#	@$(call install, HOST_MODUTILS,,h)
	mkdir -p $(PTXCONF_PREFIX)/bin
	install -D -m755 $(HOST_MODUTILS_DIR)/insmod/insmod \
		$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-insmod.old
	install -D -m755 $(HOST_MODUTILS_DIR)/insmod/modinfo \
		$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-modinfo.old
	install -D -m755 $(HOST_MODUTILS_DIR)/insmod/insmod_ksymoops_clean \
		$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-insmod_ksymoops_clean.old
	install -D -m755 $(HOST_MODUTILS_DIR)/insmod/kernelversion \
		$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-kernelversion.old
	for FILE in ksyms kallsyms; do				\
		ln -sf $(PTXCONF_GNU_TARGET)-insmod.old \
			$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-$$FILE.old; \
	done;

	install -D -m755 $(HOST_MODUTILS_DIR)/genksyms/genksyms \
		$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-genksyms.old
	install -D -m755 $(HOST_MODUTILS_DIR)/depmod/depmod \
		$(PTXCONF_PREFIX)/sbin/$(PTXCONF_GNU_TARGET)-depmod.old
	@$(call touch, $@)

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

host-modutils_targetinstall: $(STATEDIR)/host-modutils.targetinstall

host-modutils_targetinstall_deps	=  $(STATEDIR)/host-modutils.compile

$(STATEDIR)/host-modutils.targetinstall: $(host-modutils_targetinstall_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

host-modutils_clean:
	rm -rf $(STATEDIR)/host-modutils.*
	rm -rf $(HOST_MODUTILS_DIR)

# vim: syntax=make