diff options
Diffstat (limited to 'Makefile.mac')
-rw-r--r-- | Makefile.mac | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile.mac b/Makefile.mac new file mode 100644 index 0000000..ee41cda --- /dev/null +++ b/Makefile.mac | |||
@@ -0,0 +1,28 @@ | |||
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 -lm | ||
7 | LDFLAGS += $(shell pkg-config --libs $(DEPS)) | ||
8 | OBJECTS=$(SOURCES:.c=.o) | ||
9 | INCLUDES = $(wildcard *.h) | ||
10 | |||
11 | all: cscope.out tuntox | ||
12 | |||
13 | gitversion.h: .git/HEAD .git/index | ||
14 | echo "#define GITVERSION \"$(shell git rev-parse HEAD)\"" > $@ | ||
15 | |||
16 | gitversion.c: gitversion.h | ||
17 | |||
18 | .c.o: $(INCLUDES) | ||
19 | $(CC) $(CFLAGS) $< -c -o $@ | ||
20 | |||
21 | tuntox: $(OBJECTS) $(INCLUDES) | ||
22 | $(CC) -o $@ $(OBJECTS) -ltoxcore $(LDFLAGS) /usr/local/lib/libsodium.a /usr/local/lib/libtoxcore.a | ||
23 | |||
24 | cscope.out: | ||
25 | cscope -bv ./*.[ch] | ||
26 | |||
27 | clean: | ||
28 | rm -rf *.o tuntox gitversion.h | ||