1
0

Makefile 918 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. CC = gcc
  2. LD = gcc
  3. CFLAGS := ${CFLAGS} -Wall -Werror -I"$(CURDIR)"
  4. CFLAGS += $(shell gpgme-config --cflags)
  5. CFLAGS += $(shell pkg-config fuse3 --cflags)
  6. LIBS += $(shell gpgme-config --libs)
  7. LIBS += $(shell pkg-config fuse3 --libs)
  8. .PHONY = default format
  9. default : rgpgfs
  10. src/fs.o : src/fs.c src/fs.h
  11. $(CC) $(CFLAGS) -c $< -o $@
  12. src/gpgme.o : src/gpgme.c src/gpgme.h
  13. $(CC) $(CFLAGS) -c $< -o $@
  14. src/main.o : src/main.c src/fs.h src/gpgme.h src/str.h
  15. $(CC) $(CFLAGS) -c $< -o $@
  16. src/str.o : src/str.c src/str.h
  17. $(CC) $(CFLAGS) -c $< -o $@
  18. rgpgfs : src/fs.o src/gpgme.o src/main.o src/str.o
  19. $(LD) $^ -o $@ $(LIBS)
  20. tests/fs.o : tests/fs.c src/fs.h
  21. $(CC) $(CFLAGS) -c $< -o $@
  22. tests/fs : tests/fs.o src/fs.o
  23. $(LD) $^ -o $@
  24. tests/str.o : tests/str.c src/str.h
  25. $(CC) $(CFLAGS) -c $< -o $@
  26. tests/str : tests/str.o src/str.o
  27. $(LD) $^ -o $@
  28. format : src/*.h src/*.c tests/*.c
  29. clang-format -i -verbose $^