ThreadPool_pthread/Makefile

27 lines
704 B
Makefile
Raw Permalink Normal View History

2017-01-15 10:16:00 +00:00
CXX = g++
INC_DIR = include
OBJ_DIR = object
SRC_DIR = src
EXE_DIR = bin
CFLAGS = -O3 -ffast-math -std=c++98 -pedantic -pthread
TEST_FILE = $(EXE_DIR)/SumNums
TARGET = $(EXE_DIR)/SumNums
MKDIR_P = mkdir -p
SRC = $(SRC_DIR)/ThreadPool_pthread.cpp $(SRC_DIR)/LockGuard_pthread.cpp examples/sumnums.cpp
OBJ = $(OBJ_DIR)/ThreadPool_pthread.o $(OBJ_DIR)/LockGuard_pthread.o $(OBJ_DIR)/sumnums.o
DEP = $(INC_DIR)/ThreadPool_pthread.h $(INC_DIR)/LockGuard_pthread.h
all: $(TARGET)
$(OBJ): $(SRC) $(DEP)
$(MKDIR_P) $(@D)
$(CXX) $(CFLAGS) -I$(INC_DIR) -c $< -o $@
$(TARGET): $(OBJ) $(DEP)
$(MKDIR_P) $(@D)
$(CXX) $(CFLAGS) -o $@ $(SRC) -I$(INC_DIR)
clean:
$(RM) $(OBJ_DIR)/*.o $(TARGET) $(TEST_FILE)