refactored

This commit is contained in:
2014-10-02 19:45:38 +02:00
parent c2ddda35d9
commit 0fd64ff7f6
23 changed files with 221 additions and 123 deletions

View File

@@ -1,29 +1,46 @@
LIBS=input constant element integrator system simulation
OBJFILES=./src/Solution.o ./src/Problem.o ./src/Network.o ./src/Neuron.o ./src/Genetics.o
include ./Makefile.const
.PHONY: all
all: lib
all:|pre libs
pre:
@mkdir -p lib
libs: genetics nn
test: all
make -C tests
lib: $(LIBNAME).a $(LIBNAME).so
nn: lib/NeuronNetwork.a lib/NeuronNetwork.so
lib/NeuronNetwork.so: nn_build
cp ./src/NeuronNetwork/NeuronNetwork.so ./lib/
lib/NeuronNetwork.a: nn_build
cp ./src/NeuronNetwork/NeuronNetwork.a ./lib/
cp ./src/NeuronNetwork/NeuronNetwork.nm ./lib/
nn_build:
make -C src/NeuronNetwork
genetics: lib/Genetics.a lib/Genetics.so
lib/Genetics.so: genetics_build
cp ./src/Genetics/Genetics.so ./lib/
lib/Genetics.a: genetics_build
cp ./src/Genetics/Genetics.a ./lib/
cp ./src/Genetics/Genetics.nm ./lib/
genetics_build:
make -C src/Genetics
clean:
rm -f ./src/*.o
rm -f ./$(LIBNAME).so ./$(LIBNAME).a ./$(LIBNAME).nm
%.o : %.cpp %.h
$(CXX) $(CXXFLAGS) -c $< -o $@
$(LIBNAME).so: $(OBJFILES)
$(CXX) -shared $(CXXFLAGS) $(OBJFILES) -o $(LIBNAME).so
$(LIBNAME).a: $(OBJFILES)
rm -f $(LIBNAME).a # create new library
ar rcv $(LIBNAME).a $(OBJFILES)
ranlib $(LIBNAME).a
nm --demangle $(LIBNAME).a > $(LIBNAME).nm
@make -C src/Genetics clean
@make -C src/NeuronNetwork clean
#@rm -f ./*.so ./*.a ./*.nm
@rm -f ./lib/*.so ./lib/*.a ./lib/*.nm
@echo "Cleaned....."