CXX = g++ -std=c++11 TARGET_DIR = ../lib TARGET = libMESA_handle_logger.so CXXFLAGS = -g -Wall -fPIC -DELPP_THREAD_SAFE LIB = -lpthread INCLUDES = -I./include/ SOURCES = $(wildcard *.c) OBJECTS = $(SOURCES:.c=.o) DEPS = $(SOURCES:.c=.d) .PHONY : clean all install all : $(TARGET) $(TARGET) : $(OBJECTS) $(CXX) $(CXXFLAGS) -shared -o $(TARGET) $(LIB) $(OBJECTS) %.o : %.c $(CXX) $(CXXFLAGS) -c $< -o $@ %.d : %.c $(CXX) $< -MM $(INCLUDES) > $@ -include $(DEPS) clean : -rm $(TARGET) $(OBJECTS) $(DEPS) -rm -f $(TARGET_DIR)/* install : mkdir $(TARGET_DIR) -cp $(TARGET) $(TARGET_DIR) -rm $(TARGET) $(OBJECTS) $(DEPS)