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 157 158 159 160 161 162 163
|
TESTDATA_cint1 = power.c 2 15
SPECDATA_cint1 = power.c
TESTDATA_cint2 = gcd.c 455 429
SPECDATA_cint2 = gcd.c
REPEAT = 100000
CMIXFLAGS = -s -q
SHELL = /bin/sh
YACC = @YACC@
LEX = @LEX@
LEXLIB = @LEXLIB@
prefix = @prefix@
exec_prefix = @exec_prefix@
datadir = @datadir@
CC = @CC@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
SPECLIB = -lcmix
CPPFLAGS = @CPPFLAGS@
CMIX = cmix
MV = mv
RM = rm -f
WC = wc
SED = sed
EXEEXT = @EXEEXT@
TIMEPROG = $(datadir)/cmix/time-prog
all: timing1
clean:
$(RM) *.o core cint-par-tab.c cint-par-tab.h cint-lex.c
for i in cint1 cint2 answr2; do \
$(RM) $$i-gen.c $$i-gen@EXEEXT@ $$i-res.c \
$$i-res@EXEEXT@ $$i-time$(EXEEXT) \
$$i-time.txt $$i.ann ; \
done
distclean: clean
$(RM) Makefile
timing1: cint1-time.txt
head -8 $?; tail -8 $?
timing2: cint2-time.txt
head -8 $?; tail -8 $?
answer2: answr2-time.txt
head -8 $?; tail -8 $?
.PRECIOUS: cint1-res.c cint2-res.c answr2-res.c
.PRECIOUS: cint1-gen.c cint2-gen.c answr2-gen.c
.PHONY: clean all timing2 timing1 answer2
cint-lex.c: cint-lex.l cint.h cint-par-tab.h
$(LEX) cint-lex.l
$(MV) lex.yy.c $@ || $(MV) lex_yy.c $@
cint-par-tab.c cint-par-tab.h: cint-par.y
$(YACC) -d cint-par.y
$(MV) y.tab.c cint-par-tab.c || $(MV) y_tab.c cint-par-tab.c
$(MV) y.tab.h cint-par-tab.h || $(MV) y_tab.h cint-par-tab.h
#
# %-time.txt: %-time %.o %-res.o
#
cint1-time.txt: cint1-time cint1.o cint1-res.o
$(TIMEPROG) cint1 $(REPEAT) "$(TESTDATA_cint1)" > $@
cint2-time.txt: cint2-time cint2.o cint2-res.o
$(TIMEPROG) cint2 $(REPEAT) "$(TESTDATA_cint2)" > $@
answr2-time.txt: answr2-time answr2.o answr2-res.o
$(TIMEPROG) answr2 $(REPEAT) "$(TESTDATA_cint2)" > $@
#
# %-gen.c: %.c
#
cint1-gen.c: cint1.c cint1.cmx
$(CMIX) $(CMIXFLAGS) cint1.cmx
cint2-gen.c: cint2.c cint2.cmx
$(CMIX) $(CMIXFLAGS) cint2.cmx
answr2-gen.c: answr2.c answr2.cmx
$(CMIX) $(CMIXFLAGS) answr2.cmx
#
# %-gen@EXEEXT@: %-gen.c
#
cint1-gen@EXEEXT@: cint1-gen.c cint-par-tab.o construct.o cint-lex.o \
spectimeerror.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
cint1-gen.c cint-par-tab.o construct.o cint-lex.o \
spectimeerror.o $(SPECLIB) $(LEXLIB)
cint2-gen@EXEEXT@: cint2-gen.c cint-par-tab.o construct.o cint-lex.o \
spectimeerror.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
cint2-gen.c cint-par-tab.o construct.o cint-lex.o \
spectimeerror.o $(SPECLIB) $(LEXLIB)
answr2-gen@EXEEXT@: answr2-gen.c cint-par-tab.o construct.o cint-lex.o \
spectimeerror.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
answr2-gen.c cint-par-tab.o construct.o cint-lex.o \
spectimeerror.o $(SPECLIB) $(LEXLIB)
#
# %-res.c: %-gen@EXEEXT@
#
cint1-res.c: cint1-gen@EXEEXT@
./cint1-gen@EXEEXT@ $(SPECDATA_cint1) > $@
cint2-res.c: cint2-gen@EXEEXT@
./cint2-gen@EXEEXT@ $(SPECDATA_cint2) > $@
answr2-res.c: answr2-gen@EXEEXT@
./answr2-gen@EXEEXT@ $(SPECDATA_cint2) > $@
#
# %-time@EXEEXT@: cint-time.o %.o %-res.o construct.o nospectimeerror.o \
# cint-par-tab.o cint-lex.o
#
cint1-time@EXEEXT@: cint-time.o cint1.o cint1-res.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o
$(CC) -o $@ $(LDFLAGS) cint-time.o cint1.o cint1-res.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o $(LEXLIB)
cint2-time@EXEEXT@: cint-time.o cint2.o cint2-res.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o
$(CC) -o $@ $(LDFLAGS) cint-time.o cint2.o cint2-res.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o $(LEXLIB)
answr2-time@EXEEXT@: cint-time.o answr2.o answr2-res.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o
$(CC) -o $@ $(LDFLAGS) cint-time.o answr2.o answr2-res.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o $(LEXLIB)
#
# %-main@EXEEXT@: %.o cint-main.o onstruct.o nospectimerror.o \
# cint-par-tab.o cint-lex.o
#
cint1-main@EXEEXT@: cint1.o cint-main.o construct.o nospectimeerror.o \
cint-par-tab.o cint-lex.o
$(CC) -o $@ $(LDFLAGS) cint1.o cint-main.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o $(LEXLIB)
cint2-main@EXEEXT@: cint2.o cint-main.o construct.o nospectimeerror.o \
cint-par-tab.o cint-lex.o
$(CC) -o $@ $(LDFLAGS) cint1.o cint-main.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o $(LEXLIB)
answr2-main@EXEEXT@: answr2.o cint-main.o construct.o nospectimeerror.o \
cint-par-tab.o cint-lex.o
$(CC) -o $@ $(LDFLAGS) answr2.o cint-main.o construct.o \
nospectimeerror.o cint-par-tab.o cint-lex.o $(LEXLIB)
|