summaryrefslogtreecommitdiffstats
path: root/rules/clock.make
blob: 2399ace12f0d9e9d0080c48239c695a942721b08 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by BSP
#          
# 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_CLOCK
PACKAGES += clock
endif

#
# Paths and names
#
CLOCK_VERSION		= 1.5.1
CLOCK			= clock-$(CLOCK_VERSION)
CLOCK_SUFFIX		= tar.gz
CLOCK_URL		= http://ftp.linux.org.uk/pub/linux/people/alex/$(CLOCK).$(CLOCK_SUFFIX)
CLOCK_SOURCE		= $(SRCDIR)/$(CLOCK).$(CLOCK_SUFFIX)
CLOCK_DIR		= $(BUILDDIR)/$(CLOCK)

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

clock_get: $(STATEDIR)/clock.get

clock_get_deps = $(CLOCK_SOURCE)

$(STATEDIR)/clock.get: $(clock_get_deps)
	@$(call targetinfo, $@)
	touch $@

$(CLOCK_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(CLOCK_URL))

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

clock_extract: $(STATEDIR)/clock.extract

clock_extract_deps = $(STATEDIR)/clock.get

$(STATEDIR)/clock.extract: $(clock_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(CLOCK_DIR))
	@$(call extract, $(CLOCK_SOURCE))
	touch $@

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

clock_prepare: $(STATEDIR)/clock.prepare

#
# dependencies
#
clock_prepare_deps = \
	$(STATEDIR)/clock.extract \
	$(STATEDIR)/virtual-xchain.install

CLOCK_PATH	=  PATH=$(CROSS_PATH)
CLOCK_ENV 	=  $(CROSS_ENV)

$(STATEDIR)/clock.prepare: $(clock_prepare_deps)
	@$(call targetinfo, $@)
	touch $@

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

clock_compile: $(STATEDIR)/clock.compile

clock_compile_deps = $(STATEDIR)/clock.prepare

$(STATEDIR)/clock.compile: $(clock_compile_deps)
	@$(call targetinfo, $@)
	$(CLOCK_PATH) $(CLOCK_ENV) make -C $(CLOCK_DIR)
	touch $@

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

clock_install: $(STATEDIR)/clock.install

$(STATEDIR)/clock.install: $(STATEDIR)/clock.compile
	@$(call targetinfo, $@)
	touch $@

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

clock_targetinstall: $(STATEDIR)/clock.targetinstall

clock_targetinstall_deps = $(STATEDIR)/clock.compile

$(STATEDIR)/clock.targetinstall: $(clock_targetinstall_deps)
	@$(call targetinfo, $@)
	install -D $(CLOCK_DIR)/clock $(ROOTDIR)/sbin/clock
	$(CROSSSTRIP) -R .note -R comment $(ROOTDIR)/sbin/clock
	touch $@

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

clock_clean:
	rm -rf $(STATEDIR)/clock.*
	rm -rf $(CLOCK_DIR)

# vim: syntax=make