aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Makefile.in
diff options
context:
space:
mode:
authorLuca <deri@ntop.org>2018-08-30 09:59:39 +0200
committerLuca <deri@ntop.org>2018-08-30 09:59:39 +0200
commitf948f3525fddaae23eef0b88680e2c4e17c050ae (patch)
tree61b5d2680d4b4442dd02267c8820f2e9322d54c1 /src/lib/Makefile.in
parenta98c0a81be86936e96be7d2312ae11ef85b785b2 (diff)
Cleaned up makefile
Used clang instead of gcc on MacOS
Diffstat (limited to 'src/lib/Makefile.in')
-rw-r--r--src/lib/Makefile.in14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 1bbc4095e..62f1b12a2 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -6,15 +6,17 @@
# make Makefile
#
+OS := $(shell uname -s)
+
#
# Installation directories
#
prefix = /usr/local
libdir = ${prefix}/lib
includedir = ${prefix}/include/ndpi
-
-CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -g
-RANLIB = ranlib
+CC = gcc
+CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -g
+RANLIB = ranlib
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
HEADERS = $(wildcard ../include/*.h)
@@ -23,6 +25,10 @@ NDPI_LIB_SHARED_BASE = libndpi.so
NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@
NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
+ifeq ($(OS),Darwin)
+CC=clang
+endif
+
all: $(NDPI_LIBS)
ndpi_main.c: ndpi_content_match.c.inc
@@ -32,7 +38,7 @@ $(NDPI_LIB_STATIC): $(OBJECTS)
$(RANLIB) $@
$(NDPI_LIB_SHARED): $(OBJECTS)
- gcc -shared -fPIC -o $@ $(OBJECTS)
+ $(CC) -shared -fPIC -o $@ $(OBJECTS)
ln -Fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
%.o: %.c $(HEADERS) Makefile