diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -3,21 +3,9 @@ INCLUDES = $(wildcard *.h) gitversion.h | |||
3 | OBJECTS = $(SOURCES:.c=.o) | 3 | OBJECTS = $(SOURCES:.c=.o) |
4 | DEPS = libtoxcore | 4 | DEPS = libtoxcore |
5 | 5 | ||
6 | CFLAGS = $(shell pkg-config --cflags $(DEPS)) | 6 | CFLAGS += $(shell pkg-config --cflags $(DEPS)) |
7 | LDFLAGS = $(shell pkg-config --libs $(DEPS)) | 7 | LDFLAGS += $(shell pkg-config --libs $(DEPS)) |
8 | LDFLAGS_STATIC = -static -pthread | 8 | LDFLAGS_STATIC += -static -pthread -Wl,-Bstatic $(LDFLAGS) |
9 | |||
10 | |||
11 | # Check on what platform we are running | ||
12 | UNAME_M = $(shell uname -m) | ||
13 | ifeq ($(UNAME_M), x86_64) | ||
14 | TOXCORE_STATIC_LIB = /usr/local/lib64/libtoxcore.a | ||
15 | SODIUM_STATIC_LIB = /usr/local/lib64/libsodium.a | ||
16 | endif | ||
17 | ifneq ($(filter %86, $(UNAME_M)),) | ||
18 | TOXCORE_STATIC_LIB = /usr/local/lib/libtoxcore.a | ||
19 | SODIUM_STATIC_LIB = /usr/local/lib/libsodium.a | ||
20 | endif | ||
21 | 9 | ||
22 | 10 | ||
23 | # Targets | 11 | # Targets |
@@ -37,7 +25,7 @@ tuntox: $(OBJECTS) $(INCLUDES) | |||
37 | 25 | ||
38 | tuntox_static: $(OBJECTS) $(INCLUDES) | 26 | tuntox_static: $(OBJECTS) $(INCLUDES) |
39 | @echo " LD tuntox" | 27 | @echo " LD tuntox" |
40 | @$(CC) $(LDFLAGS_STATIC) $(OBJECTS) -o tuntox $(TOXCORE_STATIC_LIB) $(SODIUM_STATIC_LIB) | 28 | @$(CC) $(OBJECTS) $(LDFLAGS_STATIC) -o tuntox |
41 | 29 | ||
42 | cscope.out: | 30 | cscope.out: |
43 | @echo " GEN $@" | 31 | @echo " GEN $@" |