Makefile 745 B

123456789101112131415161718192021222324252627282930
  1. # set compiler if unset from outside
  2. CC ?= gcc
  3. CFLAGS = -Wall -Wno-unknown-pragmas -Werror -g3 -O0 -std=c99 -D DEBUG=1 -I /usr/include -I /usr/include/raptor2 -I /usr/include/rasqal
  4. BUILD = build
  5. TMP = tmp
  6. TESTS_C := $(wildcard test-*.c)
  7. TESTS_O := $(patsubst %.c,$(BUILD)/%.o,$(TESTS_C))
  8. TESTS := $(patsubst %.o,%,$(TESTS_O))
  9. test: $(TESTS)
  10. clean:
  11. -rm $(BUILD)/* $(TMP)/*
  12. # compile librdf.sqlite
  13. $(BUILD)/rdf_storage_sqlite_mro.o: ../rdf_storage_sqlite_mro.c
  14. $(CC) $(CFLAGS) -c -o $@ $<
  15. # compile a single test
  16. $(BUILD)/test-%.o: test-%.c
  17. $(CC) $(CFLAGS) -c -o $@ $<
  18. # link + run a single test
  19. $(BUILD)/test-%: $(BUILD)/test-%.o $(BUILD)/rdf_storage_sqlite_mro.o
  20. $(CC) -g3 -o $@ $? -lrdf -lsqlite3
  21. $@