summaryrefslogtreecommitdiffstats
path: root/rules/memtest.make
blob: 0dd53e1bb4575d8b08402c941c8be914e20db3e7 (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
# -*-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_MEMTEST
PACKAGES += memtest
endif

#
# Paths and names
#
MEMTEST_VERSION		= 0.0.4
MEMTEST			= memtest-$(MEMTEST_VERSION)
MEMTEST_SUFFIX		= tar.bz2
MEMTEST_URL		= http://carpanta.dc.fi.udc.es/~quintela/memtest/$(MEMTEST).$(MEMTEST_SUFFIX)
MEMTEST_SOURCE		= $(SRCDIR)/$(MEMTEST).$(MEMTEST_SUFFIX)
MEMTEST_DIR		= $(BUILDDIR)/$(MEMTEST)

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

memtest_get: $(STATEDIR)/memtest.get

memtest_get_deps = $(MEMTEST_SOURCE)

$(STATEDIR)/memtest.get: $(memtest_get_deps)
	@$(call targetinfo, $@)
	@$(call get_patches, $(MEMTEST))
	touch $@

$(MEMTEST_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(MEMTEST_URL))

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

memtest_extract: $(STATEDIR)/memtest.extract

memtest_extract_deps = $(STATEDIR)/memtest.get

$(STATEDIR)/memtest.extract: $(memtest_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(MEMTEST_DIR))
	@$(call extract, $(MEMTEST_SOURCE))
	@$(call patchin, $(MEMTEST))
	touch $@

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

memtest_prepare: $(STATEDIR)/memtest.prepare

#
# dependencies
#
memtest_prepare_deps = \
	$(STATEDIR)/memtest.extract \
	$(STATEDIR)/virtual-xchain.install

MEMTEST_PATH	=  PATH=$(CROSS_PATH)
MEMTEST_ENV 	=  $(CROSS_ENV)

#
# autoconf
#
MEMTEST_AUTOCONF = \
	--build=$(GNU_HOST) \
	--host=$(PTXCONF_GNU_TARGET) \
	--prefix=$(CROSS_LIB_DIR)

$(STATEDIR)/memtest.prepare: $(memtest_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(MEMTEST_DIR)/config.cache)
	touch $@

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

memtest_compile: $(STATEDIR)/memtest.compile

memtest_compile_deps = $(STATEDIR)/memtest.prepare

$(STATEDIR)/memtest.compile: $(memtest_compile_deps)
	@$(call targetinfo, $@)
	cd $(MEMTEST_DIR) && $(MEMTEST_ENV) $(MEMTEST_PATH) make mtest
	touch $@

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

memtest_install: $(STATEDIR)/memtest.install

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

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

memtest_targetinstall: $(STATEDIR)/memtest.targetinstall

memtest_targetinstall_deps = $(STATEDIR)/memtest.compile

$(STATEDIR)/memtest.targetinstall: $(memtest_targetinstall_deps)
	@$(call targetinfo, $@)
	cp $(MEMTEST_DIR)/mtest $(ROOTDIR)/usr/bin
	touch $@

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

memtest_clean:
	rm -rf $(STATEDIR)/memtest.*
	rm -rf $(MEMTEST_DIR)

# vim: syntax=make