diff --git a/Makefile b/Makefile index 3f7c5ba..5465144 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,14 @@ -CC=tcc +CC=gcc all: tests -run: shortcodes - ./shortcodes shortcodes.c: shortcodes.rl ragel -G2 shortcodes.rl -o shortcodes.c -shortcodes: shortcodes.c - $(CC) shortcodes.c -g -o shortcodes -tests: shortcodes.c shortcodes.h tests.c - $(CC) tests.c shortcodes.c -lbg -lcgreen -g -o tests -test: tests - ./tests +%.o: %.c + $(CC) -fPIC -c -o $@ $^ +tests.so: shortcodes.o tests.o + $(CC) -shared -o $@ $^ -lbg -lcgreen +test: tests.so + cgreen-runner $^ clean: - rm -f shortcodes shortcodes.c + rm -f shortcodes.c *.o *.so -.PHONY: test run +.PHONY: test