Cleaned up makefile

Used clang instead of gcc on MacOS
This commit is contained in:
Luca 2018-08-30 09:59:39 +02:00
parent a98c0a81be
commit f948f3525f
2 changed files with 10 additions and 16 deletions

View file

@ -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