Makefile 625 B

123456789101112131415161718192021222324
  1. SOURCES = $(wildcard *.c)
  2. DEPS=libtoxcore
  3. CC=gcc
  4. CFLAGS=-g #-std=c99
  5. CFLAGS += $(shell pkg-config --cflags $(DEPS))
  6. LDFLAGS=-g -pthread -lm -static -lrt
  7. LDFLAGS += $(shell pkg-config --libs $(DEPS))
  8. OBJECTS=$(SOURCES:.c=.o)
  9. INCLUDES = $(wildcard *.h)
  10. .c.o: $(INCLUDES)
  11. $(CC) $(CFLAGS) $< -c -o $@
  12. tuntox: $(OBJECTS) $(INCLUDES)
  13. $(CC) -o $@ $(OBJECTS) -ltoxcore -lpthread $(LDFLAGS) /usr/local/lib/libsodium.a /usr/local/lib/libtoxcore.a
  14. cscope.out:
  15. cscope -bv ./*.[ch]
  16. #gitversion.c: .git/HEAD .git/index
  17. # echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
  18. all: cscope.out tuntox gitversion.c