#
#
#

VERSION="2.0.3"

TARGETS=liblpmd.dylib lpmd_headers config.h liblpmd-2.0.pc



all: subdirs $(TARGETS)


Makefile: packagesetup
	./setup 



subdirs:
	cd lpunit && $(MAKE)
	cd demos && $(MAKE)
	cd tests && $(MAKE)
	cd benchmarks && $(MAKE)

install: subdirs-install $(TARGETS)
	ginstall -v -d /usr/local/lib
	ginstall -v -d /usr/local/include/lpmd
	ginstall -v -d /usr/local/lib/pkgconfig

	ginstall -v -D liblpmd.2.0.1.dylib /usr/local/lib
	cp -a liblpmd.dylib /usr/local/lib
	cp -a liblpmd.2.dylib /usr/local/lib
	ginstall -v -D lpmd/atom.h /usr/local/include/lpmd
	ginstall -v -D lpmd/array.h /usr/local/include/lpmd
	ginstall -v -D lpmd/basicatom.h /usr/local/include/lpmd
	ginstall -v -D lpmd/basiccell.h /usr/local/include/lpmd
	ginstall -v -D lpmd/basicparticleset.h /usr/local/include/lpmd
	ginstall -v -D lpmd/region.h /usr/local/include/lpmd
	ginstall -v -D lpmd/selector.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cell.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cellformat.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cellgenerator.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cellmanager.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cellreader.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cellwriter.h /usr/local/include/lpmd
	ginstall -v -D lpmd/cmdline.h /usr/local/include/lpmd
	ginstall -v -D lpmd/color.h /usr/local/include/lpmd
	ginstall -v -D lpmd/storedvalue.h /usr/local/include/lpmd
	ginstall -v -D lpmd/elements.h /usr/local/include/lpmd
	ginstall -v -D lpmd/error.h /usr/local/include/lpmd
	ginstall -v -D lpmd/properties.h /usr/local/include/lpmd
	ginstall -v -D lpmd/orthogonalcell.h /usr/local/include/lpmd
	ginstall -v -D lpmd/atomselector.h /usr/local/include/lpmd
	ginstall -v -D lpmd/nonorthogonalcell.h /usr/local/include/lpmd
	ginstall -v -D lpmd/indirectatom.h /usr/local/include/lpmd
	ginstall -v -D lpmd/controlfile.h /usr/local/include/lpmd
	ginstall -v -D lpmd/property.h /usr/local/include/lpmd
	ginstall -v -D lpmd/combinedpotential.h /usr/local/include/lpmd
	ginstall -v -D lpmd/map.h /usr/local/include/lpmd
	ginstall -v -D lpmd/matrix.h /usr/local/include/lpmd
	ginstall -v -D lpmd/fixedsizeparticleset.h /usr/local/include/lpmd
	ginstall -v -D lpmd/twostepintegrator.h /usr/local/include/lpmd
	ginstall -v -D lpmd/simulationhistory.h /usr/local/include/lpmd
	ginstall -v -D lpmd/refparticleset.h /usr/local/include/lpmd
	ginstall -v -D lpmd/stepper.h /usr/local/include/lpmd
	ginstall -v -D lpmd/metalpotential.h /usr/local/include/lpmd
	ginstall -v -D lpmd/module.h /usr/local/include/lpmd
	ginstall -v -D lpmd/paramlist.h /usr/local/include/lpmd
	ginstall -v -D lpmd/solver.h /usr/local/include/lpmd
	ginstall -v -D lpmd/storedconfiguration.h /usr/local/include/lpmd
	ginstall -v -D lpmd/particleset.h /usr/local/include/lpmd
	ginstall -v -D lpmd/plugin.h /usr/local/include/lpmd
	ginstall -v -D lpmd/pluginmanager.h /usr/local/include/lpmd
	ginstall -v -D lpmd/potential.h /usr/local/include/lpmd
	ginstall -v -D lpmd/pairpotential.h /usr/local/include/lpmd
	ginstall -v -D lpmd/session.h /usr/local/include/lpmd
	ginstall -v -D lpmd/systemfilter.h /usr/local/include/lpmd
	ginstall -v -D lpmd/configuration.h /usr/local/include/lpmd
	ginstall -v -D lpmd/simulation.h /usr/local/include/lpmd
	ginstall -v -D lpmd/integrator.h /usr/local/include/lpmd
	ginstall -v -D lpmd/onestepintegrator.h /usr/local/include/lpmd
	ginstall -v -D lpmd/manipulations.h /usr/local/include/lpmd
	ginstall -v -D lpmd/moduleinfo.h /usr/local/include/lpmd
	ginstall -v -D lpmd/systemmixer.h /usr/local/include/lpmd
	ginstall -v -D lpmd/systemmodifier.h /usr/local/include/lpmd
	ginstall -v -D lpmd/task.h /usr/local/include/lpmd
	ginstall -v -D lpmd/taskrunner.h /usr/local/include/lpmd
	ginstall -v -D lpmd/timer.h /usr/local/include/lpmd
	ginstall -v -D lpmd/simulationbuilder.h /usr/local/include/lpmd
	ginstall -v -D lpmd/util.h /usr/local/include/lpmd
	ginstall -v -D lpmd/vector.h /usr/local/include/lpmd
	ginstall -v -D lpmd/value.h /usr/local/include/lpmd
	ginstall -v -D lpmd/visualizer.h /usr/local/include/lpmd
	ginstall -v -D lpmd/atompair.h /usr/local/include/lpmd
	ginstall -v -D lpmd/taghandler.h /usr/local/include/lpmd
	ginstall -v -D lpmd/api.h /usr/local/include/lpmd
	ginstall -v -D lpmd/parameter.h /usr/local/include/lpmd
	ginstall -v -D lpmd/configurationset.h /usr/local/include/lpmd
	ginstall -v -D lpmd/filtrableconfiguration.h /usr/local/include/lpmd
	ginstall -v -D lpmd/colorhandler.h /usr/local/include/lpmd
	ginstall -v -D liblpmd-2.0.pc /usr/local/lib/pkgconfig


uninstall: subdirs-uninstall
	rm -vf /usr/local/lib/liblpmd.2.0.1.dylib
	rm -vf /usr/local/lib/liblpmd.dylib
	rm -vf /usr/local/lib/liblpmd.2.dylib
	rm -vf /usr/local/include/lpmd/lpmd/atom.h
	rm -vf /usr/local/include/lpmd/lpmd/array.h
	rm -vf /usr/local/include/lpmd/lpmd/basicatom.h
	rm -vf /usr/local/include/lpmd/lpmd/basiccell.h
	rm -vf /usr/local/include/lpmd/lpmd/basicparticleset.h
	rm -vf /usr/local/include/lpmd/lpmd/region.h
	rm -vf /usr/local/include/lpmd/lpmd/selector.h
	rm -vf /usr/local/include/lpmd/lpmd/cell.h
	rm -vf /usr/local/include/lpmd/lpmd/cellformat.h
	rm -vf /usr/local/include/lpmd/lpmd/cellgenerator.h
	rm -vf /usr/local/include/lpmd/lpmd/cellmanager.h
	rm -vf /usr/local/include/lpmd/lpmd/cellreader.h
	rm -vf /usr/local/include/lpmd/lpmd/cellwriter.h
	rm -vf /usr/local/include/lpmd/lpmd/cmdline.h
	rm -vf /usr/local/include/lpmd/lpmd/color.h
	rm -vf /usr/local/include/lpmd/lpmd/storedvalue.h
	rm -vf /usr/local/include/lpmd/lpmd/elements.h
	rm -vf /usr/local/include/lpmd/lpmd/error.h
	rm -vf /usr/local/include/lpmd/lpmd/properties.h
	rm -vf /usr/local/include/lpmd/lpmd/orthogonalcell.h
	rm -vf /usr/local/include/lpmd/lpmd/atomselector.h
	rm -vf /usr/local/include/lpmd/lpmd/nonorthogonalcell.h
	rm -vf /usr/local/include/lpmd/lpmd/indirectatom.h
	rm -vf /usr/local/include/lpmd/lpmd/controlfile.h
	rm -vf /usr/local/include/lpmd/lpmd/property.h
	rm -vf /usr/local/include/lpmd/lpmd/combinedpotential.h
	rm -vf /usr/local/include/lpmd/lpmd/map.h
	rm -vf /usr/local/include/lpmd/lpmd/matrix.h
	rm -vf /usr/local/include/lpmd/lpmd/fixedsizeparticleset.h
	rm -vf /usr/local/include/lpmd/lpmd/twostepintegrator.h
	rm -vf /usr/local/include/lpmd/lpmd/simulationhistory.h
	rm -vf /usr/local/include/lpmd/lpmd/refparticleset.h
	rm -vf /usr/local/include/lpmd/lpmd/stepper.h
	rm -vf /usr/local/include/lpmd/lpmd/metalpotential.h
	rm -vf /usr/local/include/lpmd/lpmd/module.h
	rm -vf /usr/local/include/lpmd/lpmd/paramlist.h
	rm -vf /usr/local/include/lpmd/lpmd/solver.h
	rm -vf /usr/local/include/lpmd/lpmd/storedconfiguration.h
	rm -vf /usr/local/include/lpmd/lpmd/particleset.h
	rm -vf /usr/local/include/lpmd/lpmd/plugin.h
	rm -vf /usr/local/include/lpmd/lpmd/pluginmanager.h
	rm -vf /usr/local/include/lpmd/lpmd/potential.h
	rm -vf /usr/local/include/lpmd/lpmd/pairpotential.h
	rm -vf /usr/local/include/lpmd/lpmd/session.h
	rm -vf /usr/local/include/lpmd/lpmd/systemfilter.h
	rm -vf /usr/local/include/lpmd/lpmd/configuration.h
	rm -vf /usr/local/include/lpmd/lpmd/simulation.h
	rm -vf /usr/local/include/lpmd/lpmd/integrator.h
	rm -vf /usr/local/include/lpmd/lpmd/onestepintegrator.h
	rm -vf /usr/local/include/lpmd/lpmd/manipulations.h
	rm -vf /usr/local/include/lpmd/lpmd/moduleinfo.h
	rm -vf /usr/local/include/lpmd/lpmd/systemmixer.h
	rm -vf /usr/local/include/lpmd/lpmd/systemmodifier.h
	rm -vf /usr/local/include/lpmd/lpmd/task.h
	rm -vf /usr/local/include/lpmd/lpmd/taskrunner.h
	rm -vf /usr/local/include/lpmd/lpmd/timer.h
	rm -vf /usr/local/include/lpmd/lpmd/simulationbuilder.h
	rm -vf /usr/local/include/lpmd/lpmd/util.h
	rm -vf /usr/local/include/lpmd/lpmd/vector.h
	rm -vf /usr/local/include/lpmd/lpmd/value.h
	rm -vf /usr/local/include/lpmd/lpmd/visualizer.h
	rm -vf /usr/local/include/lpmd/lpmd/atompair.h
	rm -vf /usr/local/include/lpmd/lpmd/taghandler.h
	rm -vf /usr/local/include/lpmd/lpmd/api.h
	rm -vf /usr/local/include/lpmd/lpmd/parameter.h
	rm -vf /usr/local/include/lpmd/lpmd/configurationset.h
	rm -vf /usr/local/include/lpmd/lpmd/filtrableconfiguration.h
	rm -vf /usr/local/include/lpmd/lpmd/colorhandler.h
	rm -vf /usr/local/lib/pkgconfig/liblpmd-2.0.pc
	(rmdir /usr/local/lib || true) 2>/dev/null
	(rmdir /usr/local/include/lpmd || true) 2>/dev/null
	(rmdir /usr/local/lib/pkgconfig || true) 2>/dev/null

atom.o: atom.cc ./lpmd/basicatom.h ./lpmd/atom.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c atom.cc -o atom.o

cell.o: cell.cc ./lpmd/cell.h ./lpmd/vector.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cell.cc -o cell.o

cellgenerator.o: cellgenerator.cc ./lpmd/cellgenerator.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cellgenerator.cc -o cellgenerator.o

cellreader.o: cellreader.cc ./lpmd/cellreader.h ./lpmd/simulationhistory.h ./lpmd/storedconfiguration.h ./lpmd/session.h ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cellreader.cc -o cellreader.o

cellwriter.o: cellwriter.cc ./lpmd/cellwriter.h ./lpmd/simulationhistory.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cellwriter.cc -o cellwriter.o

cellformat.o: cellformat.cc ./lpmd/cellformat.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cellformat.cc -o cellformat.o

cellmanager.o: cellmanager.cc ./lpmd/cellmanager.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cellmanager.cc -o cellmanager.o

cmdline.o: cmdline.cc ./lpmd/cmdline.h ./lpmd/util.h ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c cmdline.cc -o cmdline.o

color.o: color.cc ./lpmd/color.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c color.cc -o color.o

colorhandler.o: colorhandler.cc ./lpmd/colorhandler.h ./lpmd/basicatom.h ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c colorhandler.cc -o colorhandler.o

controlfile.o: controlfile.cc ./lpmd/controlfile.h ./lpmd/util.h ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c controlfile.cc -o controlfile.o

configuration.o: configuration.cc ./lpmd/configuration.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c configuration.cc -o configuration.o

elements.o: elements.cc ./lpmd/elements.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c elements.cc -o elements.o

error.o: error.cc ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c error.cc -o error.o

module.o: module.cc ./lpmd/module.h ./lpmd/pluginmanager.h ./lpmd/util.h ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c module.cc -o module.o

metalpotential.o: metalpotential.cc ./lpmd/metalpotential.h ./lpmd/properties.h ./lpmd/atompair.h ./lpmd/configuration.h ./lpmd/session.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c metalpotential.cc -o metalpotential.o

paramlist.o: paramlist.cc ./lpmd/paramlist.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c paramlist.cc -o paramlist.o

plugin.o: plugin.cc ./lpmd/plugin.h ./lpmd/session.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c plugin.cc -o plugin.o

pluginmanager.o: pluginmanager.cc ./lpmd/pluginmanager.h ./lpmd/util.h config.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c pluginmanager.cc -o pluginmanager.o

potential.o: potential.cc ./lpmd/potential.h ./lpmd/simulation.h ./lpmd/util.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c potential.cc -o potential.o

pairpotential.o: pairpotential.cc ./lpmd/session.h ./lpmd/pairpotential.h ./lpmd/atompair.h ./lpmd/matrix.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c pairpotential.cc -o pairpotential.o

particleset.o: particleset.cc ./lpmd/particleset.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c particleset.cc -o particleset.o

properties.o: properties.cc ./lpmd/properties.h ./lpmd/matrix.h ./lpmd/configuration.h ./lpmd/potential.h ./lpmd/util.h ./lpmd/configurationset.h ./lpmd/storedconfiguration.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c properties.cc -o properties.o

property.o: property.cc ./lpmd/property.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c property.cc -o property.o

session.o: session.cc ./lpmd/session.h config.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c session.cc -o session.o

matrix.o: matrix.cc ./lpmd/matrix.h ./lpmd/error.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c matrix.cc -o matrix.o

simulation.o: simulation.cc ./lpmd/simulation.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c simulation.cc -o simulation.o

timer.o: timer.cc ./lpmd/timer.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c timer.cc -o timer.o

integrator.o: integrator.cc ./lpmd/integrator.h ./lpmd/potential.h ./lpmd/storedconfiguration.h ./lpmd/util.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c integrator.cc -o integrator.o

systemmodifier.o: systemmodifier.cc ./lpmd/systemmodifier.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c systemmodifier.cc -o systemmodifier.o

onestepintegrator.o: onestepintegrator.cc ./lpmd/onestepintegrator.h ./lpmd/simulation.h ./lpmd/potential.h ./lpmd/session.h ./lpmd/atom.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c onestepintegrator.cc -o onestepintegrator.o

twostepintegrator.o: twostepintegrator.cc ./lpmd/twostepintegrator.h ./lpmd/simulation.h ./lpmd/potential.h ./lpmd/session.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c twostepintegrator.cc -o twostepintegrator.o

systemmixer.o: systemmixer.cc ./lpmd/systemmixer.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c systemmixer.cc -o systemmixer.o

visualizer.o: visualizer.cc ./lpmd/visualizer.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c visualizer.cc -o visualizer.o

value.o: value.cc ./lpmd/value.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c value.cc -o value.o

moduleinfo.o: moduleinfo.cc ./lpmd/moduleinfo.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c moduleinfo.cc -o moduleinfo.o

util.o: util.cc ./lpmd/util.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c util.cc -o util.o

simulationbuilder.o: simulationbuilder.cc ./lpmd/simulationbuilder.h ./lpmd/nonorthogonalcell.h ./lpmd/orthogonalcell.h ./lpmd/particleset.h ./lpmd/fixedsizeparticleset.h ./lpmd/combinedpotential.h ./lpmd/integrator.h ./lpmd/properties.h ./lpmd/session.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c simulationbuilder.cc -o simulationbuilder.o

atomselector.o: atomselector.cc ./lpmd/atomselector.h ./lpmd/refparticleset.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c atomselector.cc -o atomselector.o

systemfilter.o: systemfilter.cc ./lpmd/systemfilter.h ./lpmd/particleset.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c systemfilter.cc -o systemfilter.o

simulationhistory.o: simulationhistory.cc ./lpmd/simulationhistory.h ./lpmd/storedconfiguration.h
	g++ -Wall -O3 -ffast-math -funroll-all-loops -finline-functions -std=gnu++98 -fno-common  -Wall -pedantic -std=gnu++98 -I. -fPIC -c simulationhistory.cc -o simulationhistory.o

liblpmd.dylib: atom.o cell.o cellgenerator.o cellreader.o cellwriter.o cellformat.o cellmanager.o cmdline.o color.o colorhandler.o controlfile.o configuration.o elements.o error.o module.o metalpotential.o paramlist.o plugin.o pluginmanager.o potential.o pairpotential.o particleset.o properties.o property.o session.o matrix.o simulation.o timer.o integrator.o systemmodifier.o onestepintegrator.o twostepintegrator.o systemmixer.o visualizer.o value.o moduleinfo.o util.o simulationbuilder.o atomselector.o systemfilter.o simulationhistory.o
	g++ -dynamiclib -o liblpmd.2.0.1.dylib atom.o cell.o cellgenerator.o cellreader.o cellwriter.o cellformat.o cellmanager.o cmdline.o color.o colorhandler.o controlfile.o configuration.o elements.o error.o module.o metalpotential.o paramlist.o plugin.o pluginmanager.o potential.o pairpotential.o particleset.o properties.o property.o session.o matrix.o simulation.o timer.o integrator.o systemmodifier.o onestepintegrator.o twostepintegrator.o systemmixer.o visualizer.o value.o moduleinfo.o util.o simulationbuilder.o atomselector.o systemfilter.o simulationhistory.o  -Wl,-undefined -Wl,dynamic_lookup -install_name liblpmd.2.0.1.dylib -compatibility_version 2 -current_version 2.0 -Wl,-single_module
	rm -f liblpmd.dylib
	ln -s liblpmd.2.0.1.dylib liblpmd.dylib
	rm -f liblpmd.2.dylib
	ln -s liblpmd.2.0.1.dylib liblpmd.2.dylib

lpmd_headers: lpmd/atom.h lpmd/array.h lpmd/basicatom.h lpmd/basiccell.h lpmd/basicparticleset.h lpmd/region.h lpmd/selector.h lpmd/cell.h lpmd/cellformat.h lpmd/cellgenerator.h lpmd/cellmanager.h lpmd/cellreader.h lpmd/cellwriter.h lpmd/cmdline.h lpmd/color.h lpmd/storedvalue.h lpmd/elements.h lpmd/error.h lpmd/properties.h lpmd/orthogonalcell.h lpmd/atomselector.h lpmd/nonorthogonalcell.h lpmd/indirectatom.h lpmd/controlfile.h lpmd/property.h lpmd/combinedpotential.h lpmd/map.h lpmd/matrix.h lpmd/fixedsizeparticleset.h lpmd/twostepintegrator.h lpmd/simulationhistory.h lpmd/refparticleset.h lpmd/stepper.h lpmd/metalpotential.h lpmd/module.h lpmd/paramlist.h lpmd/solver.h lpmd/storedconfiguration.h lpmd/particleset.h lpmd/plugin.h lpmd/pluginmanager.h lpmd/potential.h lpmd/pairpotential.h lpmd/session.h lpmd/systemfilter.h lpmd/configuration.h lpmd/simulation.h lpmd/integrator.h lpmd/onestepintegrator.h lpmd/manipulations.h lpmd/moduleinfo.h lpmd/systemmixer.h lpmd/systemmodifier.h lpmd/task.h lpmd/taskrunner.h lpmd/timer.h lpmd/simulationbuilder.h lpmd/util.h lpmd/vector.h lpmd/value.h lpmd/visualizer.h lpmd/atompair.h lpmd/taghandler.h lpmd/api.h lpmd/parameter.h lpmd/configurationset.h lpmd/filtrableconfiguration.h lpmd/colorhandler.h


config.h: config.h.in
	cat config.h.in | ./setup --expand="prefix=/usr/local,version=2.0.3" > config.h

liblpmd-2.0.pc: liblpmd-2.0.pc.in
	cat liblpmd-2.0.pc.in | ./setup --expand="prefix=/usr/local,version=2.0.3" > liblpmd-2.0.pc


.PHONY: subdirs-install subdirs-check check subdirs-clean clean subdirs-uninstall

subdirs-install: 
	cd lpunit && $(MAKE) install
	cd demos && $(MAKE) install
	cd tests && $(MAKE) install
	cd benchmarks && $(MAKE) install

subdirs-check: 
	cd lpunit && $(MAKE) check
	cd demos && $(MAKE) check
	cd tests && $(MAKE) check
	cd benchmarks && $(MAKE) check

check: subdirs-check


subdirs-clean: 
	cd lpunit && $(MAKE) clean
	cd demos && $(MAKE) clean
	cd tests && $(MAKE) clean
	cd benchmarks && $(MAKE) clean

clean: subdirs-clean
	rm -f $(TARGETS) atom.o cell.o cellgenerator.o cellreader.o cellwriter.o cellformat.o cellmanager.o cmdline.o color.o colorhandler.o controlfile.o configuration.o elements.o error.o module.o metalpotential.o paramlist.o plugin.o pluginmanager.o potential.o pairpotential.o particleset.o properties.o property.o session.o matrix.o simulation.o timer.o integrator.o systemmodifier.o onestepintegrator.o twostepintegrator.o systemmixer.o visualizer.o value.o moduleinfo.o util.o simulationbuilder.o atomselector.o systemfilter.o simulationhistory.o liblpmd.2.0.1.dylib liblpmd.2.dylib

subdirs-uninstall: 
	cd lpunit && $(MAKE) uninstall
	cd demos && $(MAKE) uninstall
	cd tests && $(MAKE) uninstall
	cd benchmarks && $(MAKE) uninstall

