summaryrefslogtreecommitdiffstats
path: root/rules/host-modutils.make
blob: 056d5f755b9cc5899dd91fc2b9f997e9051d3bf2 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# -*-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		= $(MODUTILS)
HOST_MODUTILS_DIR	= $(HOST_BUILDDIR)/$(HOST_MODUTILS)


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

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

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

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

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

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

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

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

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_default)
	@$(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

$(STATEDIR)/host-modutils.compile: $(host-modutils_compile_deps_default)
	@$(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

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

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

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

# vim: syntax=make