Makefile modifications

This commit is contained in:
2014-10-02 20:51:43 +02:00
parent 0fd64ff7f6
commit 169bd911fc
3 changed files with 17 additions and 17 deletions

View File

@@ -1,4 +1,3 @@
include ./Makefile.const include ./Makefile.const
.PHONY: all .PHONY: all
@@ -13,30 +12,30 @@ libs: genetics nn
test: all test: all
make -C tests make -C tests
nn: lib/NeuronNetwork.a lib/NeuronNetwork.so nn: | nn_build lib/NeuronNetwork.a lib/NeuronNetwork.so
lib/NeuronNetwork.so: nn_build lib/NeuronNetwork.so: ./src/NeuronNetwork/NeuronNetwork.so
cp ./src/NeuronNetwork/NeuronNetwork.so ./lib/ cp ./src/NeuronNetwork/NeuronNetwork.so ./lib/
lib/NeuronNetwork.a: nn_build lib/NeuronNetwork.a: ./src/NeuronNetwork/NeuronNetwork.a
cp ./src/NeuronNetwork/NeuronNetwork.a ./lib/ cp ./src/NeuronNetwork/NeuronNetwork.a ./lib/
cp ./src/NeuronNetwork/NeuronNetwork.nm ./lib/ cp ./src/NeuronNetwork/NeuronNetwork.nm ./lib/
nn_build: nn_build:
make -C src/NeuronNetwork @make -C src/NeuronNetwork
genetics: lib/Genetics.a lib/Genetics.so genetics: | genetics_build lib/Genetics.a lib/Genetics.so
lib/Genetics.so: genetics_build lib/Genetics.so: ./src/Genetics/Genetics.so
cp ./src/Genetics/Genetics.so ./lib/ cp ./src/Genetics/Genetics.so ./lib/
lib/Genetics.a: genetics_build lib/Genetics.a: ./src/Genetics/Genetics.a
cp ./src/Genetics/Genetics.a ./lib/ cp ./src/Genetics/Genetics.a ./lib/
cp ./src/Genetics/Genetics.nm ./lib/ cp ./src/Genetics/Genetics.nm ./lib/
genetics_build: genetics_build:
make -C src/Genetics @make -C src/Genetics
clean: clean:
@make -C src/Genetics clean @make -C src/Genetics clean

View File

@@ -1,8 +1,7 @@
#include "../src/Network" #include "../src/NeuronNetwork/Network"
#include "../src/Problem"
#include <iostream> #include <iostream>
class X: public S::Problem class X: public Shin::NeuronNetwork::Problem
{ {
protected: protected:
std::vector<bool> representation() const std::vector<bool> representation() const
@@ -13,8 +12,8 @@ class X: public S::Problem
int main() int main()
{ {
S::FeedForwardNetwork n(2,3,2); Shin::NeuronNetwork::FeedForwardNetwork n(2,3,2);
S::Solution s =n.solve(X()); Shin::NeuronNetwork::Solution s =n.solve(X());
if(s.size()!=2) if(s.size()!=2)
{ {
std::cout << "1"; std::cout << "1";

View File

@@ -1,7 +1,9 @@
include ../Makefile.const include ../Makefile.const
LIB_DIR = .. LIB_DIR = ../lib
ALL_TESTS=01 02 03 ALL_TESTS=01 02 03
LIBS=$(LIB_DIR)/Genetics.a $(LIB_DIR)/NeuronNetwork.a
#LIBS=-lGenetics.so -lNeuronNetwork
CXXFLAGS += -I$(LIB_DIR) CXXFLAGS += -I$(LIB_DIR)
@@ -10,8 +12,8 @@ all:| lib $(ALL_TESTS);
test: all test: all
@for i in $(ALL_TESTS); do echo -n ./$$i; echo -n " - "; ./$$i; echo ""; done @for i in $(ALL_TESTS); do echo -n ./$$i; echo -n " - "; ./$$i; echo ""; done
%: %.cpp $(LIB_DIR)/$(LIBNAME).a %: %.cpp $(LIBS)
$(CXX) $(CXXFLAGS) -o $@ $< $ $(LIB_DIR)/$(LIBNAME).a -lm $(CXX) $(CXXFLAGS) -o $@ $< $ $(LIBS) -lm
lib: lib:
make -C ../ make -C ../