summaryrefslogtreecommitdiffstats
path: root/rules/nano.make
blob: 9d0767ef576c74192b630ba2a81b1050d78fa381 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2004 by Robert Schwebel
#          
# 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_NANO
PACKAGES += nano
endif

#
# Paths and names
#
NANO_VERSION		= 1.2.4
NANO			= nano-$(NANO_VERSION)
NANO_SUFFIX		= tar.gz
NANO_URL		= http://www.nano-editor.org/dist/v1.2/$(NANO).$(NANO_SUFFIX)
NANO_SOURCE		= $(SRCDIR)/$(NANO).$(NANO_SUFFIX)
NANO_DIR		= $(BUILDDIR)/$(NANO)

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

nano_get: $(STATEDIR)/nano.get

nano_get_deps = $(NANO_SOURCE)

$(STATEDIR)/nano.get: $(nano_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(NANO))
	touch $@

$(NANO_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(NANO_URL))

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

nano_extract: $(STATEDIR)/nano.extract

nano_extract_deps = $(STATEDIR)/nano.get

$(STATEDIR)/nano.extract: $(nano_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(NANO_DIR))
	@$(call extract, $(NANO_SOURCE))
	@$(call patchin, $(NANO))
	touch $@

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

nano_prepare: $(STATEDIR)/nano.prepare

#
# dependencies
#
nano_prepare_deps = \
	$(STATEDIR)/nano.extract \
	$(STATEDIR)/virtual-xchain.install

NANO_PATH	=  PATH=$(CROSS_PATH)
NANO_ENV 	=  $(CROSS_ENV)
#NANO_ENV	+= PKG_CONFIG_PATH=$(CROSS_LIB_DIR)/lib/pkgconfig
#NANO_ENV	+=

#
# autoconf
#
NANO_AUTOCONF =  $(CROSS_AUTOCONF)
NANO_AUTOCONF += --prefix=$(CROSS_LIB_DIR)

$(STATEDIR)/nano.prepare: $(nano_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(NANO_DIR)/config.cache)
	cd $(NANO_DIR) && \
		$(NANO_PATH) $(NANO_ENV) \
		./configure $(NANO_AUTOCONF)
	touch $@

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

nano_compile: $(STATEDIR)/nano.compile

nano_compile_deps = $(STATEDIR)/nano.prepare

$(STATEDIR)/nano.compile: $(nano_compile_deps)
	@$(call targetinfo, $@)
	cd $(NANO_DIR) && $(NANO_ENV) $(NANO_PATH) make
	touch $@

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

nano_install: $(STATEDIR)/nano.install

$(STATEDIR)/nano.install: $(STATEDIR)/nano.compile
	@$(call targetinfo, $@)
	# FIXME: put this into targetinstall? 
	cd $(NANO_DIR) && $(NANO_ENV) $(NANO_PATH) make install
	touch $@

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

nano_targetinstall: $(STATEDIR)/nano.targetinstall

nano_targetinstall_deps = $(STATEDIR)/nano.compile

$(STATEDIR)/nano.targetinstall: $(nano_targetinstall_deps)
	@$(call targetinfo, $@)
	touch $@

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

nano_clean:
	rm -rf $(STATEDIR)/nano.*
	rm -rf $(NANO_DIR)

# vim: syntax=make