summaryrefslogtreecommitdiffstats
path: root/rules/dhcp.make
blob: 76ffc2adfa6db617990150a443e5d3c5e29aadce (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
# -*-makefile-*-
# $Id: dhcp.make,v 1.2 2003/12/23 10:48:08 robert Exp $
#
# Copyright (C) 2003 by Benedikt Spranger
#          
# 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_DHCP
PACKAGES += dhcp
endif

#
# Paths and names
#
DHCP_VERSION	= 3.0pl2
DHCP		= dhcp-$(DHCP_VERSION)
DHCP_SUFFIX	= tar.gz
DHCP_URL	= ftp://ftp.isc.org/isc/dhcp/$(DHCP).$(DHCP_SUFFIX)
DHCP_SOURCE	= $(SRCDIR)/$(DHCP).$(DHCP_SUFFIX)
DHCP_DIR	= $(BUILDDIR)/$(DHCP)

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

dhcp_get: $(STATEDIR)/dhcp.get

dhcp_get_deps = $(DHCP_SOURCE)

$(STATEDIR)/dhcp.get: $(dhcp_get_deps)
	@$(call targetinfo, $@)
	touch $@

$(DHCP_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(DHCP_URL))

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

dhcp_extract: $(STATEDIR)/dhcp.extract

dhcp_extract_deps = $(STATEDIR)/dhcp.get

$(STATEDIR)/dhcp.extract: $(dhcp_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(DHCP_DIR))
	@$(call extract, $(DHCP_SOURCE))
	touch $@

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

dhcp_prepare: $(STATEDIR)/dhcp.prepare

#
# dependencies
#
dhcp_prepare_deps = \
	$(STATEDIR)/dhcp.extract \
	$(STATEDIR)/virtual-xchain.install

DHCP_PATH	=  PATH=$(CROSS_PATH)
DHCP_ENV 	=  $(CROSS_ENV)
#DHCP_ENV	+=

$(STATEDIR)/dhcp.prepare: $(dhcp_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(DHCP_DIR)/config.cache)
	cd $(DHCP_DIR) && \
		$(DHCP_PATH) $(DHCP_ENV) \
		./configure $(PTXCONF_GNU_TARGET)
	touch $@

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

dhcp_compile: $(STATEDIR)/dhcp.compile

dhcp_compile_deps = $(STATEDIR)/dhcp.prepare

$(STATEDIR)/dhcp.compile: $(dhcp_compile_deps)
	@$(call targetinfo, $@)
	$(DHCP_PATH) make -C $(DHCP_DIR)
	touch $@

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

dhcp_install: $(STATEDIR)/dhcp.install

$(STATEDIR)/dhcp.install: $(STATEDIR)/dhcp.compile
	@$(call targetinfo, $@)
	$(DHCP_PATH) make -C $(DHCP_DIR) install
	touch $@

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

dhcp_targetinstall: $(STATEDIR)/dhcp.targetinstall

dhcp_targetinstall_deps = $(STATEDIR)/dhcp.compile

$(STATEDIR)/dhcp.targetinstall: $(dhcp_targetinstall_deps)
	@$(call targetinfo, $@)
	touch $@

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

dhcp_clean:
	rm -rf $(STATEDIR)/dhcp.*
	rm -rf $(DHCP_DIR)

# vim: syntax=make