summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsa89 <ansalonistefano@gmail.com>2016-05-03 13:17:05 +0200
committerAnsa89 <ansalonistefano@gmail.com>2016-05-03 13:17:05 +0200
commitdb012b1311c5ca46d5784376ad0c05b5c241f817 (patch)
treef37107e971af965fcd1e6a6621780a490695ea89
parent91d9ad27d4a7ca77c615bcf9d928f11b9d3b3c77 (diff)
Makefile: update static build
-rw-r--r--.travis.yml2
-rw-r--r--Makefile20
2 files changed, 5 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml
index 084961c..0aedc45 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,7 +26,7 @@ before_script:
26 - sudo ldconfig 26 - sudo ldconfig
27 27
28script: 28script:
29 - make tuntox_static TOXCORE_STATIC_LIB=/usr/local/lib/libtoxcore.a SODIUM_STATIC_LIB=/usr/local/lib/libsodium.a 29 - make tuntox_static
30 - make cscope.out 30 - make cscope.out
31 31
32env: 32env:
diff --git a/Makefile b/Makefile
index 0a972c9..32aadd2 100644
--- a/Makefile
+++ b/Makefile
@@ -3,21 +3,9 @@ INCLUDES = $(wildcard *.h) gitversion.h
3OBJECTS = $(SOURCES:.c=.o) 3OBJECTS = $(SOURCES:.c=.o)
4DEPS = libtoxcore 4DEPS = libtoxcore
5 5
6CFLAGS = $(shell pkg-config --cflags $(DEPS)) 6CFLAGS += $(shell pkg-config --cflags $(DEPS))
7LDFLAGS = $(shell pkg-config --libs $(DEPS)) 7LDFLAGS += $(shell pkg-config --libs $(DEPS))
8LDFLAGS_STATIC = -static -pthread 8LDFLAGS_STATIC += -static -pthread -Wl,-Bstatic $(LDFLAGS)
9
10
11# Check on what platform we are running
12UNAME_M = $(shell uname -m)
13ifeq ($(UNAME_M), x86_64)
14 TOXCORE_STATIC_LIB = /usr/local/lib64/libtoxcore.a
15 SODIUM_STATIC_LIB = /usr/local/lib64/libsodium.a
16endif
17ifneq ($(filter %86, $(UNAME_M)),)
18 TOXCORE_STATIC_LIB = /usr/local/lib/libtoxcore.a
19 SODIUM_STATIC_LIB = /usr/local/lib/libsodium.a
20endif
21 9
22 10
23# Targets 11# Targets
@@ -37,7 +25,7 @@ tuntox: $(OBJECTS) $(INCLUDES)
37 25
38tuntox_static: $(OBJECTS) $(INCLUDES) 26tuntox_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
42cscope.out: 30cscope.out:
43 @echo " GEN $@" 31 @echo " GEN $@"