aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: fe3b4ced6eb113cf1d47fa27bd1920da55b6cf96 (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
25
26
27
28
29
30
CC =		cc
CFLAGS =	-Wall -Wextra -g
LDFLAGS =	-ltls
LEX =		lex
YACC =		yacc

.PHONY: all clean test

all: gmid TAGS README.md

lex.yy.c: lex.l y.tab.c
	${LEX} lex.l

y.tab.c: parse.y
	${YACC} -b y -d parse.y

gmid: gmid.o iri.o utf8.o lex.yy.o y.tab.o
	${CC} gmid.o iri.o utf8.o lex.yy.o y.tab.o -o gmid ${LDFLAGS}

TAGS: gmid.c iri.c utf8.c
	-etags gmid.c iri.c utf8.c || true

clean:
	rm -f *.o lex.yy.c y.tab.c y.tab.h y.output gmid iri_test

iri_test: iri_test.o iri.o utf8.o
	${CC} iri_test.o iri.o utf8.o -o iri_test ${LDFLAGS}

test: iri_test
	./iri_test