summaryrefslogtreecommitdiffstats
path: root/rules/gawk.make
blob: 386bea343462a1cd81e01a6eeb2eccfbcb38ad4a (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
129
130
131
132
133
134
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Ixia Corporation, By Milan Bobde
#          
# 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_GAWK) += gawk

#
# Paths and names
#
GAWK_VERSION		= 3.1.5
GAWK			= gawk-$(GAWK_VERSION)
GAWK_SUFFIX		= tar.gz
GAWK_URL		= $(PTXCONF_SETUP_GNUMIRROR)/gawk/$(GAWK).$(GAWK_SUFFIX)
GAWK_SOURCE		= $(SRCDIR)/$(GAWK).$(GAWK_SUFFIX)
GAWK_DIR		= $(BUILDDIR)/$(GAWK)

-include $(call package_depfile)

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

gawk_get: $(STATEDIR)/gawk.get

gawk_get_deps = $(GAWK_SOURCE)

$(STATEDIR)/gawk.get: $(gawk_get_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(GAWK_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(GAWK_URL))

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

gawk_extract: $(STATEDIR)/gawk.extract

gawk_extract_deps = $(STATEDIR)/gawk.get

$(STATEDIR)/gawk.extract: $(gawk_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(GAWK_DIR))
	@$(call extract, $(GAWK_SOURCE))
	@$(call patchin, $(GAWK))
	@$(call touch, $@)

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

gawk_prepare: $(STATEDIR)/gawk.prepare

#
# dependencies
#
gawk_prepare_deps = \
	$(STATEDIR)/gawk.extract \
	$(STATEDIR)/virtual-xchain.install

GAWK_PATH	=  PATH=$(CROSS_PATH)
GAWK_ENV 	=  $(CROSS_ENV)

#
# autoconf
#
GAWK_AUTOCONF =  $(CROSS_AUTOCONF_USR)

$(STATEDIR)/gawk.prepare: $(gawk_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(GAWK_DIR)/config.cache)
	cd $(GAWK_DIR) && \
		$(GAWK_PATH) $(GAWK_ENV) \
		./configure $(GAWK_AUTOCONF)
	@$(call touch, $@)

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

gawk_compile: $(STATEDIR)/gawk.compile

gawk_compile_deps = $(STATEDIR)/gawk.prepare

$(STATEDIR)/gawk.compile: $(gawk_compile_deps)
	@$(call targetinfo, $@)
	cd $(GAWK_DIR) && $(GAWK_ENV) $(GAWK_PATH) make $(GAWK_MAKEVARS)
	@$(call touch, $@)

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

gawk_install: $(STATEDIR)/gawk.install

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

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

gawk_targetinstall: $(STATEDIR)/gawk.targetinstall

gawk_targetinstall_deps = $(STATEDIR)/gawk.compile

$(STATEDIR)/gawk.targetinstall: $(gawk_targetinstall_deps)
	@$(call targetinfo, $@)
	# FIXME: RSC: ipkgize
	@$(call touch, $@)

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

gawk_clean:
	rm -rf $(STATEDIR)/gawk.*
	rm -rf $(GAWK_DIR)

# vim: syntax=make