CC = gcc
C++ = g++
LINK = g++
INCLUDES = -L. -Iinclude
LIBS = -lz -lm -lpcre -L. libsqlite3_x86_64.a
CCFLAGS = $(COMPILER_FLAGS) --std=c99 -c -g -fPIC -MMD -MP $(DEFINES) -lpthread
C++FLAGS = $(COMPILER_FLAGS) -std=c++11 -c -g -fPIC -O2 -W -Wall -lpthread
#CCFLAGS = $(COMPILER_FLAGS) --std=c99 -c -g -MMD -MP $(DEFINES) -pthread -ldl
#C++FLAGS = $(COMPILER_FLAGS) -std=c++11 -c -g -fPIC -O2 -W -Wall -pthread -ldl
TARGET=libme.so
CFILES = cJSON.c
C++FILES = a.cpp b.cpp c.cpp d.cpp e.cpp
OBJFILE = $(CFILES:.c=.o) $(C++FILES:.cpp=.o)
all:$(TARGET)
$(TARGET): $(OBJFILE)
$(LINK) $^ $(LIBS) -fpermissive -fvisibility=hidden -Wl,-rpath,$ORIGIN -Wl,-Bsymbolic -fPIC -shared -o $@
#$(LINK) $^ -Wall -o $@ -ldl -pthread
%.o:%.c
$(CC) $(CCFLAGS) $(INCLUDES) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
%.o:%.cpp
$(C++) -o $@ $(C++FLAGS) $< $(INCLUDES)
install:
tsxs -i -o $(TARGET)
clean:
rm -rf $(TARGET)
rm -rf $(OBJFILE)