summaryrefslogtreecommitdiff
path: root/compiler/Makefile
blob: 9645dda60a3edc2fde4cd8dcf1fe15f8112f6919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
binary = ex-spec-compiler
sources =	ex-parser.c ex-scanner.c ex-ast.c ex-util.c ex-main.c	\
		ex-pretty.c ex-weed.c ex-gather-symbols.c		\
		ex-pass.c
headers = ex-parser.h ex-compiler.h

CFLAGS = -Wall -W -ansi -pedantic -g

$(binary): $(sources) $(headers)
	gcc $(CFLAGS) $(sources) -o$(binary) -lfl

YFLAGS = -d -v -t

ex-parser.c ex-parser.h: ex-spec.y
	$(YACC) $(YFLAGS) ex-spec.y && mv y.tab.h ex-parser.h && mv y.tab.c ex-parser.c

ex-scanner.c: ex-spec.lex
	$(LEX) ex-spec.lex && mv lex.yy.c ex-scanner.c

CLEANFILES += $(BUILT_SOURCES) bison.stamp $(binary) *.o ex-parser.c ex-scanner.c y.output *~
compiler: xspec.y xspec.lex

clean: 
	rm -f $(CLEANFILES)