summaryrefslogtreecommitdiffstats
path: root/rules/pnetlib.make
blob: 40efeb91287d741909fb46f6e78adc97cc32e3b7 (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
# -*-makefile-*-
# $Id: template 3079 2005-09-02 18:09:51Z rsc $
#
# Copyright (C) 2005 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
#
PACKAGES-$(PTXCONF_PNETLIB) += pnetlib

#
# Paths and names
#
PNETLIB_VERSION	= 0.7.2
PNETLIB		= pnetlib-$(PNETLIB_VERSION)
PNETLIB_SUFFIX	= tar.gz
PNETLIB_URL	= http://www.southern-storm.com.au/download/$(PNETLIB).$(PNETLIB_SUFFIX)
PNETLIB_SOURCE	= $(SRCDIR)/$(PNETLIB).$(PNETLIB_SUFFIX)
PNETLIB_DIR	= $(BUILDDIR)/$(PNETLIB)

-include $(call package_depfile)

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

pnetlib_get: $(STATEDIR)/pnetlib.get

pnetlib_get_deps = $(PNETLIB_SOURCE)

$(STATEDIR)/pnetlib.get: $(pnetlib_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(PNETLIB))
	@$(call touch, $@)

$(PNETLIB_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(PNETLIB_URL))

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

pnetlib_extract: $(STATEDIR)/pnetlib.extract

pnetlib_extract_deps = $(STATEDIR)/pnetlib.get

$(STATEDIR)/pnetlib.extract: $(pnetlib_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(PNETLIB_DIR))
	@$(call extract, $(PNETLIB_SOURCE))
	@$(call patchin, $(PNETLIB))
	@$(call touch, $@)

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

pnetlib_prepare: $(STATEDIR)/pnetlib.prepare

#
# dependencies
#
pnetlib_prepare_deps = \
	$(STATEDIR)/pnetlib.extract \
	$(STATEDIR)/pnet.install \
	$(STATEDIR)/virtual-xchain.install

PNETLIB_PATH	=  PATH=$(CROSS_PATH)
PNETLIB_ENV 	=  $(CROSS_ENV)
PNETLIB_ENV	+= PKG_CONFIG_PATH=$(CROSS_LIB_DIR)/lib/pkgconfig

#
# autoconf
#
PNETLIB_AUTOCONF =  $(CROSS_AUTOCONF_USR)

$(STATEDIR)/pnetlib.prepare: $(pnetlib_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(PNETLIB_DIR)/config.cache)
	cd $(PNETLIB_DIR) && \
		$(PNETLIB_PATH) $(PNETLIB_ENV) \
		./configure $(PNETLIB_AUTOCONF)
	@$(call touch, $@)

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

pnetlib_compile: $(STATEDIR)/pnetlib.compile

pnetlib_compile_deps = $(STATEDIR)/pnetlib.prepare

$(STATEDIR)/pnetlib.compile: $(pnetlib_compile_deps)
	@$(call targetinfo, $@)
	cd $(PNETLIB_DIR) && $(PNETLIB_ENV) $(PNETLIB_PATH) make
	@$(call touch, $@)

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

pnetlib_install: $(STATEDIR)/pnetlib.install

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

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

pnetlib_targetinstall: $(STATEDIR)/pnetlib.targetinstall

pnetlib_targetinstall_deps = $(STATEDIR)/pnetlib.compile

$(STATEDIR)/pnetlib.targetinstall: $(pnetlib_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,pnetlib)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(PNETLIB_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Robert Schwebel <b.spranger\@linutronix.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

	#@$(call install_copy, 0, 0, 0755, $(PNETLIB_DIR)/foobar, /dev/null)

	@$(call install_finish)

	@$(call touch, $@)

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

pnetlib_clean:
	rm -rf $(STATEDIR)/pnetlib.*
	rm -rf $(IMAGEDIR)/pnetlib_*
	rm -rf $(PNETLIB_DIR)

# vim: syntax=make