Makefile 891 字节
Newer Older
sahduashufa's avatar
0418  
sahduashufa 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
CXX = g++
ODIR = obj
CXXFLAGS = -std=c++11 -O3
OBJS = $(ODIR)/gradient_descent.o $(ODIR)/ann.o $(ODIR)/gradient.o $(ODIR)/speed.o $(ODIR)/simple.o 

all : $(ODIR) $(OBJS) 

$(ODIR)/gradient_descent.o : src/gradient_descent.cpp ../root/include/vectmath.h ../root/include/node.h 
	$(CXX) -c $< -o $@ $(CXXFLAGS)

$(ODIR)/ann.o : src/ann.cpp ../root/include/vectmath.h ../root/include/node.h 
	$(CXX) -c $< -o $@ $(CXXFLAGS)

$(ODIR)/gradient.o : src/gradient.cpp ../root/include/vectmath.h ../root/include/node.h 
	$(CXX) -c $< -o $@ $(CXXFLAGS)

$(ODIR)/speed.o : src/speed.cpp ../root/include/vectmath.h ../root/include/node.h 
	$(CXX) -c $< -o $@ $(CXXFLAGS)

$(ODIR)/simple.o : src/simple.cpp ../root/include/node.h 
	$(CXX) -c $< -o $@ $(CXXFLAGS)

$(ODIR) : 
	if [ ! -d $(ODIR) ]; then mkdir $(ODIR); fi

clean : 
	if [ -d $(ODIR) ]; then rm $(ODIR) -r; fi

.PHONY : all
.PHONY : clean