summaryrefslogtreecommitdiffstats
path: root/rules/setserial.make
blob: 6d209bb203711e49cbed034ebf8b538611ea8a66 (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
# -*-makefile-*-
# $Id$
#
# 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_SETSERIAL) += setserial

#
# Paths and names
#
SETSERIAL_VERSION	= 2.17
SETSERIAL		= setserial-$(SETSERIAL_VERSION)
SETSERIAL_SUFFIX	= tar.gz
SETSERIAL_URL		= $(PTXCONF_SETUP_SFMIRROR)/setserial/$(SETSERIAL).$(SETSERIAL_SUFFIX)
SETSERIAL_SOURCE	= $(SRCDIR)/$(SETSERIAL).$(SETSERIAL_SUFFIX)
SETSERIAL_DIR		= $(BUILDDIR)/$(SETSERIAL)

-include $(call package_depfile)

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

setserial_get: $(STATEDIR)/setserial.get

setserial_get_deps = $(SETSERIAL_SOURCE)

$(STATEDIR)/setserial.get: $(setserial_get_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(SETSERIAL_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(SETSERIAL_URL))

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

setserial_extract: $(STATEDIR)/setserial.extract

setserial_extract_deps = $(STATEDIR)/setserial.get

$(STATEDIR)/setserial.extract: $(setserial_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(SETSERIAL_DIR))
	@$(call extract, $(SETSERIAL_SOURCE))
	@$(call patchin, $(SETSERIAL))
	@$(call touch, $@)

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

setserial_prepare: $(STATEDIR)/setserial.prepare

#
# dependencies
#
setserial_prepare_deps = \
	$(STATEDIR)/setserial.extract \
	$(STATEDIR)/virtual-xchain.install

SETSERIAL_PATH	=  PATH=$(CROSS_PATH)
SETSERIAL_ENV 	=  $(CROSS_ENV)
SETSERIAL_ENV	+= PKG_CONFIG_PATH=$(CROSS_LIB_DIR)/lib/pkgconfig

#
# autoconf
#
SETSERIAL_AUTOCONF =  $(CROSS_AUTOCONF_USR)

$(STATEDIR)/setserial.prepare: $(setserial_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(SETSERIAL_DIR)/config.cache)
	cd $(SETSERIAL_DIR) && \
		$(SETSERIAL_PATH) $(SETSERIAL_ENV) \
		./configure $(SETSERIAL_AUTOCONF)
	@$(call touch, $@)

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

setserial_compile: $(STATEDIR)/setserial.compile

setserial_compile_deps = $(STATEDIR)/setserial.prepare

$(STATEDIR)/setserial.compile: $(setserial_compile_deps)
	@$(call targetinfo, $@)
	cd $(SETSERIAL_DIR) && $(SETSERIAL_ENV) $(SETSERIAL_PATH) make
	@$(call touch, $@)

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

setserial_install: $(STATEDIR)/setserial.install

$(STATEDIR)/setserial.install: $(STATEDIR)/setserial.compile
	@$(call targetinfo, $@)
	@$(call install, SETSERIAL)
	@$(call touch, $@)

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

setserial_targetinstall: $(STATEDIR)/setserial.targetinstall

setserial_targetinstall_deps = $(STATEDIR)/setserial.compile

$(STATEDIR)/setserial.targetinstall: $(setserial_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,setserial)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(SETSERIAL_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Benedikt Spranger <b.spranger\@linutronix.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

	@$(call install_copy, 0, 0, 0755, $(SETSERIAL_DIR)/setserial, /bin/setserial)

	@$(call install_finish)

	@$(call touch, $@)

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

setserial_clean:
	rm -rf $(STATEDIR)/setserial.*
	rm -rf $(IMAGEDIR)/setserial_*
	rm -rf $(SETSERIAL_DIR)

# vim: syntax=make