diff options
author | Luca <deri@ntop.org> | 2018-08-30 09:59:39 +0200 |
---|---|---|
committer | Luca <deri@ntop.org> | 2018-08-30 09:59:39 +0200 |
commit | f948f3525fddaae23eef0b88680e2c4e17c050ae (patch) | |
tree | 61b5d2680d4b4442dd02267c8820f2e9322d54c1 | |
parent | a98c0a81be86936e96be7d2312ae11ef85b785b2 (diff) |
Cleaned up makefile
Used clang instead of gcc on MacOS
-rw-r--r-- | example/Makefile.am | 12 | ||||
-rw-r--r-- | src/lib/Makefile.in | 14 |
2 files changed, 10 insertions, 16 deletions
diff --git a/example/Makefile.am b/example/Makefile.am deleted file mode 100644 index e50d8c05c..000000000 --- a/example/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -bin_PROGRAMS = ndpiReader - -AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/lib/third_party/include @PCAP_INC@ @HS_INC@ -AM_CFLAGS = @PTHREAD_CFLAGS@ # --coverage - -LDADD = $(top_builddir)/src/lib/libndpi.a @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@ @DL_LIB@ @HS_LIB@ -lm -AM_LDFLAGS = -static @DL_LIB@ @HS_LIB@ - -ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h uthash.h - -ndpiReader.o: ndpiReader.c - 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 |