Newer
Older
test_yacc_lex / Makefile
@ApricotSavor ApricotSavor on 13 Jan 2017 329 bytes adder test
CC=gcc
YACC=yacc
LEX=lex
name=testl0
lexf=$(name).l
yaccf=$(name).y

yacco=y.tab.h y.tab.c y.output
lexo=lex.yy.c
objs=$(yacco) $(lexo)

$(name): $(filter %.c, $(objs)) node.o
	$(CC) -o $@ $^

$(yacco):
	$(YACC) -dv $(yaccf)

$(lexo):
	$(LEX) $(lexf)

node.o: node.c
	gcc -c $^ -o $@

.PHONY: clean
clean:
	rm -f $(objs) $(name)