-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (43 loc) · 1.28 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
CC=gcc
CFLAGS=-Wall -O1 -g
LCFLAGS=-O1
LEX=flex
YACC=bison
# LHY-LHP 2021.10.5 - We do not need this lib anymore.
# LEXLIB = -lfl
YAS=./yas
all: yis yas hcl2c
# These are implicit rules for making .yo files from .ys files.
# E.g., make sum.yo
.SUFFIXES: .ys .yo
.ys.yo:
$(YAS) $*.ys
# These are the explicit rules for making yis yas and hcl2c and hcl2v
yas-grammar.o: yas-grammar.c
$(CC) $(LCFLAGS) -c yas-grammar.c
yas-grammar.c: yas-grammar.lex
$(LEX) yas-grammar.lex
mv lex.yy.c yas-grammar.c
isa.o: isa.c isa.h
$(CC) $(CFLAGS) -c isa.c
yas.o: yas.c yas.h isa.h
$(CC) $(CFLAGS) -c yas.c
yas: yas.o yas-grammar.o isa.o
$(CC) $(CFLAGS) yas-grammar.o yas.o isa.o ${LEXLIB} -o yas
yis.o: yis.c isa.h
$(CC) $(CFLAGS) -c yis.c
yis: yis.o isa.o
$(CC) $(CFLAGS) yis.o isa.o -o yis
hcl2c: hcl.tab.c lex.yy.c node.c outgen.c
$(CC) $(LCFLAGS) node.c lex.yy.c hcl.tab.c outgen.c -o hcl2c
hcl2v: hcl.tab.c lex.yy.c node.c outgen.c
$(CC) $(LCFLAGS) -DVLOG node.c lex.yy.c hcl.tab.c outgen.c -o hcl2v
hcl2u: hcl.tab.c lex.yy.c node.c outgen.c
$(CC) $(LCFLAGS) -DUCLID node.c lex.yy.c hcl.tab.c outgen.c -o hcl2u
lex.yy.c: hcl.lex
$(LEX) hcl.lex
hcl.tab.c: hcl.y
$(YACC) -d hcl.y
clean:
rm -f *.o *.yo *.exe yis yas hcl2c mux4 *~ core.*
rm -f hcl.tab.c hcl.tab.h lex.yy.c yas-grammar.c