[go: up one dir, main page]

Menu

[r5]: / openthermo / Makefile  Maximize  Restore  History

Download this file

438 lines (381 with data), 12.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# 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 " "