From f948f3525fddaae23eef0b88680e2c4e17c050ae Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 30 Aug 2018 09:59:39 +0200 Subject: Cleaned up makefile Used clang instead of gcc on MacOS --- src/lib/Makefile.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/lib/Makefile.in') 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 -- cgit v1.2.3