| 1 |
# |
| 2 |
# Makefile for memtester by Charles Cazabon. |
| 3 |
# |
| 4 |
# Copyright (C) 1999 Simon Kirby. |
| 5 |
# Copyright (C) 1999-2020 Charles Cazabon. |
| 6 |
# Licensed under the GNU General Public License version 2. See the file |
| 7 |
# COPYING for details. |
| 8 |
# |
| 9 |
|
| 10 |
# You don't need to edit these; change the contents of the conf-cc and conf-ld |
| 11 |
# files if you need to change the compile/link commands. See the README for |
| 12 |
# more information. |
| 13 |
|
| 14 |
SOURCES = memtester.c tests.c |
| 15 |
OBJECTS = $(SOURCES:.c=.o) |
| 16 |
HEADERS = memtester.h |
| 17 |
TARGETS = *.o compile load auto-ccld.sh find-systype make-compile make-load systype extra-libs |
| 18 |
INSTALLPATH = /usr/local |
| 19 |
|
| 20 |
# |
| 21 |
# Targets |
| 22 |
# |
| 23 |
all: memtester |
| 24 |
|
| 25 |
install: all |
| 26 |
mkdir -m 755 -p $(INSTALLPATH)/bin |
| 27 |
install -m 755 memtester $(INSTALLPATH)/bin/ |
| 28 |
mkdir -m 755 -p $(INSTALLPATH)/man/man8 |
| 29 |
gzip -c memtester.8 >memtester.8.gz ; install -m 644 memtester.8.gz $(INSTALLPATH)/man/man8/ |
| 30 |
|
| 31 |
auto-ccld.sh: \ |
| 32 |
conf-cc conf-ld warn-auto.sh |
| 33 |
( cat warn-auto.sh; \ |
| 34 |
echo CC=\'`head -1 conf-cc`\'; \ |
| 35 |
echo LD=\'`head -1 conf-ld`\' \ |
| 36 |
) > auto-ccld.sh |
| 37 |
|
| 38 |
compile: \ |
| 39 |
make-compile warn-auto.sh systype |
| 40 |
( cat warn-auto.sh; ./make-compile "`cat systype`" ) > \ |
| 41 |
compile |
| 42 |
chmod 755 compile |
| 43 |
|
| 44 |
find-systype: \ |
| 45 |
find-systype.sh auto-ccld.sh |
| 46 |
cat auto-ccld.sh find-systype.sh > find-systype |
| 47 |
chmod 755 find-systype |
| 48 |
|
| 49 |
make-compile: \ |
| 50 |
make-compile.sh auto-ccld.sh |
| 51 |
cat auto-ccld.sh make-compile.sh > make-compile |
| 52 |
chmod 755 make-compile |
| 53 |
|
| 54 |
make-load: \ |
| 55 |
make-load.sh auto-ccld.sh |
| 56 |
cat auto-ccld.sh make-load.sh > make-load |
| 57 |
chmod 755 make-load |
| 58 |
|
| 59 |
systype: \ |
| 60 |
find-systype trycpp.c |
| 61 |
./find-systype > systype |
| 62 |
|
| 63 |
extra-libs: \ |
| 64 |
extra-libs.sh systype |
| 65 |
./extra-libs.sh "`cat systype`" >extra-libs |
| 66 |
|
| 67 |
load: \ |
| 68 |
make-load warn-auto.sh systype |
| 69 |
( cat warn-auto.sh; ./make-load "`cat systype`" ) > load |
| 70 |
chmod 755 load |
| 71 |
|
| 72 |
clean: |
| 73 |
rm -f memtester $(TARGETS) $(OBJECTS) core |
| 74 |
|
| 75 |
memtester: \ |
| 76 |
$(OBJECTS) memtester.c tests.h tests.c tests.h conf-cc Makefile load extra-libs |
| 77 |
./load memtester tests.o `cat extra-libs` |
| 78 |
|
| 79 |
memtester.o: memtester.c tests.h conf-cc Makefile compile |
| 80 |
./compile memtester.c |
| 81 |
|
| 82 |
tests.o: tests.c tests.h conf-cc Makefile compile |
| 83 |
./compile tests.c |