summaryrefslogtreecommitdiffstats
path: root/rules/host-util-linux.make
blob: 88d9e1d4e7da931cbef19d728312524432ff790e (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Robert Schwebel <r.schwebel@pengutronix.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.
#

#
# Paths and names
#

HOST_PACKAGES-$(PTXCONF_HOST_UTIL-LINUX) += host-util-linux

HOST_UTIL-LINUX_DIR	= $(HOST_BUILDDIR)/$(UTIL-LINUX)

-include $(call package_depfile)

# ----------------------------------------------------------------------------
# Hosttool Extract
# ----------------------------------------------------------------------------

host-util-linux_extract: $(STATEDIR)/host-util-linux.extract

host-util-linux_extract_deps =  $(STATEDIR)/util-linux.get

$(STATEDIR)/host-util-linux.extract: $(host-util-linux_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(UTIL-LINUX_DIR))
	@$(call extract, $(UTIL-LINUX_SOURCE), $(HOST_BUILDDIR))
	@$(call patchin, $(UTIL-LINUX),$(HOST_UTIL-LINUX_DIR))
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Hosttool Prepare
# ----------------------------------------------------------------------------

host-util-linux_prepare: $(STATEDIR)/host-util-linux.prepare

#
# dependencies
#
host-util-linux_prepare_deps = $(STATEDIR)/host-util-linux.extract

$(STATEDIR)/host-util-linux.prepare: $(host-util-linux_prepare_deps)
	@$(call targetinfo, $@)
	cd $(HOST_UTIL-LINUX_DIR) && \
		$(HOSTCC_ENV) ./configure
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Hosttool Compile
# ----------------------------------------------------------------------------

host-util-linux_compile: $(STATEDIR)/host-util-linux.compile

host-util-linux_compile_deps =  $(STATEDIR)/host-util-linux.prepare

$(STATEDIR)/host-util-linux.compile: $(host-util-linux_compile_deps)
	@$(call targetinfo, $@)

ifdef PTXCONF_UTLNX_SFDISK
	$(UTIL-LINUX_PATH) make -C $(HOST_UTIL-LINUX_DIR)/fdisk sfdisk
endif

ifdef PTXCONF_UTLNX_FDISK
	$(UTIL-LINUX_PATH) make -C $(HOST_UTIL-LINUX_DIR)/fdisk fdisk
endif

ifdef PTXCONF_UTLNX_CFFDISK
	$(UTIL-LINUX_PATH) make -C $(HOST_UTIL-LINUX_DIR)/fdisk cfdisk
endif

# ----------------------------------------------------------------------------
# Hosttool Install
# ----------------------------------------------------------------------------

host-util-linux_install: $(STATEDIR)/host-util-linux.install

$(STATEDIR)/host-util-linux.install: $(STATEDIR)/host-util-linux.compile
	@$(call targetinfo, $@)

	# FIXME: packetize

ifdef PTXCONF_UTLNX_SFDISK
	install -D $(HOST_UTIL-LINUX_DIR)/fdisk/sfdisk \
		$(PTXCONF_PREFIX)/sbin/sfdisk
endif

ifdef PTXCONF_UTLNX_FDISK
	install -D $(HOST_UTIL-LINUX_DIR)/fdisk/sfdisk \
		$(PTXCONF_PREFIX)/sbin/sfdisk
endif

ifdef PTXCONF_UTLNX_CFFDISK
	install -D $(HOST_UTIL-LINUX_DIR)/fdisk/sfdisk \
		$(PTXCONF_PREFIX)/sbin/sfdisk
endif

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Hosttool Clean
# ----------------------------------------------------------------------------

host-util-linux_clean:
	rm -rf $(STATEDIR)/host-util-linux.*
	rm -rf $(HOST_UTIL-LINUX_DIR)

# vim: syntax=make