summaryrefslogtreecommitdiffstats
path: root/rules/dbench.make
blob: 26293eb57f533af33817eb842f2a2554a772a7b8 (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
# -*-makefile-*-
# $Id: template 2606 2005-05-10 21:49:41Z rsc $
#
# Copyright (C) 2005 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
#
PACKAGES-$(PTXCONF_DBENCH) += dbench

#
# Paths and names
#
DBENCH_VERSION	= 3.03
DBENCH		= dbench-$(DBENCH_VERSION)
DBENCH_SUFFIX	= tar.gz
DBENCH_URL	= http://samba.org/ftp/tridge/dbench/$(DBENCH).$(DBENCH_SUFFIX)
DBENCH_SOURCE	= $(SRCDIR)/$(DBENCH).$(DBENCH_SUFFIX)
DBENCH_DIR	= $(BUILDDIR)/$(DBENCH)

-include $(call package_depfile)

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

dbench_get: $(STATEDIR)/dbench.get

dbench_get_deps = $(DBENCH_SOURCE)

$(STATEDIR)/dbench.get: $(dbench_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(DBENCH))
	@$(call touch, $@)

$(DBENCH_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(DBENCH_URL))

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

dbench_extract: $(STATEDIR)/dbench.extract

dbench_extract_deps = $(STATEDIR)/dbench.get

$(STATEDIR)/dbench.extract: $(dbench_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(DBENCH_DIR))
	@$(call extract, $(DBENCH_SOURCE))
	@$(call patchin, $(DBENCH))
	@$(call touch, $@)

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

dbench_prepare: $(STATEDIR)/dbench.prepare

#
# dependencies
#
dbench_prepare_deps = \
	$(STATEDIR)/dbench.extract \
	$(STATEDIR)/virtual-xchain.install

DBENCH_PATH	=  PATH=$(CROSS_PATH)
DBENCH_ENV 	=  $(CROSS_ENV)

#
# autoconf
#
DBENCH_AUTOCONF =  $(CROSS_AUTOCONF_USR)

$(STATEDIR)/dbench.prepare: $(dbench_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(DBENCH_DIR)/config.cache)
	cd $(DBENCH_DIR) && \
		$(DBENCH_PATH) $(DBENCH_ENV) \
		./configure $(DBENCH_AUTOCONF)
	@$(call touch, $@)

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

dbench_compile: $(STATEDIR)/dbench.compile

dbench_compile_deps = $(STATEDIR)/dbench.prepare

$(STATEDIR)/dbench.compile: $(dbench_compile_deps)
	@$(call targetinfo, $@)
	cd $(DBENCH_DIR) && $(DBENCH_ENV) $(DBENCH_PATH) make
	@$(call touch, $@)

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

dbench_install: $(STATEDIR)/dbench.install

$(STATEDIR)/dbench.install: $(STATEDIR)/dbench.compile
	@$(call targetinfo, $@)
	@$(call install, DBENCH)
	@$(call touch, $@)

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

dbench_targetinstall: $(STATEDIR)/dbench.targetinstall

dbench_targetinstall_deps = $(STATEDIR)/dbench.compile

$(STATEDIR)/dbench.targetinstall: $(dbench_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,dbench)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(DBENCH_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)

ifdef PTXCONF_DBENCH_DBENCH
	@$(call install_copy, 0, 0, 0755, \
		$(DBENCH_DIR)/dbench, \
		$(PTXCONF_TESTSUITE_DIR)/$(DBENCH)/dbench)
endif
ifdef PTXCONF_DBENCH_TBENCH
	@$(call install_copy, 0, 0, 0755, \
		$(DBENCH_DIR)/tbench, \
		$(PTXCONF_TESTSUITE_DIR)/$(DBENCH)/tbench)
endif
ifdef PTXCONF_DBENCH_TBENCH_SERVER
	@$(call install_copy, 0, 0, 0755, \
		$(DBENCH_DIR)/tbench_srv, \
		$(PTXCONF_TESTSUITE_DIR)/$(DBENCH)/tbench_srv)
endif

	@$(call install_finish)

	@$(call touch, $@)

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

dbench_clean:
	rm -rf $(STATEDIR)/dbench.*
	rm -rf $(IMAGEDIR)/dbench_*
	rm -rf $(DBENCH_DIR)

# vim: syntax=make