-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
72 lines (51 loc) · 1.38 KB
/
Copy pathmakefile
File metadata and controls
72 lines (51 loc) · 1.38 KB
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
# This directory contains C code for execution on Linux; thus it builds
# .o and executables.
# gnu make required. flex not required unless you change the .l file.
.SUFFIXES: .maclib .macro .assemble .listing
.PHONY: m
%.assemble: %.s
./gas2asm -l <$< | ./asmxpnd >$@
%.listing: %.assemble
hlasm -option term -macrobase macros $*
INSTALLBIN:=${HOME}/bin
INSTALLMAC:=${HOME}/macros
MACS:=${wildcard macros/*.macro}
MACROS:=${notdir ${MACS}}
CFLAGS:=-g -Wall -Werror
YFLAGS:=-Wall -Werror
${INSTALLBIN}/%: %
cp -p $< $@
${INSTALLMAC}/%: macros/%
cp -p $< $@
M:=gas2asm asmxpnd
ML:=../cmslib-exec/fplg2a.maclib
all: $M m
m: ${ML}
${ML}: ${MACS}
maclib ${ML} ${MACS}
# Ensure that the generated flex output stays. OpenSuse 11 ships a
# broken flex that mangles things somewhat royal.
gas2asm.c: gas2asm.l
gas2asm.o: gas2asm.c symtab.c loadfile.c le128.c lookup3.c gas2asmmain.c
${INSTALLBIN}:
mkdir -p ${INSTALLBIN}
${INSTALLMAC}:
mkdir -p ${INSTALLMAC}
install: ${INSTALLBIN}/gas2asm ${INSTALLBIN}/asmxpnd | ${INSTALLBIN}
MP:=${addprefix ${INSTALLMAC}/,${MACROS}}
install-macros: ${MP} | ${INSTALLMAC}
.PHONY: say
say:
@echo Macros: ${MACROS}
t: $M
rm -f core
./gas2asm -f <t.s >t.out 2>t.dbg
test: $M
rm -f core
./gas2asm -f <test/test.s >test.assemble 2>test.dbg
hlasm --macrobase macros test
clean:
rm -f core *.o $M t.out t.dbg
make -C test clean
check: $M
(cd test; make)