summaryrefslogtreecommitdiffstats
path: root/rules/template-host
blob: 432afc7b56fd4c05b5fdd2165385685262f653d8 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) @YEAR@ by @AUTHOR@
#          
# 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_@PACKET@) += @packet@

#
# Paths and names
#
@PACKET@_VERSION	= @MAJOR@.@MINOR@.@MICRO@
@PACKET@		= @packet_name@-$(@PACKET@_VERSION)
@PACKET@_SUFFIX		= @SUFFIX@
@PACKET@_URL		= @URL@/$(@PACKET@).$(@PACKET@_SUFFIX)
@PACKET@_SOURCE		= $(SRCDIR)/$(@PACKET@).$(@PACKET@_SUFFIX)
@PACKET@_DIR		= $(HOST_BUILDDIR)/$(@PACKET@)

-include $(call package_depfile)

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

@packet@_get: $(STATEDIR)/@packet@.get

$(STATEDIR)/@packet@.get: $(@packet@_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(@PACKET@_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(@PACKET@_URL))

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

@packet@_extract: $(STATEDIR)/@packet@.extract

$(STATEDIR)/@packet@.extract: $(@packet@_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(@PACKET@_DIR))
	@$(call extract, $(@PACKET@_SOURCE), $(HOST_BUILDDIR))
	@$(call patchin, $(@PACKET@), $(@PACKET@_DIR))
	@$(call touch, $@)

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

@packet@_prepare: $(STATEDIR)/@packet@.prepare

@PACKET@_PATH	=  PATH=$(HOST_PATH)
@PACKET@_ENV 	=  $(HOSTCC_ENV)

#
# autoconf
#
@PACKET@_AUTOCONF =  $(HOST_AUTOCONF)

$(STATEDIR)/@packet@.prepare: $(@packet@_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(@PACKET@_DIR)/config.cache)
	cd $(@PACKET@_DIR) && \
		$(@PACKET@_PATH) $(@PACKET@_ENV) \
		./configure $(@PACKET@_AUTOCONF)
	@$(call touch, $@)

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

@packet@_compile: $(STATEDIR)/@packet@.compile

$(STATEDIR)/@packet@.compile: $(@packet@_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(@PACKET@_DIR) && $(@PACKET@_ENV) $(@PACKET@_PATH) make
	@$(call touch, $@)

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

@packet@_install: $(STATEDIR)/@packet@.install

$(STATEDIR)/@packet@.install: $(@packet@_install_deps_default)
	@$(call targetinfo, $@)
	@$(call install, @PACKET@,,h)
	@$(call touch, $@)

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

@packet@_clean:
	rm -rf $(STATEDIR)/@packet@.*
	rm -rf $(@PACKET@_DIR)

# vim: syntax=make