-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
156 lines (129 loc) · 4.49 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Makefile for GNU superoptimizer
MAXCOST = 3
EXTRA = -shifts -extracts
CC = gcc
DBG = -g
OPT = -O
CFLAGS = $(CPU) $(OPT) $(DBG)
ALL_MACHINES = superopt-sparc \
superopt-power \
superopt-powerpc \
superopt-m88000 \
superopt-am29k \
superopt-mc68000 \
superopt-mc68020 \
superopt-i386 \
superopt-i960a \
superopt-i960b \
superopt-pyr \
superopt-alpha \
superopt-sh \
superopt-hppa \
superopt-xcore \
superopt-avr
OBJS = superopt.o
SRCS = superopt.c
HDRS = run_program.def insn.def goal.def synth.def superopt.h version.h \
longlong.h
BINDIR = /usr/local/bin
INSTALL = install -c
FILES = README COPYING Makefile TODO ChangeLog superopt.c synth.def $(HDRS)
VERSION = `sed 's,char \*version_string = "\([0-9.]*\)";,\1,' < version.h`
superopt: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -o superopt $(SRCS)
clean:
rm -f $(OBJS) superopt $(ALL_MACHINES) *.tmp
install: superopt
$(INSTALL) superopt $(BINDIR)/superopt
all: $(ALL_MACHINES)
install-all: all
for x in $(ALL_MACHINES); do $(INSTALL) $$x $(BINDIR)/$$x; done
run-all: sparc.res power.res powerpc.res m88000.res am29k.res mc68000.res \
mc68020.res i386.res i960a.res i960b.res pyr.res alpha.res sh.res \
hppa.res
@echo "Done!"
superopt-sparc: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DSPARC -o superopt-sparc $(SRCS)
sparc.res: superopt-sparc
./superopt-sparc -all $(EXTRA) -max $(MAXCOST) -as >sparc.tmp 2>&1
mv sparc.tmp sparc.res
superopt-power: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DPOWER -o superopt-power $(SRCS)
power.res: superopt-power
./superopt-power -all $(EXTRA) -max $(MAXCOST) -as >power.tmp 2>&1
mv power.tmp power.res
superopt-powerpc: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DPOWERPC -o superopt-powerpc $(SRCS)
powerpc.res: superopt-powerpc
./superopt-powerpc -all $(EXTRA) -max $(MAXCOST) -as >powerpc.tmp 2>&1
mv powerpc.tmp powerpc.res
superopt-m88000: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DM88000 -o superopt-m88000 $(SRCS)
m88000.res: superopt-m88000
./superopt-m88000 -all $(EXTRA) -max $(MAXCOST) -as >m88000.tmp 2>&1
mv m88000.tmp m88000.res
superopt-am29k: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DAM29K -o superopt-am29k $(SRCS)
am29k.res: superopt-am29k
./superopt-am29k -all $(EXTRA) -max $(MAXCOST) -as >am29k.tmp 2>&1
mv am29k.tmp am29k.res
superopt-mc68000: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DMC68000 -o superopt-mc68000 $(SRCS)
mc68000.res: superopt-mc68000
./superopt-mc68000 -all $(EXTRA) -max $(MAXCOST) -as >mc68000.tmp 2>&1
mv mc68000.tmp mc68000.res
superopt-mc68020: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DMC68020 -o superopt-mc68020 $(SRCS)
mc68020.res: superopt-mc68020
./superopt-mc68020 -all $(EXTRA) -max $(MAXCOST) -as >mc68020.tmp 2>&1
mv mc68020.tmp mc68020.res
superopt-i386: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DI386 -o superopt-i386 $(SRCS)
i386.res: superopt-i386
./superopt-i386 -all $(EXTRA) -max $(MAXCOST) -as >i386.tmp 2>&1
mv i386.tmp i386.res
superopt-i960a: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DI960 -o superopt-i960a $(SRCS)
i960a.res: superopt-i960a
./superopt-i960a -all $(EXTRA) -max $(MAXCOST) -as >i960a.tmp 2>&1
mv i960a.tmp i960a.res
superopt-i960b: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DI960B -o superopt-i960b $(SRCS)
i960b.res: superopt-i960b
./superopt-i960b -all $(EXTRA) -max $(MAXCOST) -as >i960b.tmp 2>&1
mv i960b.tmp i960b.res
superopt-pyr: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DPYR -o superopt-pyr $(SRCS)
pyr.res: superopt-pyr
./superopt-pyr -all $(EXTRA) -max $(MAXCOST) -as >pyr.tmp 2>&1
mv pyr.tmp pyr.res
superopt-alpha: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DALPHA -o superopt-alpha $(SRCS)
alpha.res: superopt-alpha
./superopt-alpha -all $(EXTRA) -max $(MAXCOST) -as >alpha.tmp 2>&1
mv alpha.tmp alpha.res
superopt-sh: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DSH -o superopt-sh $(SRCS)
sh.res: superopt-sh
./superopt-sh -all $(EXTRA) -max $(MAXCOST) -as >sh.tmp 2>&1
mv sh.tmp sh.res
superopt-hppa: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DHPPA -o superopt-hppa $(SRCS)
hppa.res: superopt-hppa
./superopt-hppa -all $(EXTRA) -max $(MAXCOST) -as >hppa.tmp 2>&1
mv hppa.tmp hppa.res
superopt-xcore: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DXCORE -o superopt-xcore $(SRCS)
xcore.res: superopt-xcore
./superopt-xcore -all $(EXTRA) -max $(MAXCOST) -as >xcore.tmp 2>&1
mv xcore.tmp xcore.res
superopt-avr: $(SRCS) $(HDRS)
$(CC) $(CFLAGS) -DAVR -o superopt-avr $(SRCS)
avr.res: superopt-avr
./superopt-avr -all $(EXTRA) -max $(MAXCOST) -as >avr.tmp 2>&1
mv avr.tmp avr.res
dist:
mkdir superopt-$(VERSION)
ln $(FILES) superopt-$(VERSION)
tar cf - superopt-$(VERSION) | gzip --best > superopt-$(VERSION).tar.gz
rm -rf superopt-$(VERSION)