Makefile modifications
This commit is contained in:
17
Makefile
17
Makefile
@@ -1,4 +1,3 @@
|
||||
|
||||
include ./Makefile.const
|
||||
|
||||
.PHONY: all
|
||||
@@ -13,30 +12,30 @@ libs: genetics nn
|
||||
test: all
|
||||
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/
|
||||
|
||||
lib/NeuronNetwork.a: nn_build
|
||||
lib/NeuronNetwork.a: ./src/NeuronNetwork/NeuronNetwork.a
|
||||
cp ./src/NeuronNetwork/NeuronNetwork.a ./lib/
|
||||
cp ./src/NeuronNetwork/NeuronNetwork.nm ./lib/
|
||||
|
||||
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/
|
||||
|
||||
lib/Genetics.a: genetics_build
|
||||
lib/Genetics.a: ./src/Genetics/Genetics.a
|
||||
cp ./src/Genetics/Genetics.a ./lib/
|
||||
cp ./src/Genetics/Genetics.nm ./lib/
|
||||
|
||||
genetics_build:
|
||||
make -C src/Genetics
|
||||
@make -C src/Genetics
|
||||
|
||||
clean:
|
||||
@make -C src/Genetics clean
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "../src/Network"
|
||||
#include "../src/Problem"
|
||||
#include "../src/NeuronNetwork/Network"
|
||||
|
||||
#include <iostream>
|
||||
class X: public S::Problem
|
||||
class X: public Shin::NeuronNetwork::Problem
|
||||
{
|
||||
protected:
|
||||
std::vector<bool> representation() const
|
||||
@@ -13,8 +12,8 @@ class X: public S::Problem
|
||||
|
||||
int main()
|
||||
{
|
||||
S::FeedForwardNetwork n(2,3,2);
|
||||
S::Solution s =n.solve(X());
|
||||
Shin::NeuronNetwork::FeedForwardNetwork n(2,3,2);
|
||||
Shin::NeuronNetwork::Solution s =n.solve(X());
|
||||
if(s.size()!=2)
|
||||
{
|
||||
std::cout << "1";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
include ../Makefile.const
|
||||
|
||||
LIB_DIR = ..
|
||||
LIB_DIR = ../lib
|
||||
ALL_TESTS=01 02 03
|
||||
LIBS=$(LIB_DIR)/Genetics.a $(LIB_DIR)/NeuronNetwork.a
|
||||
#LIBS=-lGenetics.so -lNeuronNetwork
|
||||
|
||||
CXXFLAGS += -I$(LIB_DIR)
|
||||
|
||||
@@ -10,8 +12,8 @@ all:| lib $(ALL_TESTS);
|
||||
test: all
|
||||
@for i in $(ALL_TESTS); do echo -n ./$$i; echo -n " - "; ./$$i; echo ""; done
|
||||
|
||||
%: %.cpp $(LIB_DIR)/$(LIBNAME).a
|
||||
$(CXX) $(CXXFLAGS) -o $@ $< $ $(LIB_DIR)/$(LIBNAME).a -lm
|
||||
%: %.cpp $(LIBS)
|
||||
$(CXX) $(CXXFLAGS) -o $@ $< $ $(LIBS) -lm
|
||||
|
||||
lib:
|
||||
make -C ../
|
||||
Reference in New Issue
Block a user