summaryrefslogtreecommitdiff
path: root/Makefile.mac
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.mac')
-rw-r--r--Makefile.mac28
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 @@
1SOURCES = $(wildcard *.c)
2DEPS=libtoxcore
3CC=gcc
4CFLAGS=-g #-std=c99
5CFLAGS += $(shell pkg-config --cflags $(DEPS))
6LDFLAGS=-g -lm
7LDFLAGS += $(shell pkg-config --libs $(DEPS))
8OBJECTS=$(SOURCES:.c=.o)
9INCLUDES = $(wildcard *.h)
10
11all: cscope.out tuntox
12
13gitversion.h: .git/HEAD .git/index
14 echo "#define GITVERSION \"$(shell git rev-parse HEAD)\"" > $@
15
16gitversion.c: gitversion.h
17
18.c.o: $(INCLUDES)
19 $(CC) $(CFLAGS) $< -c -o $@
20
21tuntox: $(OBJECTS) $(INCLUDES)
22 $(CC) -o $@ $(OBJECTS) -ltoxcore $(LDFLAGS) /usr/local/lib/libsodium.a /usr/local/lib/libtoxcore.a
23
24cscope.out:
25 cscope -bv ./*.[ch]
26
27clean:
28 rm -rf *.o tuntox gitversion.h