# Copyright (C) 2008-2010 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.1.0rc1
include config.mk
# Change this paths to change installation directories
INSTALLPATH ?= /usr/local/bin/openthermo
LINKPATH ?= /usr/bin
MANPATH ?= /usr/share/man/man1
BODR_PATH ?= /usr/share/bodr
NM_PATH ?= ./newmat
XMLPP_PATH ?= ./xmlpp
LIBS += -L$(NM_PATH) -lnewmat -L$(XMLPP_PATH) -lxmlpp
NM_LIB = -L$(NM_PATH) -lnewmat
XMLPP_LIB = -L$(XMLPP_PATH) -lxmlpp
WINLIBS += $(NM_PATH)/newmat.a $(XMLPP_PATH)/xmlpp.a -lcomdlg32
# Compilation
CXX ?= g++
CXXFLAGS += -pipe -Wall -DPOSIX -DBODR_PATH=\"$(BODR_PATH)\"
#Compilation of Win32 version (mingw default)
WINCXX ?= i586-mingw32msvc-g++
WINCXXFLAGS += -pipe -Wall -Wno-deprecated -I/usr/i586-mingw32msvc/include
CWD=`pwd`
HEADERS = atom.hpp \
control.hpp \
exception.hpp \
input.hpp \
kernel.hpp \
mathmodule.hpp \
matrix.h \
molecule.hpp \
pes.hpp \
roller.hpp \
rotor.hpp \
structure.hpp \
symmetry.hpp \
thermo.h \
xml.hpp
SOURCES = atom.cpp \
control.cpp \
input.cpp \
kernel.cpp \
main.cpp \
mathmodule.cpp \
molecule.cpp \
pes.cpp \
rotor.cpp \
structure.cpp \
symmetry.cpp \
xml.cpp
UTIL_SRC = barriertool.cpp
LIBRARY_OBJ = atom.o \
control.o \
mathmodule.o \
molecule.o \
pes.o \
rotor.o \
structure.o \
symmetry.o \
xml.o
OBJECTS = main.o \
kernel.o \
input.o
BARRIERTOOL_OBJ = barriertool.o \
pes.o \
mathmodule.o
DEPEND = libnewmat.a \
libxmlpp.a
WINDEPEND = newmat.a \
xmlpp.a
DOCS = COPYING \
README \
AUTHORS \
THANKS \
NEWS
PACKAGES = control \
barriertool.1 \
openthermo.1 \
menu \
openthermo.spec
MKFILES = Makefile
# 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: openthermo barriertool
release: openthermo barriertool
@strip ./openthermo
@strip ./barriertool
openthermo: $(OBJECTS) $(DEPEND) libopenthermo.a
@echo " LD openthermo "
@$(CXX) $(CXXFLAGS) -o openthermo $(OBJECTS) libopenthermo.a $(LIBS)
# @strip ./openthermo
@echo
#debug: $(SOURCES) $(DEPEND)
# $(CXX) $(CXXFLAGS) -g -w -O0 $(SOURCES) $(LFLAGS) $(LIBS) -o openthermo.dbg
#profile: $(SOURCES) $(DEPEND)
# @echo "Building profile version..."
# @echo " LD a.out "
# $(CXX) -pg $(CXXFLAGS) $(SOURCES) $(LFLAGS) $(LIBS)
static: $(OBJECTS) $(DEPEND)
@echo " LD openthermo "
@$(CXX) -static -o openthermo $(OBJECTS) libopenthermo.a $(LIBS)
@strip ./openthermo
@echo
libopenthermo.a: $(LIBRARY_OBJ) $(DEPEND)
@echo " AR libopenthermo.a"
@ar -cr libopenthermo.a $(LIBRARY_OBJ)
@ranlib libopenthermo.a
barriertool: $(BARRIERTOOL_OBJ) $(DEPEND)
@echo " LD barriertool "
@$(CXX) -o barriertool barriertool.cpp libopenthermo.a $(NM_LIB)
#-L$(NM_PATH) -lnewmat
@echo
# Testing of executable
test: release
@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) openthermo barriertool $(DOCS)
ln -s $(INSTALLPATH)/openthermo $(LINKPATH)/openthermo
ln -s $(INSTALLPATH)/barriertool $(LINKPATH)/barriertool
cp openthermo.1 $(MANPATH)/openthermo.1
cp barriertool.1 $(MANPATH)/barriertool.1
@echo "OpenThermo " $(VERSION) "was successfully installed"
uninstall:
@echo -n "Uninstalling OpenThermo... "
if [ -e $(LINKPATH)/openthermo ]; then rm $(LINKPATH)/openthermo; fi
if [ -e $(LINKPATH)/barriertool ]; then rm $(LINKPATH)/barriertool; fi
if [ -e $(INSTALLPATH) ]; then rm -rf $(INSTALLPATH); fi
@echo "Done"
clean:
@rm -f $(OBJECTS) $(LIBRARY_OBJ) $(BARRIERTOOL_OBJ) libopenthermo.a
@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 openthermo ]; then rm openthermo; fi
@if [ -e barriertool ]; then rm barriertool; fi
@if [ -e openthermo.dbg ]; then rm openthermo.dbg; fi
@if [ -e openthermo.exe ]; then rm openthermo.exe; fi
@if [ -e barriertool.exe ]; then rm barriertool.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
generate-depend:
@if [ -e openthermo.pro ]; then rm openthermo.pro; fi
@if [ -e makefile.tmp ]; then rm makefile.tmp; fi
qmake-qt3 -project -norecursive
qmake-qt3 -nocache openthermo.pro -o makefile.tmp
#
# Compilation of object files
#
############# Generated by qmake-qt3 ##############
atom.o: atom.cpp atom.hpp \
control.hpp \
hash.h \
exception.hpp \
thermo.h \
input.hpp \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
barriertool.o: barriertool.cpp exception.hpp \
hash.h \
pes.hpp
control.o: control.cpp control.hpp \
exception.hpp \
input.hpp \
xml.hpp \
thermo.h \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
input.o: input.cpp control.hpp \
exception.hpp \
input.hpp \
molecule.hpp \
pes.hpp \
rotor.hpp \
thermo.h \
hash.h \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h \
structure.hpp \
matrix.h \
symmetry.hpp \
atom.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h
kernel.o: kernel.cpp thermo.h \
control.hpp \
kernel.hpp \
molecule.hpp \
rotor.hpp \
mathmodule.hpp \
input.hpp \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h \
structure.hpp \
matrix.h \
symmetry.hpp \
atom.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
pes.hpp \
hash.h
main.o: main.cpp thermo.h \
control.hpp \
exception.hpp \
input.hpp \
kernel.hpp \
molecule.hpp \
pes.hpp \
roller.hpp \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h \
structure.hpp \
matrix.h \
symmetry.hpp \
atom.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
hash.h
mathmodule.o: mathmodule.cpp mathmodule.hpp
molecule.o: molecule.cpp thermo.h \
control.hpp \
molecule.hpp \
exception.hpp \
rotor.hpp \
mathmodule.hpp \
input.hpp \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h \
structure.hpp \
matrix.h \
symmetry.hpp \
atom.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
pes.hpp \
hash.h
pes.o: pes.cpp newmat/newmatap.h \
pes.hpp \
mathmodule.hpp \
thermo.h \
exception.hpp \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
hash.h
rotor.o: rotor.cpp rotor.hpp \
control.hpp \
exception.hpp \
mathmodule.hpp \
matrix.h \
symmetry.hpp \
thermo.h \
pes.hpp \
structure.hpp \
hash.h \
atom.hpp \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h \
input.hpp \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
structure.o: structure.cpp exception.hpp \
structure.hpp \
hash.h \
thermo.h \
atom.hpp \
matrix.h \
newmat/newmatap.h \
newmat/newmatio.h \
newmat/newmat.h \
newmat/include.h \
newmat/boolean.h \
newmat/myexcept.h
symmetry.o: symmetry.cpp symmetry.hpp
xml.o: xml.cpp exception.hpp \
xml.hpp \
xmlpp/xmlpp.h \
xmlpp/hash.h \
xmlpp/xmlcommon.h \
xmlpp/xmlhelpers.h
########################################
libnewmat.a:
@if [ ! -e $(NM_PATH)/libnewmat.a ]; then make CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" -C ./newmat libnewmat.a; fi
@make -C ./newmat clean
newmat.a:
@if [ ! -e $(NM_PATH)/newmat.a ]; then make -C ./newmat newmat.a; fi
@make -C ./newmat clean
libxmlpp.a:
@if [ ! -e $(XMLPP_PATH)/libxmlpp.a ]; then make CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" -C $(XMLPP_PATH) libxmlpp.a; fi
@make -C ./xmlpp clean
xmlpp.a:
@if [ ! -e $(XMLPP_PATH)/xmlpp.a ]; then make -C $(XMLPP_PATH) xmlpp.a; fi
@make -C ./xmlpp 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
@if [ -e xmlpp/libxmlpp.a ]; then mv xmlpp/libxmlpp.a . ; fi
@if [ -e xmlpp/xmlpp.a ]; then mv xmlpp/xmlpp.a . ; fi
@mkdir openthermo-$(VERSION)
@cp -t openthermo-$(VERSION) $(HEADERS) $(SOURCES) $(UTIL_SRC) $(DOCS) $(MKFILES) $(PACKAGES)
@cp -r newmat openthermo-$(VERSION)
@cp -r tests openthermo-$(VERSION)
@cp -r xmlpp openthermo-$(VERSION)
@rm -rf openthermo-$(VERSION)/tests/.svn
@rm -rf openthermo-$(VERSION)/newmat/.svn
@rm -rf openthermo-$(VERSION)/xmlpp/.svn
@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
@if [ -e libxmlpp.a ]; then mv libxmlpp.a xmlpp ; fi
@if [ -e xmlpp.lib ]; then mv xmlpp.a 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 openthermo 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: release
@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.a ]; then mv newmat/newmat.a . ; fi
@fakeroot -- mkdir -p openthermo-deb/usr/bin
@fakeroot -- cp openthermo openthermo-deb/usr/bin
@fakeroot -- cp barriertool 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 -- gunzip openthermo-deb/usr/share/doc/openthermo/COPYING.gz
@fakeroot -- mkdir openthermo-deb/usr/share/doc/openthermo/examples
@fakeroot -- cp tests/*.inp openthermo-deb/usr/share/doc/openthermo/examples
@fakeroot -- gzip -9 openthermo-deb/usr/share/doc/openthermo/examples/*.inp
@fakeroot -- cp tests/*.test openthermo-deb/usr/share/doc/openthermo/examples
@fakeroot -- gzip -9 openthermo-deb/usr/share/doc/openthermo/examples/*.out
@fakeroot -- cp tests/*.sh openthermo-deb/usr/share/doc/openthermo/examples
@fakeroot -- cp tests/*.awk openthermo-deb/usr/share/doc/openthermo/examples
@fakeroot -- mkdir -p openthermo-deb/usr/share/man/man1
@fakeroot -- cp openthermo.1 openthermo-deb/usr/share/man/man1/openthermo.1
@fakeroot -- gzip -9 openthermo-deb/usr/share/man/man1/openthermo.1
@fakeroot -- cp barriertool.1 openthermo-deb/usr/share/man/man1/barriertool.1
@fakeroot -- gzip -9 openthermo-deb/usr/share/man/man1/barriertool.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.a newmat ; fi
@echo "Done."
rpm: release
@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/*
@gunzip $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/COPYING.gz
@mkdir $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples
@cp tests/*.inp $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples
@cp tests/*.test $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples
@gzip -9 $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples/*
@cp tests/Makefile $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples
@cp tests/*.sh $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples
@cp tests/*.awk $(HOME)/rpm/openthermo/BUILD/usr/doc/openthermo/examples
@mkdir -p $(HOME)/rpm/openthermo/BUILD/usr/bin
@cp openthermo $(HOME)/rpm/openthermo/BUILD/usr/bin
@cp barriertool $(HOME)/rpm/openthermo/BUILD/usr/bin
@mkdir -p $(HOME)/rpm/openthermo/BUILD/usr/man/man1/
@cp openthermo.1 $(HOME)/rpm/openthermo/BUILD/usr/man/man1/openthermo.1
@cp barriertool.1 $(HOME)/rpm/openthermo/BUILD/usr/man/man1/barriertool.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/i386/openthermo*.rpm ]; then mv $(HOME)/rpm/openthermo/RPMS/i386/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: $(SOURCES) $(WINDEPEND)
@echo -n "Compiling Win32 version... "
# @$(WINCXX) $(WINCXXFLAGS) $(SRC) $(WINLINKOPT)
$(WINCXX) -o openthermo.exe $(WINCXXFLAGS) $(SOURCES) $(WINLIBS)
$(WINCXX) -o barriertool.exe $(WINCXXFLAGS) barriertool.cpp pes.cpp newmat/newmat.a
@echo "Done."
@echo -n "Creating Win32 .zip package..."
@if [ -e openthermo-$(VERSION)-win32.zip ]; then rm openthermo-$(VERSION)-win32.zip; fi
@cp COPYING Copying.txt
@cp README Readme.txt
@cp AUTHORS Authors.txt
@cp NEWS News.txt
@cp THANKS Thanks.txt
@zip -l openthermo-$(VERSION)-win32.zip Copying.txt Readme.txt Authors.txt News.txt Thanks.txt > /dev/null
@zip -l openthermo-$(VERSION)-win32.zip tests/* > /dev/null
@zip openthermo-$(VERSION)-win32.zip openthermo.exe barriertool.exe > /dev/null
@rm Copying.txt Readme.txt Authors.txt News.txt Thanks.txt
@echo "Done."
check:
@cppcheck -v --enable=all $(SOURCES) 2> cppcheck.log
check-core:
@cppcheck -v --enable=all structure.cpp rotor.cpp molecule.cpp 2> cppcheck.log
docs:
make -C doc
# 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 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 " "