summaryrefslogtreecommitdiffstats
path: root/rules/memtest86p.make
blob: 8a4ccde1a67cf4154ca575698148c41e0ea5d7db (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
# -*-makefile-*-
#
# Copyright (C) 2011 by Alexander Stein <alexander.stein@systec-electronic.com>
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
ifndef PTXCONF_ARCH_X86_64
PACKAGES-$(PTXCONF_ARCH_X86)-$(PTXCONF_MEMTEST86P) += memtest86p
endif

#
# Paths and names
#
MEMTEST86P_VERSION	:= 4.20
MEMTEST86P		:= memtest86+-$(MEMTEST86P_VERSION)
MEMTEST86P_SUFFIX	:= tar.gz
MEMTEST86P_URL		:= http://www.memtest.org/download/$(MEMTEST86P_VERSION)/$(MEMTEST86P).$(MEMTEST86P_SUFFIX)
MEMTEST86P_SOURCE	:= $(SRCDIR)/$(MEMTEST86P).$(MEMTEST86P_SUFFIX)
MEMTEST86P_DIR		:= $(BUILDDIR)/$(MEMTEST86P)
MEMTEST86P_LICENSE	:= GPL-2
MEMTEST86P_MD5		:= ef62c2f5be616676c8c62066dedc46b3

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

$(STATEDIR)/memtest86p.prepare:
	@$(call targetinfo)

ifdef PTXCONF_MEMTEST86P_SERIAL
	sed -i -e 's/#define SERIAL_CONSOLE_DEFAULT 0/#define SERIAL_CONSOLE_DEFAULT 1/' $(MEMTEST86P_DIR)/config.h
	sed -i -e 's/#define SERIAL_BAUD_RATE .*/#define SERIAL_BAUD_RATE $(PTXCONF_MEMTEST86P_BAUDRATE)/' $(MEMTEST86P_DIR)/config.h
else
	@sed -i -e 's/#define SERIAL_CONSOLE_DEFAULT 1/#define SERIAL_CONSOLE_DEFAULT 0/' $(MEMTEST86P_DIR)/config.h
endif
	# Don't prestrip generated files
	sed -i -e 's/$$(LD) -s /$$(LD) /' $(MEMTEST86P_DIR)/Makefile
	@$(call touch)

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

MEMTEST86P_PATH	:= PATH=$(CROSS_PATH)
MEMTEST86P_MAKE_OPT	:= $(CROSS_ENV_PROGS)
MEMTEST86P_CFLAGS	:= -fgnu89-inline

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

$(STATEDIR)/memtest86p.install:
	@$(call targetinfo)
	install -D -m 644 $(MEMTEST86P_DIR)/memtest.bin \
		$(MEMTEST86P_PKGDIR)/boot/memtest86+.bin
	@$(call touch)

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

$(STATEDIR)/memtest86p.targetinstall:
	@$(call targetinfo)

	@$(call install_init, memtest86p)
	@$(call install_fixup, memtest86p,PRIORITY,optional)
	@$(call install_fixup, memtest86p,SECTION,base)
	@$(call install_fixup, memtest86p,AUTHOR,"Alexander Stein <alexander.stein@systec-electronic.com>")
	@$(call install_fixup, memtest86p,DESCRIPTION,missing)

	@$(call install_copy, memtest86p, 0, 0, 0644, -, /boot/memtest86+.bin)

	@$(call install_finish, memtest86p)

	@$(call touch)

# vim: syntax=make