summaryrefslogtreecommitdiff
path: root/Makefile.mac
diff options
context:
space:
mode:
authorGDR! <gdr@gdr.name>2015-09-17 10:30:10 +0200
committerGDR! <gdr@gdr.name>2015-09-17 10:30:10 +0200
commitba90921d46f3bfffbb87f4b271ba0276b113dc2f (patch)
tree697d87f921bc0fddd54ee3a27b3cb65c13e302cb /Makefile.mac
parent83790e5faf3de5ddb447e29ebe3490bdc30b1624 (diff)
parent199787953243d91449ac5f4a5ac16edc2497e438 (diff)
Merge pull request #15 from nCore/mac
Possibility to compile on Mac OS platform
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