TESTS = test_nfa test_regex test_pcre test_hammer
APPS = simcard
OBJS = nfa.o

.PHONY: all clean benchmark
all: ${OBJS} ${TESTS} ${APPS}
clean:
	rm -f ${OBJS} ${TESTS} ${APPS}
benchmark: ${TESTS}
	./test_nfa -b
	./test_regex -b
	./test_pcre -b
	./test_hammer -b

test_nfa: test_nfa.c nfa.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< nfa.o

test_pcre: test_pcre.c
	$(CC) $(CFLAGS) -I/usr/local/include $(LDFLAGS) -o $@ $< \
	    -lpcreposix -lpcre

test_hammer: test_hammer.c
	$(CC) $(CFLAGS) -I/usr/local/include $(LDFLAGS) -o $@ $< \
	    -lhammer

simcard: $(OBJS) simcard.c
	$(CC) $(CFLAGS) -o $@ $(OBJS) $<
