# Copyright (C) 2008-2009 Tokarev Konstantin <annulen@users.sourceforge.net>
# Some parts of this file were generated by qmake 1.07a
#
# OpenThermo is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; see COPYING for more details
#
# Type 'make help' to get information about compilation options
#
VERSION = 1.0.0beta1
# Change this paths to change installation directories
INSTALLPATH = /usr/local/bin/openthermo
LINKPATH = /usr/bin/thermo
MANPATH = /usr/share/man/man1
# Compilation
CXX = g++
LINK = g++
CXXFLAGS = -pipe -Wall
# to compile with icc add '-Kc++'
NMLIBPATH = ./newmat
XMLLIBPATH = ./xmlpp
LIBS = -L$(NMLIBPATH) -lnewmat -L$(XMLLIBPATH) -lxmlpp
#Compilation of Win32 version (Open Watcom default)
WINCXX = wcl386.exe
WINCXXFLAGS = -d0 -xs -ot -zw -zq -bcl=nt -x -fe=thermo.exe
WINNMLIBPATH = ./newmat
WINLINKOPT = ./newmat/newmat.lib nt/plbx3r.lib
TESTFILE1 = diatomic_example
TESTFILE2 = input_example
CWD=`pwd`
HEADERS = atom.hpp \
exception.hpp \
input.hpp \
kernel.hpp \
mathmodule.hpp \
matrix.h \
molecule.hpp \
pes.hpp \
roller.hpp \
rotation.hpp \
symmetry.hpp \
thermo.h \
xml.hpp
SOURCES = atom.cpp \
input.cpp \
kernel.cpp \
main.cpp \
mathmodule.cpp \
molecule.cpp \
pes.cpp \
rotation.cpp \
symmetry.cpp \
xml.cpp
OBJECTS = atom.o \
input.o \
kernel.o \
main.o \
mathmodule.o \
molecule.o \
pes.o \
rotation.o \
symmetry.o \
xml.o
DEPEND = libnewmat.a \
libxmlpp.a
DOCS = COPYING \
README \
AUTHORS \
THANKS \
NEWS
PACKAGES = control \
manpage.1 \
menu \
openthermo.spec
MKFILES = Makefile \
Makefile.bin
# Make targets list
first: all
.SUFFIXES: .c .o .cpp .cc .cxx .C
.cpp.o:
@echo " CXX $*.cpp"
@$(CXX) -c $(CXXFLAGS) $*.cpp -o $@
#
# Linking of executable files
#
all: thermo
release: thermo
thermo: $(OBJECTS) $(DEPEND)
@echo " LD thermo "
@$(LINK) -o thermo $(OBJECTS) $(LIBS)
@strip ./thermo
@echo
debug: $(SOURCES) $(DEPEND)
$(CXX) $(CXXFLAGS) -g -w -O0 $(SOURCES) $(LFLAGS) $(LIBS) -o thermo.dbg
profile: $(SOURCES) $(DEPEND)
@echo "Building profile version..."
@echo " LD a.out "
$(CXX) -pg $(CXXFLAGS) $(SOURCES) $(LFLAGS) $(LIBS)
static: $(OBJECTS) $(DEPEND)
@echo " LD thermo "
@$(LINK) -static -o thermo $(OBJECTS) $(LIBS)
@strip ./thermo
@echo
# Testing of executable
test: ./thermo
@echo "Running test jobs... "
@make -C ./tests test;
saveresult:
@echo "Saving test jobs... "
@make -C ./tests saveresult;
#
# Unix installation/uninstallation
#
install: release
@echo "Installing OpenThermo..."
@if [ ! -e $(INSTALLPATH) ]; then mkdir $(INSTALLPATH); fi
cp -t $(INSTALLPATH) thermo $(DOCS)
ln -s $(INSTALLPATH)/thermo $(LINKPATH)
@echo "OpenThermo " $(VERSION) "was successfully installed"
install-man:
@cp manpage.1 $(MANPATH)/thermo.1
uninstall:
@echo -n "Uninstalling OpenThermo... "
@if [ -e $(LINKPATH) ]; then rm $(LINKPATH); fi
@if [ -e $(INSTALLPATH) ]; then rm -rf $(INSTALLPATH); fi
@echo "Done"
clean:
@rm -f $(OBJECTS)
@if [ -e ./newmat ]; then make -C ./newmat clean; fi
@if [ -e ./xmlpp ]; then make -C ./xmlpp clean; fi
@if [ -e ./tests ]; then make -i -C ./tests clean; fi
cleantest:
@if [ -e ./tests ]; then make -i -C ./tests clean; fi
distclean: clean
@if [ -e thermo ]; then rm thermo; fi
@if [ -e thermo.dbg ]; then rm thermo.dbg; fi
@if [ -e thermo.exe ]; then rm thermo.exe; fi
@if [ -e a.out ]; then rm a.out; fi
@if [ -e elements.dat ]; then rm elements.dat; fi
@if [ -e ./newmat ]; then make -C ./newmat distclean; fi
@if [ -e ./xmlpp ]; then make -C ./xmlpp distclean; fi
@if [ -e ./tests ]; then make -i -C ./tests distclean; fi
#
# Compilation of object files
#
atom.o: atom.cpp atom.hpp \
exception.hpp \
thermo.h
input.o: input.cpp input.hpp \
thermo.h \
molecule.hpp \
pes.hpp \
xml.hpp \
atom.hpp \
exception.hpp \
matrix.h \
rotation.hpp \
symmetry.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
mathmodule.hpp \
xmlpp/xmlpp.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
kernel.o: kernel.cpp thermo.h \
kernel.hpp \
rotation.hpp \
mathmodule.hpp \
molecule.hpp \
xml.hpp \
atom.hpp \
exception.hpp \
matrix.h \
pes.hpp \
symmetry.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
xmlpp/xmlpp.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
main.o: main.cpp thermo.h \
input.hpp \
kernel.hpp \
molecule.hpp \
roller.hpp \
xml.hpp \
pes.hpp \
atom.hpp \
exception.hpp \
matrix.h \
rotation.hpp \
symmetry.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
mathmodule.hpp \
xmlpp/xmlpp.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
mathmodule.o: mathmodule.cpp mathmodule.hpp \
pes.hpp \
exception.hpp
molecule.o: molecule.cpp molecule.hpp \
thermo.h \
atom.hpp \
exception.hpp \
matrix.h \
pes.hpp \
rotation.hpp \
symmetry.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
mathmodule.hpp
pes.o: pes.cpp pes.hpp \
mathmodule.hpp \
exception.hpp
rotation.o: rotation.cpp pes.hpp \
rotation.hpp \
exception.hpp \
mathmodule.hpp
symmetry.o: symmetry.cpp symmetry.hpp
xml.o: xml.cpp xml.hpp \
xmlpp/xmlpp.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
libnewmat.a:
@if [ ! -e $(NMLIBPATH)/libnewmat.a ]; then make -C ./newmat libnewmat.a; fi
@make -C ./newmat clean
newmat.lib:
@if [ ! -e $(NMLIBPATH)/newmat.lib ]; then make -C ./newmat newmat.lib; fi
libxmlpp.a:
@if [ ! -e $(XMLLIBPATH)/libxmlpp.a ]; then make -C $(XMLLIBPATH) libxmlpp.a; fi
@make -C ./newmat clean
#
# Package building routines
#
packages: clean release test saveresult cleantest src deb rpm bin win32
src:
@if [ -e openthermo-$(VERSION) ]; then rm -rf openthermo-$(VERSION); fi
@if [ -e openthermo-$(VERSION).tar.bz2 ]; then rm -rf openthermo-$(VERSION).tar.bz2; fi
@if [ -e openthermo-$(VERSION).tar.gz ]; then rm -rf openthermo-$(VERSION).tar.gz; fi
@if [ -e newmat/libnewmat.a ]; then mv newmat/libnewmat.a . ; fi
@if [ -e newmat/newmat.lib ]; then mv newmat/newmat.lib . ; fi
@mkdir openthermo-$(VERSION)
@cp -t openthermo-$(VERSION) $(HEADERS) $(SOURCES) $(DOCS) $(MKFILES) $(PACKAGES)
@cp -r newmat openthermo-$(VERSION)
@cp -r tests openthermo-$(VERSION)
@cp -r xmlpp openthermo-$(VERSION)
# @cp input_example openthermo-$(VERSION) --> to $(DOCS)
# @cp diatomic_example openthermo-$(VERSION)
# @cp OpenThermo.dev openthermo-$(VERSION)
# @cp openthermo.wpj openthermo-$(VERSION)
# @cp thermo.tgt openthermo-$(VERSION)
@echo
@echo -n "Creating .tar.bz2 package... "
@tar -cjf openthermo-$(VERSION).tar.bz2 openthermo-$(VERSION)
@echo "Done."
@echo -n "Creating .tar.gz package... "
@tar -czf openthermo-$(VERSION).tar.gz openthermo-$(VERSION)
@echo "Done."
@if [ -e libnewmat.a ]; then mv libnewmat.a newmat ; fi
@if [ -e newmat.lib ]; then mv newmat.lib newmat ; fi
@rm -rf openthermo-$(VERSION)
bin: static
@echo -n "Creating binary .tar.gz package... "
@if [ -e openthermo-$(VERSION) ]; then rm -rf openthermo-$(VERSION); fi
@if [ -e openthermo-$(VERSION)-linux-bin.tar.bz2 ]; then rm openthermo-$(VERSION)-linux-bin.tar.bz2; fi
@if [ -e newmat/libnewmat.a ]; then mv newmat/libnewmat.a . ; fi
@if [ -e newmat/newmat.lib ]; then mv newmat/newmat.lib . ; fi
@mkdir openthermo-$(VERSION)
@cp thermo openthermo-$(VERSION)
@cp -r tests openthermo-$(VERSION)
@cp -t openthermo-$(VERSION) $(DOCS)
@cp Makefile.bin openthermo-$(VERSION)/Makefile
@tar -cjf openthermo-$(VERSION)-linux-bin.tar.bz2 openthermo-$(VERSION)
@rm -rf openthermo-$(VERSION)
@if [ -e libnewmat.a ]; then mv libnewmat.a newmat ; fi
@if [ -e newmat.lib ]; then mv newmat.lib newmat ; fi
@echo "Done."
deb: thermo
@echo -n "Creating binary .deb package... "
@if [ -e openthermo-deb ]; then rm -rf openthermo-deb; fi
@if [ -e openthermo*.deb ]; then rm openthermo*.deb; fi
@if [ -e newmat/libnewmat.a ]; then mv newmat/libnewmat.a . ; fi
@if [ -e newmat/newmat.lib ]; then mv newmat/newmat.lib . ; fi
@fakeroot -- mkdir -p openthermo-deb/usr/bin
@fakeroot -- cp thermo openthermo-deb/usr/bin
@fakeroot -- mkdir -p openthermo-deb/usr/share/doc/openthermo
@fakeroot -- cp -t openthermo-deb/usr/share/doc/openthermo $(DOCS)
@fakeroot -- gzip -9 openthermo-deb/usr/share/doc/openthermo/*
@fakeroot -- mkdir -p openthermo-deb/usr/share/man/man1
@fakeroot -- cp manpage.1 openthermo-deb/usr/share/man/man1/thermo.1
@fakeroot -- gzip -9 openthermo-deb/usr/share/man/man1/thermo.1
@fakeroot -- mkdir -p openthermo-deb/usr/share/menu
@fakeroot -- cp menu openthermo-deb/usr/share/menu/openthermo
@fakeroot -- mkdir openthermo-deb/DEBIAN
# Next string is VERY tricky: DON’T_EVEN_THINK ABOUT UNDERSTANDING IT!
# Generate md5 sums for files in package
@echo "cd openthermo-deb; for file in \`find usr\`; do md5sum \$$file 2>/dev/null; done" | bash >openthermo-deb/DEBIAN/md5sums
@fakeroot -- cp control openthermo-deb/DEBIAN
@fakeroot -- dpkg -b openthermo-deb . > /dev/null
@rm -rf openthermo-deb
@if [ -e libnewmat.a ]; then mv libnewmat.a newmat ; fi
@if [ -e newmat.lib ]; then mv newmat.lib newmat ; fi
@echo "Done."
rpm: thermo
@echo -n "Creating binary .rpm package... "
@if [ -e newmat/libnewmat.a ]; then mv newmat/libnewmat.a . ; fi
@if [ -e newmat/newmat.lib ]; then mv newmat/newmat.lib . ; fi
@if [ -e $(HOME)/rpm/openthermo ]; then rm -rf $(HOME)/rpm/openthermo; fi
@if [ -e openthermo*.rpm ]; then rm openthermo*.rpm; fi
@mkdir -p $(HOME)/rpm/openthermo/BUILD
@if [ -e ~/.rpmmacros ]; then mv ~/.rpmmacros ~/.rpmmacros_; else echo "" > ~/.rpmmacros_; fi
@echo "%_topdir $(HOME)/rpm/openthermo" > ~/.rpmmacros
@mkdir -p $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo
@cp -t $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo $(DOCS)
@gzip -f -9 $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/*
@mkdir -p $(HOME)/rpm/openthermo/BUILD/usr/bin
@cp thermo $(HOME)/rpm/openthermo/BUILD/usr/bin
@mkdir -p $(HOME)/rpm/openthermo/BUILD/usr/man/man1/
@cp manpage.1 $(HOME)/rpm/openthermo/BUILD/usr/man/man1/thermo.1
@mkdir -p $(HOME)/rpm/openthermo/RPMS/`uname -m`
@rpmbuild -bb --quiet --buildroot $(HOME)/rpm/openthermo/BUILD openthermo.spec > /dev/null
@if [ -e $(HOME)/rpm/openthermo/RPMS/`uname -m`/openthermo*.rpm ]; then mv $(HOME)/rpm/openthermo/RPMS/`uname -m`/openthermo*.rpm $(CWD); fi
@cat ~/.rpmmacros_ > ~/.rpmmacros
@rm ~/.rpmmacros_
@rm -rf $(HOME)/rpm/openthermo
@echo "Done."
@if [ -e libnewmat.a ]; then mv libnewmat.a newmat ; fi
@if [ -e newmat.lib ]; then mv newmat.lib newmat ; fi
win32:
@echo -n "Compiling Win32 version... "
@$(WINCXX) $(WINCXXFLAGS) $(SRC) $(WINLINKOPT)
@echo "Done."
@echo -n "Creating Win32 .zip package..."
@if [ -e openthermo-$(VERSION)-win32-bin.zip ]; then rm openthermo-$(VERSION)-win32-bin.zip; fi
@cp COPYING COPYING.txt
@cp README README.txt
@cp AUTHORS AUTHORS.txt
@cp NEWS NEWS.txt
@zip -l openthermo-$(VERSION)-win32-bin.zip COPYING.txt README.txt AUTHORS.txt NEWS.txt > /dev/null
@zip -l openthermo-$(VERSION)-win32-bin.zip tests/* > /dev/null
@zip openthermo-$(VERSION)-win32-bin.zip thermo.exe > /dev/null
@rm COPYING.txt README.txt AUTHORS.txt NEWS.txt
@echo "Done."
# Make help
help:
@echo " "
@echo " ******** OpenThermo " $(VERSION) " ********"
@echo " Copyright (C) 2007-2008 Tokarev Konstantin and others"
@echo " "
@echo " make Builds executable of OpenThermo"
@echo " make test Tests executable of OpenThermo"
@echo " make saveresult Saves results of tests for future"
@echo " make install Installs OpenThermo to "$(INSTALLPATH)
@echo " make install-man Installs OpenThermo man page to "$(MANPATH)
@echo " make uninstall Rmrf's installation directory"
@echo " make clean Removes intermediate files from this directory"
@echo " make distclean Removes intermediate and executable files and packages from this directory"
@echo " make src Builds source packages of OpenThermo"
@echo " make bin Builds Linux binary package of OpenThermo"
@echo " make deb Builds Linux binary DEB package of OpenThermo"
@echo " make rpm Builds Linux binary RPM package of OpenThermo"
@echo " make win32 Builds Windows binary package of OpenThermo"
@echo " make packages Builds all available packages of OpenThermo"
@echo " "