summaryrefslogtreecommitdiffstats
path: root/rules/coreutils.make
blob: 466b04024e35048cb75e9bc96eb8e951e286e510 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Pengutronix e.K., Hildesheim, Germany
# 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_COREUTILS) += coreutils

#
# Paths and names 
#
COREUTILS_VERSION	:= 5.2.1
COREUTILS		:= coreutils-$(COREUTILS_VERSION)
COREUTILS_URL		:= $(PTXCONF_SETUP_GNUMIRROR)/coreutils/$(COREUTILS).tar.bz2 
COREUTILS_SOURCE	:= $(SRCDIR)/$(COREUTILS).tar.bz2
COREUTILS_DIR		:= $(BUILDDIR)/$(COREUTILS)


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

coreutils_get: $(STATEDIR)/coreutils.get

$(STATEDIR)/coreutils.get: $(coreutils_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(COREUTILS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, COREUTILS)

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

coreutils_extract: $(STATEDIR)/coreutils.extract

$(STATEDIR)/coreutils.extract: $(coreutils_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(COREUTILS_DIR))
	@$(call extract, COREUTILS)
	@$(call patchin, COREUTILS)
	@$(call touch, $@)

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

coreutils_prepare: $(STATEDIR)/coreutils.prepare

COREUTILS_AUTOCONF := \
	$(CROSS_AUTOCONF_USR) \
	--target=$(PTXCONF_GNU_TARGET) \
	--disable-nls

COREUTILS_PATH	:=  PATH=$(CROSS_PATH)
COREUTILS_ENV	:=  $(CROSS_ENV)

#ifdef PTXCONF_COREUTILS_SHLIKE
#COREUTILS_AUTOCONF	+= --enable-shell=sh
#else
#COREUTILS_AUTOCONF	+= --enable-shell=ksh
#endif

$(STATEDIR)/coreutils.prepare: $(coreutils_prepare_deps_default)
	@$(call targetinfo, $@)

	cd $(COREUTILS_DIR) && \
		$(COREUTILS_PATH) $(COREUTILS_ENV) \
		./configure $(COREUTILS_AUTOCONF)

	cd $(COREUTILS_DIR)/src && make localedir.h

	@$(call touch, $@)

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

coreutils_compile_deps = $(STATEDIR)/coreutils.prepare

coreutils_compile: $(STATEDIR)/coreutils.compile

$(STATEDIR)/coreutils.compile: $(coreutils_compile_deps_default)
	@$(call targetinfo, $@)
	$(COREUTILS_PATH) make -C $(COREUTILS_DIR)/lib libfetish.a
ifdef PTXCONF_COREUTILS_CP
	$(COREUTILS_PATH) make -C $(COREUTILS_DIR)/src cp
endif
ifdef PTXCONF_COREUTILS_DD
	$(COREUTILS_PATH) make -C $(COREUTILS_DIR)/src dd
endif
ifdef PTXCONF_COREUTILS_MD5SUM
	$(COREUTILS_PATH) make -C $(COREUTILS_DIR)/src md5sum
endif
ifdef PTXCONF_COREUTILS_SEQ
	$(COREUTILS_PATH) make -C $(COREUTILS_DIR)/src seq
endif
	@$(call touch, $@)

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

coreutils_install: $(STATEDIR)/coreutils.install

$(STATEDIR)/coreutils.install: $(coreutils_install_deps_default)
	@$(call targetinfo, $@)
	# FIXME
	# @$(call install, COREUTILS)
	@$(call touch, $@)

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

coreutils_targetinstall: $(STATEDIR)/coreutils.targetinstall

$(STATEDIR)/coreutils.targetinstall: $(coreutils_targetinstall_deps_default)
	@$(call targetinfo, $@)

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

ifdef PTXCONF_COREUTILS_CP
	@$(call install_copy, coreutils, 0, 0, 0755, $(COREUTILS_DIR)/src/cp, /bin/cp)
endif
ifdef PTXCONF_COREUTILS_DD
	@$(call install_copy, coreutils, 0, 0, 0755, $(COREUTILS_DIR)/src/dd, /bin/dd)	
endif
ifdef PTXCONF_COREUTILS_MD5SUM
	@$(call install_copy, coreutils, 0, 0, 0755, $(COREUTILS_DIR)/src/md5sum, /usr/bin/md5sum)
endif
ifdef PTXCONF_COREUTILS_SEQ
	@$(call install_copy, coreutils, 0, 0, 0755, $(COREUTILS_DIR)/src/seq, /usr/bin/seq)
endif

	@$(call install_finish, coreutils)

	@$(call touch, $@)

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

coreutils_clean: 
	rm -rf $(STATEDIR)/coreutils.* $(COREUTILS_DIR)
	rm -fr $(IMAGEDIR)/coreutils_*

# vim: syntax=make