summaryrefslogtreecommitdiffstats
path: root/rules/sysutils.make
blob: 10196bf9e5e53e6d1cb29484eb98c89656b43148 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2004 by Robert Schwebel
#          
# 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
#
PACKAGES-$(PTXCONF_SYSUTILS) += sysutils

#
# Paths and names
#
SYSUTILS_VERSION	= 0.1.0
SYSUTILS		= sysutils-$(SYSUTILS_VERSION)
SYSUTILS_SUFFIX		= tar.gz
SYSUTILS_URL		= http://www.de.kernel.org/pub/linux/utils/kernel/hotplug/$(SYSUTILS).$(SYSUTILS_SUFFIX)
SYSUTILS_SOURCE		= $(SRCDIR)/$(SYSUTILS).$(SYSUTILS_SUFFIX)
SYSUTILS_DIR		= $(BUILDDIR)/$(SYSUTILS)

-include $(call package_depfile)

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

sysutils_get: $(STATEDIR)/sysutils.get

$(STATEDIR)/sysutils.get: $(sysutils_get_deps_default)
	@$(call targetinfo, $@)
	@$(call get_patches, $(SYSUTILS))
	@$(call touch, $@)

$(SYSUTILS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(SYSUTILS_URL))

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

sysutils_extract: $(STATEDIR)/sysutils.extract

$(STATEDIR)/sysutils.extract: $(sysutils_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(SYSUTILS_DIR))
	@$(call extract, $(SYSUTILS_SOURCE))
	@$(call patchin, $(SYSUTILS))
	@$(call touch, $@)

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

sysutils_prepare: $(STATEDIR)/sysutils.prepare

SYSUTILS_PATH	=  PATH=$(CROSS_PATH)
SYSUTILS_ENV 	=  $(CROSS_ENV)

$(STATEDIR)/sysutils.prepare: $(sysutils_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

sysutils_compile: $(STATEDIR)/sysutils.compile

$(STATEDIR)/sysutils.compile: $(sysutils_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(SYSUTILS_DIR) && $(SYSUTILS_ENV) $(SYSUTILS_PATH) make
	@$(call touch, $@)

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

sysutils_install: $(STATEDIR)/sysutils.install

$(STATEDIR)/sysutils.install: $(sysutils_install_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

sysutils_targetinstall: $(STATEDIR)/sysutils.targetinstall

$(STATEDIR)/sysutils.targetinstall: $(sysutils_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,sysutils)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(SYSUTILS_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

ifdef PTXCONF_SYSUTILS_LSBUS
	@$(call install_copy, 0, 0, 0755, $(SYSUTILS_DIR)/cmd/lsbus, /usr/sbin/lsbus)
endif
ifdef PTXCONF_SYSUTILS_SYSTOOL
	@$(call install_copy, 0, 0, 0755, $(SYSUTILS_DIR)/cmd/systool, /usr/sbin/systool)
endif
	@$(call install_finish)

	@$(call touch, $@)

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

sysutils_clean:
	rm -rf $(STATEDIR)/sysutils.*
	rm -rf $(SYSUTILS_DIR)

# vim: syntax=make