summaryrefslogtreecommitdiffstats
path: root/rules/readline.make
blob: 44db50f93bbdd9cc5d2a2cc411da7318508a154e (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
# -*-makefile-*-
# $Id: template 1681 2004-09-01 18:12:49Z  $
#
# Copyright (C) 2004 by Sascha Hauer
#          
# 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_READLINE) += readline

#
# Paths and names
#
READLINE_VERSION	= 5.0
READLINE		= readline-$(READLINE_VERSION)
READLINE_SUFFIX		= tar.gz
READLINE_URL		= $(PTXCONF_SETUP_GNUMIRROR)/readline/$(READLINE).$(READLINE_SUFFIX)
READLINE_SOURCE		= $(SRCDIR)/$(READLINE).$(READLINE_SUFFIX)
READLINE_DIR		= $(BUILDDIR)/$(READLINE)

-include $(call package_depfile)

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

readline_get: $(STATEDIR)/readline.get

readline_get_deps = $(READLINE_SOURCE)

$(STATEDIR)/readline.get: $(readline_get_deps)
	@$(call targetinfo, $@)
#	@$(call get_patches, $(READLINE))
	@$(call touch, $@)

$(READLINE_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(READLINE_URL))

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

readline_extract: $(STATEDIR)/readline.extract

readline_extract_deps = $(STATEDIR)/readline.get

$(STATEDIR)/readline.extract: $(readline_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(READLINE_DIR))
	@$(call extract, $(READLINE_SOURCE))
	@$(call patchin, $(READLINE))
	@$(call touch, $@)

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

readline_prepare: $(STATEDIR)/readline.prepare

#
# dependencies
#
readline_prepare_deps = \
	$(STATEDIR)/readline.extract \
	$(STATEDIR)/virtual-xchain.install \
	$(STATEDIR)/ncurses.install

READLINE_PATH	=  PATH=$(CROSS_PATH)
READLINE_ENV 	=  $(CROSS_ENV)
#READLINE_ENV	+= PKG_CONFIG_PATH=$(CROSS_LIB_DIR)/lib/pkgconfig
#READLINE_ENV	+=

#
# autoconf
#
READLINE_AUTOCONF =  $(CROSS_AUTOCONF_USR)

$(STATEDIR)/readline.prepare: $(readline_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(READLINE_DIR)/config.cache)
	cd $(READLINE_DIR) && \
		$(READLINE_PATH) $(READLINE_ENV) \
		./configure $(READLINE_AUTOCONF)
	@$(call touch, $@)

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

readline_compile: $(STATEDIR)/readline.compile

readline_compile_deps = $(STATEDIR)/readline.prepare

$(STATEDIR)/readline.compile: $(readline_compile_deps)
	@$(call targetinfo, $@)
	cd $(READLINE_DIR) && $(READLINE_ENV) $(READLINE_PATH) make
	@$(call touch, $@)

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

readline_install: $(STATEDIR)/readline.install

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

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

readline_targetinstall: $(STATEDIR)/readline.targetinstall

readline_targetinstall_deps = $(STATEDIR)/readline.compile

$(STATEDIR)/readline.targetinstall: $(readline_targetinstall_deps)
	@$(call targetinfo, $@)

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

	@$(call install_copy, 0, 0, 0644, $(READLINE_DIR)/shlib/libreadline.so.5.0, /lib/libreadline.so.5.0)
	@$(call install_link, libreadline.so.5.0, /lib/libreadline.so.5)
	@$(call install_link, libreadline.so.5.0, /lib/libreadline.so)

	@$(call install_finish)

	@$(call touch, $@)

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

readline_clean:
	rm -rf $(STATEDIR)/readline.*
	rm -rf $(IMAGEDIR)/readline_*
	rm -rf $(READLINE_DIR)

# vim: syntax=make