Makefile 817 B

12345678910111213141516171819202122232425262728293031323334
  1. SRCS = $(wildcard *.c)
  2. BINS = $(SRCS:.c=) sfntest7
  3. CFLAGS = -ansi -pedantic -Wall -Wextra -I/usr/include/SDL2 -I../ -O3
  4. LIBS = -lSDL2
  5. ifneq ("$(wildcard /usr/include/zlib.h)","")
  6. CFLAGS += -DHAS_ZLIB=1
  7. LIBS += -lz
  8. endif
  9. # workaround a gcc 12 bug: it compains about _ssfn_zexpand, but the checker is just wrong.
  10. # TODO: remove this when gcc gets fixed.
  11. CFLAGS+=-Wno-use-after-free
  12. all: $(BINS) size
  13. testC++: sfntest2.c
  14. g++ $(CFLAGS:-ansi=-std=c++11) $< -o $@ $(LIBS)
  15. sfntest7: sfntest7.cpp
  16. g++ $(CFLAGS:-ansi=-std=c++11) $< -o $@ $(LIBS)
  17. sfntest6: sfntest6.c ../ssfn.h
  18. gcc $(CFLAGS) $< -o $@
  19. valgrind -s --leak-check=full --show-leak-kinds=all ./$@
  20. %: %.c ../ssfn.h
  21. gcc $(CFLAGS) $< -o $@ $(LIBS)
  22. size: sfntest1 sfntest2
  23. @./size.sh
  24. clean:
  25. @rm $(BINS) sfntest7 testC++ *.o buffer.tga 2>/dev/null || true