-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
85 lines (69 loc) · 2.13 KB
/
Makefile
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
#
# Makefile for memtester by Charles Cazabon.
#
# Copyright (C) 1999 Simon Kirby.
# Copyright (C) 1999-2020 Charles Cazabon.
# Licensed under the GNU General Public License version 2. See the file
# COPYING for details.
#
# You don't need to edit these; change the contents of the conf-cc and conf-ld
# files if you need to change the compile/link commands. See the README for
# more information.
CC = $(shell head -n 1 conf-cc)
LD = $(shell head -n 1 conf-ld)
SOURCES = memtester.c tests.c output.c
OBJECTS = $(SOURCES:.c=.o)
HEADERS = memtester.h
TARGETS = *.o compile load auto-ccld.sh find-systype make-compile make-load systype extra-libs
INSTALLPATH = /usr/local
#
# Targets
#
all: memtester
install: all
mkdir -m 755 -p $(INSTALLPATH)/bin
install -m 755 memtester $(INSTALLPATH)/bin/
mkdir -m 755 -p $(INSTALLPATH)/man/man8
gzip -c memtester.8 >memtester.8.gz ; install -m 644 memtester.8.gz $(INSTALLPATH)/man/man8/
auto-ccld.sh: \
conf-cc conf-ld warn-auto.sh
( cat warn-auto.sh; \
echo CC=\'`head -1 conf-cc`\'; \
echo LD=\'`head -1 conf-ld`\' \
) > auto-ccld.sh
compile: \
make-compile warn-auto.sh systype
( cat warn-auto.sh; ./make-compile "`cat systype`" ) > \
compile
chmod 755 compile
find-systype: \
find-systype.sh auto-ccld.sh
cat auto-ccld.sh find-systype.sh > find-systype
chmod 755 find-systype
make-compile: \
make-compile.sh auto-ccld.sh
cat auto-ccld.sh make-compile.sh > make-compile
chmod 755 make-compile
make-load: \
make-load.sh auto-ccld.sh
cat auto-ccld.sh make-load.sh > make-load
chmod 755 make-load
systype: \
find-systype trycpp.c
./find-systype > systype
extra-libs: \
extra-libs.sh systype
./extra-libs.sh "`cat systype`" >extra-libs
load: \
make-load warn-auto.sh systype
( cat warn-auto.sh; ./make-load "`cat systype`" ) > load
chmod 755 load
clean:
rm -f memtester $(TARGETS) $(OBJECTS) core
memtester: \
$(OBJECTS) memtester.c tests.h tests.c tests.h conf-cc Makefile load extra-libs
./load memtester tests.o output.o `cat extra-libs`
memtester.o: memtester.c tests.h conf-cc Makefile compile
./compile memtester.c
tests.o: tests.c tests.h conf-cc Makefile compile
./compile tests.c