CSPATH = ./src BINPATH = ./bin LIBPATH = ./lib # the source files sources = solution2.cc main.cc # objects are the same as the source files with .cc replaced with .o objects = solution2.o main.o # headers files headers = solution2.h AR = ar ARFLAGS = rvs CC = gcc CLINKER = gcc CXX = g++ CXXFLAGS = -O CCFLAGS = -O LIB_DIRS = LIBS = -lm -lpthread #-lefence default: all # make all will run commands regardless of whether there is a file "all" all: phils phils: $(objects) $(headers) $(CXX) $(OPTFLAGS) -o phils $(objects) $(LIB_DIRS) $(LIBS) # make clean will run commands regardless of whether there is a file "clean" clean: rm -rf *.o rm -f phils lib/%.o : %.c $(CC) $(CCFLAGS) $(CFLAGS) -c $< $(OUTPUT_OPTION) lib/%.o : %.cpp $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDE_DIRS) $(TARGET_ARCH) -c $< -o lib/%.o : %.cc $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDE_DIRS) $(TARGET_ARCH) -c $< -o $@ run: phils