summaryrefslogtreecommitdiffstats
path: root/rules/host-module-init-tools.make
blob: 6b9cb4cfb2894d5190c582f19265f75c73e2fa83 (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
# -*-makefile-*-
# $Id: kernel.make 2486 2005-04-19 12:18:08Z mkl $
#
# Copyright (C) 2005 Ladislav Michl <ladis@linux-mips.org>
#          
# 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
#
ifdef PTXCONF_HOSTTOOL_MODULE_INIT_TOOLS
HOST_PACKAGES += hosttool-module-init-tools
endif

#
# Paths and names
#
HOSTTOOL_MODULE_INIT_TOOLS_DIR		= $(HOST_BUILDDIR)/$(MODULE_INIT_TOOLS)

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

hosttool-module-init-tools_get: $(STATEDIR)/hosttool-module-init-tools.get

hosttool-module-init-tools_get_deps = $(STATEDIR)/module-init-tools.get

$(STATEDIR)/hosttool-module-init-tools.get: $(hosttool-module-init-tools_get_deps)
	@$(call targetinfo, $@)
	$(call touch, $@)

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

hosttool-module-init-tools_extract: $(STATEDIR)/hosttool-module-init-tools.extract

hosttool-module-init-tools_extract_deps = $(STATEDIR)/hosttool-module-init-tools.get

$(STATEDIR)/hosttool-module-init-tools.extract: $(hosttool-module-init-tools_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(HOSTTOOL_MODULE_INIT_TOOLS_DIR))
	@$(call extract, $(MODULE_INIT_TOOLS_SOURCE), $(HOST_BUILDDIR))
	@$(call patchin, $(MODULE_INIT_TOOLS), $(HOSTTOOL_MODULE_INIT_TOOLS_DIR))
	$(call touch, $@)

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

hosttool-module-init-tools_prepare: $(STATEDIR)/hosttool-module-init-tools.prepare
#
# dependencies
#
hosttool-module-init-tools_prepare_deps = $(STATEDIR)/hosttool-module-init-tools.extract

HOSTTOOL_MODULE_INIT_TOOLS_PATH	= PATH=$(CROSS_PATH) 
HOSTTOOL_MODULE_INIT_TOOLS_ENV 	= $(HOSTCC_ENV)
HOSTTOOL_MODULE_INIT_TOOLS_MAKEVARS	= MAN5=''
HOSTTOOL_MODULE_INIT_TOOLS_AUTOCONF 	= \
	--prefix=$(PTXCONF_PREFIX) \
	--build=$(GNU_HOST) \
	--host=$(GNU_HOST) \
	--target=$(PTXCONF_GNU_TARGET)

$(STATEDIR)/hosttool-module-init-tools.prepare: $(hosttool-module-init-tools_prepare_deps)
	@$(call targetinfo, $@)
	cd $(HOSTTOOL_MODULE_INIT_TOOLS_DIR) && \
		$(HOSTTOOL_MODULE_INIT_TOOLS_PATH) $(HOSTTOOL_MODULE_INIT_TOOLS_ENV) \
		./configure $(HOSTTOOL_MODULE_INIT_TOOLS_AUTOCONF)
	$(call touch, $@)

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

hosttool-module-init-tools_compile: $(STATEDIR)/hosttool-module-init-tools.compile

hosttool-module-init-tools_compile_deps = $(STATEDIR)/hosttool-module-init-tools.prepare

$(STATEDIR)/hosttool-module-init-tools.compile: $(hosttool-module-init-tools_compile_deps)
	@$(call targetinfo, $@)
	cd $(HOSTTOOL_MODULE_INIT_TOOLS_DIR) && \
		$(HOSTTOOL_MODULE_INIT_TOOLS_PATH) make \
			$(HOSTTOOL_MODULE_INIT_TOOLS_MAKEVARS)
	$(call touch, $@)

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

hosttool-module-init-tools_install: $(STATEDIR)/hosttool-module-init-tools.install

hosttool-module-init-tools_install_deps = $(STATEDIR)/hosttool-module-init-tools.compile
ifdef PTXCONF_KERNEL_2_4
hosttool-module-init-tools_install_deps += $(STATEDIR)/hosttool-modutils.install
endif

$(STATEDIR)/hosttool-module-init-tools.install: $(hosttool-module-init-tools_install_deps)
	@$(call targetinfo, $@)
	cd $(HOSTTOOL_MODULE_INIT_TOOLS_DIR) && \
		$(HOSTTOOL_MODULE_INIT_TOOLS_PATH) make install \
			$(HOSTTOOL_MODULE_INIT_TOOLS_MAKEVARS)
	$(call touch, $@)

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

hosttool-module-init-tools_targetinstall: $(STATEDIR)/hosttool-module-init-tools.targetinstall

hosttool-module-init-tools_targetinstall_deps = $(STATEDIR)/hosttool-module-init-tools.install

$(STATEDIR)/hosttool-module-init-tools.targetinstall: $(hosttool-module-init-tools_targetinstall_deps)
	@$(call targetinfo, $@)
	$(call touch, $@)

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

hosttool-module-init-tools_clean:
	rm -rf $(STATEDIR)/hosttool-module-init-tools.*
	rm -rf $(HOSTTOOL_MODULE_INIT_TOOLS_DIR)

# vim: syntax=make