Skip to content

Commit d9583f1

Browse files
committed
This commit focuses on adding the make install rule.
A few legacy files were removed; scripts was mostly merged into tools/. regressiontest.py was relocated to python/ All executables are copied to bin/ as part of the default make rule. Paths in makefiles and .xml's were updated to point to bin/ rather than tools/ or scripts/. FLUIDITY is no longer set within configure. @PACKAGE_NAME@ is used instead to set FLUIDITY within makefiles as per standard. Staged installed now work - ie support for DESTDIR has been added.
1 parent 149003b commit d9583f1

File tree

867 files changed

+1349
-30471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

867 files changed

+1349
-30471
lines changed

Makefile.in

+98-52
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,26 @@
2626
# USA
2727
SHELL = @SHELL@
2828

29-
PROGRAM = ./bin/@FLUIDITY@
29+
PACKAGE_NAME = @PACKAGE_NAME@
30+
PACKAGE_VERSION = @PACKAGE_VERSION@
31+
32+
FLUIDITY = $(PACKAGE_NAME)
33+
34+
PROGRAM = ./bin/$(FLUIDITY)
3035
FLDECOMP = ./bin/fldecomp
3136

32-
LIB_FLUIDITY = ./lib/lib@FLUIDITY@.a
33-
SLIB_FLUIDITY = lib@FLUIDITY@.so
37+
LIB_FLUIDITY = ./lib/lib$(FLUIDITY).a
38+
SLIB_FLUIDITY = lib$(FLUIDITY).so
3439

40+
# Follow: www.gnu.org/prep/standards/html_node/Directory-Variables.html
41+
PACKAGE_NAME = @PACKAGE_NAME@
3542
prefix = @prefix@
36-
FLUIDITY_ROOT=$(DESTDIR)@prefix@
43+
bindir = @bindir@
44+
libdir = @libdir@
45+
datadir = @datadir@
46+
docdir = @docdir@/
47+
htmldir = @htmldir@/
48+
pdfdir = @pdfdir@/
3749

3850
FC = @FC@
3951
FCFLAGS = @FCFLAGS@
@@ -50,7 +62,7 @@ CXXFLAGS= @CPPFLAGS@ @CXXFLAGS@ -I./include
5062

5163
LINKER = @LINKER@ @LDFLAGS@
5264

53-
LIBS = -L./lib -l@FLUIDITY@ @BLAS_LIBS@ @LIB_FEMDEM@ ./lib/libadaptivity.a \
65+
LIBS = -L./lib -l$(FLUIDITY) @BLAS_LIBS@ @LIB_FEMDEM@ ./lib/libadaptivity.a \
5466
./lib/libvtkfortran.a ./lib/libspatialindex.a ./lib/libspud.a ./lib/libjudy.a \
5567
@LIBS@
5668

@@ -61,7 +73,7 @@ AR = @AR@
6173

6274
ARFLAGS = -cr
6375

64-
EVAL = scripts/silenteval
76+
EVAL = tools/silenteval.sh
6577

6678
VERSION = $(shell bzr revision-info)
6779

@@ -92,7 +104,7 @@ endif
92104
@echo " CXX $<"
93105
$(CXX) $(CXXFLAGS) -c $<
94106

95-
default: bin/@FLUIDITY@
107+
default: bin/$(FLUIDITY)
96108

97109
sub_system: $(LIBMBA2D) $(LIBMBA3D) $(LIBALGENCAN) @LIB_FEMDEM@ \
98110
lib/libadaptivity.a lib/libvtkfortran.a lib/libspatialindex.a \
@@ -153,15 +165,15 @@ main.o: include/version.h include/libspud.h
153165

154166
include/version.h:
155167
@echo "DEFINE __FLUIDITY_VERSION__"
156-
@grep "$(VERSION)" include/version.h >/dev/null 2>&1 || \
168+
@grep "$(PACKAGE_VERSION)" include/version.h >/dev/null 2>&1 || \
157169
printf "#ifndef _FLUIDITY_VERSION_H\n\
158170
#define _FLUIDITY_VERSION_H\n\
159-
#define __FLUIDITY_VERSION__ \"$(VERSION)\"\n\
171+
#define __FLUIDITY_VERSION__ \"$(PACKAGE_VERSION)\"\n\
160172
#endif /* _FLUIDITY_VERSION_H */\n" > include/version.h
161173

162174
.PHONY: include/version.h
163175

164-
bin/@FLUIDITY@: main.o lib/lib@FLUIDITY@.a
176+
bin/$(FLUIDITY): main.o lib/lib$(FLUIDITY).a
165177
@echo "BUILD fluidity"
166178
@echo " MKDIR bin"
167179
@mkdir -p bin
@@ -231,8 +243,8 @@ lib/shared/$(SLIB_FLUIDITY).1: fluidity_library
231243
@rm -rf tmp
232244
@mkdir -p tmp lib/shared
233245
@cp $(LIB_FLUIDITY) tmp
234-
@cd tmp; ar x lib@FLUIDITY@.a; rm lib@FLUIDITY@.a; cd ..
235-
@echo " LD lib@FLUIDITY@.so"
246+
@cd tmp; ar x lib$(FLUIDITY).a; rm lib$(FLUIDITY).a; cd ..
247+
@echo " LD lib$(FLUIDITY).so"
236248
@$(EVAL) $(LINKER) -shared -Wl,-soname,$(SLIB_FLUIDITY).1 -o lib/shared/$(SLIB_FLUIDITY).1 tmp/* -L./lib -lvtkfortran
237249
@rm -rf tmp
238250
@cd lib/shared; ln -sf $(SLIB_FLUIDITY).1 $(SLIB_FLUIDITY); cd ../..
@@ -261,8 +273,10 @@ python_clean:
261273
@cd python; rm -rf build
262274
@cd python/fluidity; find . -type l -name '*.so' -exec rm -f {} \;
263275

264-
fluidity_library: lib/lib@[email protected]
265-
lib/lib@[email protected]: $(OBJS) python_build sub_system
276+
fluidity_library: lib/lib$(FLUIDITY).a
277+
lib/lib$(FLUIDITY).a: $(OBJS) python_build sub_system
278+
@echo "INSTALL local scripts"
279+
@cd tools ; $(MAKE) scripts
266280
@echo "BUILD libfluidity"
267281
@echo " MKDIR lib"
268282
@mkdir -p lib
@@ -303,10 +317,10 @@ endif
303317
@echo " MAKE main"
304318
@cd main; $(MAKE)
305319
@echo " MAKE options_check"
306-
@./scripts/make_check_options
320+
@./tools/make_check_options.py
307321
@cd preprocessor; $(MAKE) check_options.o
308322
@echo " MAKE register_diagnostics"
309-
@./scripts/make_register_diagnostics
323+
@./tools/make_register_diagnostics.py
310324
@cd preprocessor; $(MAKE) register_diagnostics.o
311325
@echo " BUILDING fluidity_library"
312326
@$(AR) $(ARFLAGS) lib/libfluidity.a \
@@ -338,13 +352,6 @@ fldecomp: fluidity_library
338352
@mkdir -p bin
339353
@cd fldecomp; $(MAKE)
340354

341-
.PHONY: doc
342-
343-
doc:
344-
@mkdir -p doc
345-
./scripts/f90_extract_docs --dir=doc --project=fluidity */*.F90 --cppflags="$(FCLAGS) -I./include"
346-
@cp include/fortran.css doc/
347-
348355
all:
349356
$(MAKE) default
350357
$(MAKE) fltools
@@ -423,37 +430,75 @@ clean: clean-light clean-test python_clean
423430
@echo " CLEAN libwm"
424431
@cd libwm; $(MAKE) clean
425432
@CLEAN_LIBADAPT@
426-
@rm -fr doc include/*.mod *.cache core *.o config.status
433+
@rm -fr include/*.mod *.cache core *.o config.status
427434
@find ./ \( -name work.pc \) -exec rm {} \;
428435
@find ./ \( -name work.pcl \) -exec rm {} \;
429436

430437
clean-test:
431438
@echo " CLEAN tests"
432439
@cd tests; ../tools/testharness.py --clean >/dev/null
433440

434-
test: fltools bin/@FLUIDITY@ bin/shallow_water serialtest bin/burgers_equation
441+
distclean: clean
442+
@echo " DISTCLEAN"
443+
@cd spatialindex-1.5 ; make distclean > /dev/null ; rm -rf \
444+
make.log regressiontest/mvrtree/.deps \
445+
regressiontest/rtree/.deps regressiontest/tprtree/.deps > \
446+
/dev/null
447+
@cd libadaptivity ; make distclean > /dev/null
448+
@cd libjudy ; make distclean > /dev/null
449+
@cd libvtkfortran ; make distclean > /dev/null
450+
@cd libspud ; make distclean > /dev/null ; rm -rf \
451+
libspud.so.0 libtool diamond/build python/build > /dev/null
452+
@rm -fr `find ./ -name config.status` `find ./ -name \
453+
config.log` share include/Judy.h include/Wm4Command.h \
454+
include/Wm4FoundationLIB.h include/Wm4FoundationPCH.h \
455+
include/Wm4Intersector.h include/Wm4Intersector1.h \
456+
include/Wm4IntrBox3Box3.h include/Wm4IntrQuad2Quad2.h \
457+
include/Wm4IntrTetrahedron3Tetrahedron3.h \
458+
include/Wm4IntrTriangle2Triangle2.h \
459+
include/Wm4IntrUtility3.h include/Wm4LinComp.h \
460+
include/Wm4Math.h include/Wm4MathMCR.h include/Wm4Memory.h \
461+
include/Wm4Plane3.h include/Wm4Platforms.h \
462+
include/Wm4Quad2.h include/Wm4Segment3.h include/Wm4System.h \
463+
include/Wm4THashSet.h include/Wm4THashTable.h \
464+
include/Wm4TMinHeap.h include/Wm4TSmallUnorderedSet.h \
465+
include/Wm4TStringHashTable.h include/Wm4TTuple.h \
466+
include/Wm4Tetrahedron3.h include/Wm4Triangle2.h \
467+
include/Wm4Triangle3.h include/Wm4Vector2.h \
468+
include/Wm4Vector3.h include/confdefs.h include/config.h \
469+
include/spatialindex include/spud include/spud.h \
470+
include/spud_enums.h include/tinystr.h include/tinyxml.h \
471+
include/version.h include/vtk.h \
472+
preprocessor/check_options.F90 \
473+
preprocessor/register_diagnostics.F90 python/setup.py > \
474+
/dev/null
475+
@for i in `find ./*/ -name Makefile.in`; do rm -f `echo $$i | sed 's/.in$$//'`; done > /dev/null
476+
@find ./ \( -name make.log \) -exec rm -f {} \; > /dev/null
477+
@rm -f Makefile > /dev/null
478+
479+
test: fltools bin/$(FLUIDITY) bin/shallow_water serialtest bin/burgers_equation
435480

436481
serialtest:
437482
ifeq (@MBA2D@,yes)
438483
ifeq (@ZOLTAN@,yes)
439-
@cd tests; ../tools/testharness.py -l short -p serial -e nozoltan -n $(THREADS)
484+
@cd tests; ../bin/testharness -l short -p serial -e nozoltan -n $(THREADS)
440485
else
441-
@cd tests; ../tools/testharness.py -l short -p serial -e zoltan -n $(THREADS)
486+
@cd tests; ../bin/testharness -l short -p serial -e zoltan -n $(THREADS)
442487
endif
443488
else
444489
ifeq (@ZOLTAN@,yes)
445-
@cd tests; ../tools/testharness.py -l short -p serial -e "2dadapt nozoltan" -n $(THREADS)
490+
@cd tests; ../bin/testharness -l short -p serial -e "2dadapt nozoltan" -n $(THREADS)
446491
else
447-
@cd tests; ../tools/testharness.py -l short -p serial -e "2dadapt zoltan" -n $(THREADS)
492+
@cd tests; ../bin/testharness -l short -p serial -e "2dadapt zoltan" -n $(THREADS)
448493
endif
449494
endif
450495

451496
mediumtest: bin/burgers_equation
452-
@cd tests; ../tools/testharness.py -l medium $(EXCLUDE_TAGS) -n $(THREADS)
497+
@cd tests; ../bin/testharness -l medium $(EXCLUDE_TAGS) -n $(THREADS)
453498

454499
mediumzoltantest:
455500
ifeq (@ZOLTAN@,yes)
456-
@cd tests; ../tools/testharness.py -l medium -t zoltan -n $(THREADS)
501+
@cd tests; ../bin/testharness -l medium -t zoltan -n $(THREADS)
457502
else
458503
@echo "Warning: build did not have zoltan enabled, make mediumzoltantest will not run" -n $(THREADS)
459504
endif
@@ -488,11 +533,7 @@ build_unittest: fluidity_library libfemtools setuputs
488533

489534
unittest: build_unittest
490535
@echo "RUN bin/tests"
491-
@tools/unittestharness.py bin/tests
492-
493-
gcov:
494-
@echo "RUN gcov"
495-
@scripts/options_test_options_report.sh .
536+
@bin/unittestharness bin/tests
496537

497538
schema:
498539
@echo "Rebuilding schema fluidity_options.rng"
@@ -514,42 +555,47 @@ ifneq (@HAVE_ADJOINT@,yes)
514555
@false
515556
endif
516557
@echo " Generating debug dependencies"
517-
@cd debug; ../scripts/create_makefile.py $(TESTOPTS)
558+
@cd debug; ../bin/create_makefile $(TESTOPTS)
518559
@echo " Generating libwm dependencies"
519-
@cd libwm; ../scripts/create_makefile.py $(TESTOPTS)
560+
@cd libwm; ../bin/create_makefile $(TESTOPTS)
520561
@echo " Generating femtools dependencies"
521-
@cd femtools; ../scripts/create_makefile.py --exclude \
562+
@cd femtools; ../bin/create_makefile --exclude \
522563
"Refcount_interface_templates.F90 Refcount_templates.F90" $(TESTOPTS)
523564
@echo " Generating bathymetry dependencies"
524-
@cd bathymetry; ../scripts/create_makefile.py $(TESTOPTS)
565+
@cd bathymetry; ../bin/create_makefile $(TESTOPTS)
525566
@echo " Generating ocean_forcing dependencies"
526-
@cd ocean_forcing; ../scripts/create_makefile.py $(TESTOPTS)
567+
@cd ocean_forcing; ../bin/create_makefile $(TESTOPTS)
527568
@echo " Generating sediments dependencies"
528-
@cd sediments; ../scripts/create_makefile.py $(TESTOPTS)
569+
@cd sediments; ../bin/create_makefile $(TESTOPTS)
529570
@echo " Generating parameterisation dependencies"
530-
@cd parameterisation; ../scripts/create_makefile.py $(TESTOPTS)
571+
@cd parameterisation; ../bin/create_makefile $(TESTOPTS)
531572
@echo " Generating forward_interfaces dependencies"
532-
@cd forward_interfaces; ../scripts/create_makefile.py $(TESTOPTS)
573+
@cd forward_interfaces; ../bin/create_makefile $(TESTOPTS)
533574
@echo " Generating horizontal_adaptivity dependencies"
534-
@cd horizontal_adaptivity; ../scripts/create_makefile.py $(TESTOPTS)
575+
@cd horizontal_adaptivity; ../bin/create_makefile $(TESTOPTS)
535576
@echo " Generating preprocessor dependencies"
536-
@cd preprocessor; ../scripts/create_makefile.py --exclude \
577+
@cd preprocessor; ../bin/create_makefile --exclude \
537578
"register_diagnostics.F90 check_options.F90" $(TESTOPTS)
538579
@echo " Generating error_measures dependencies"
539-
@cd error_measures; ../scripts/create_makefile.py $(TESTOPTS)
580+
@cd error_measures; ../bin/create_makefile $(TESTOPTS)
540581
@echo " Generating assemble dependencies"
541-
@cd assemble; ../scripts/create_makefile.py $(TESTOPTS)
582+
@cd assemble; ../bin/create_makefile $(TESTOPTS)
542583
@echo " Generating diagnostics dependencies"
543-
@cd diagnostics; ../scripts/create_makefile.py --exclude \
584+
@cd diagnostics; ../bin/create_makefile --exclude \
544585
"Diagnostic_Fields_Interfaces.F90 Diagnostic_Fields_New.F90" $(TESTOPTS)
545586
@cd diagnostics; $(MAKE) Diagnostic_Fields_Interfaces.o \
546587
Diagnostic_Fields_New.o
547588
@echo " Generating reduced_modelling dependencies"
548-
@cd reduced_modelling; ../scripts/create_makefile.py $(TESTOPTS)
589+
@cd reduced_modelling; ../bin/create_makefile $(TESTOPTS)
549590
@echo " Generating adjoint dependencies"
550-
@cd adjoint; ../scripts/create_makefile.py $(TESTOPTS)
591+
@cd adjoint; ../bin/create_makefile $(TESTOPTS)
551592
@echo " Generating main dependencies"
552-
@cd main; ../scripts/create_makefile.py --exclude test_coupler.F90 $(TESTOPTS)
593+
@cd main; ../bin/create_makefile --exclude test_coupler.F90 $(TESTOPTS)
553594
@echo " Cleaning up the mess"
554595
$(MAKE) clean-light
555596
@echo " Congratulations, make makefiles succeeded!"
597+
598+
install:
599+
@mkdir -p $(DESTDIR)$(bindir)
600+
cp bin/* $(DESTDIR)$(bindir)
601+
cd python ; python setup.py install --root="${DESTDIR}" --prefix="$(prefix)"

VERSION

-1
This file was deleted.

adjoint/Makefile.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
# USA
2727
SHELL = @SHELL@
2828

29+
PACKAGE_NAME = @PACKAGE_NAME@
30+
FLUIDITY = $(PACKAGE_NAME)
31+
2932
FC = @FC@
3033
FCFLAGS = -I../include @MOD_FLAG@../include @CPPFLAGS@ @FCFLAGS@ -I/usr/local/include -I./
3134

@@ -41,7 +44,7 @@ MAKE = @MAKE@
4144
AR = @AR@
4245
ARFLAGS = @ARFLAGS@
4346

44-
LIB = ../lib/lib@FLUIDITY@.a
47+
LIB = ../lib/lib$(FLUIDITY).a
4548

4649
OBJS = $(patsubst %.F90,%.o,$(wildcard *.F90)) $(patsubst %.f90,%.o,$(wildcard *.f90)) $(patsubst %.c,%.o,$(wildcard *.c)) $(patsubst %.f,%.o,$(wildcard *.f))
4750

adjoint/tests/Makefile.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
# USA
2727
SHELL = @SHELL@
2828

29+
PACKAGE_NAME = @PACKAGE_NAME@
30+
FLUIDITY = $(PACKAGE_NAME)
31+
2932
FC = @FC@
3033
FCFLAGS = -I../../include @FCFLAGS@ @CPPFLAGS@ @MODINC_FLAG@../
3134

@@ -39,7 +42,7 @@ LDFLAGS = @LDFLAGS@
3942

4043
LIBS = ./lib/libadaptivity.a ./lib/libvtkfortran.a ./lib/libspatialindex.a ./lib/libspud.a ./lib/libjudy.a @LIBS@
4144
FLIBS = @FLIBS@
42-
LIBFLUIDITY=../../lib/lib@FLUIDITY@.a
45+
LIBFLUIDITY=../../lib/lib$(FLUIDITY).a
4346

4447
# the test binaries NOT to be built
4548
DISABLED_TESTS=

assemble/Makefile.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
# USA
2727
SHELL = @SHELL@
2828

29+
PACKAGE_NAME = @PACKAGE_NAME@
30+
FLUIDITY = $(PACKAGE_NAME)
31+
2932
FC = @FC@
3033
FCFLAGS = -I../include @MOD_FLAG@../include @CPPFLAGS@ @FCFLAGS@ -I/usr/local/include -I./
3134

@@ -41,7 +44,7 @@ MAKE = @MAKE@
4144
AR = @AR@
4245
ARFLAGS = @ARFLAGS@
4346

44-
LIB = ../lib/lib@FLUIDITY@.a
47+
LIB = ../lib/lib$(FLUIDITY).a
4548
OBJS = Momentum_Diagnostic_Fields.o \
4649
Momentum_Equation.o Momentum_CG.o \
4750
qmesh.o \

assemble/tests/Makefile.in

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
# USA
2727
SHELL = @SHELL@
2828

29+
PACKAGE_NAME = @PACKAGE_NAME@
30+
FLUIDITY = $(PACKAGE_NAME)
31+
2932
FC = @FC@
3033
FCFLAGS = -I../../include @FCFLAGS@ \
3134
@MODINC_FLAG@../
@@ -40,7 +43,7 @@ LDFLAGS = @LDFLAGS@
4043

4144
LIBS = ./lib/libadaptivity.a ./lib/libvtkfortran.a ./lib/libspatialindex.a ./lib/libspud.a ./lib/libjudy.a @LIBS@
4245
FLIBS = @FLIBS@
43-
LIBFLUIDITY=../../lib/lib@FLUIDITY@.a
46+
LIBFLUIDITY=../../lib/lib$(FLUIDITY).a
4447

4548
# the test binaries NOT to be built
4649
DISABLED_TESTS=test_mba_supermesh test_legacy_cv_faces test_lagrangian_remap test_adapt_mesh_mba3d test_pressure_solve test_matrix_free \
@@ -55,9 +58,9 @@ unittest: $(TEST_BINARIES) data
5558
data:
5659
cd ../../tests/data; \
5760
gmsh -3 cube_prismatic.geo; \
58-
../../scripts/gmsh2triangle cube_prismatic.msh; \
61+
../../bin/gmsh2triangle cube_prismatic.msh; \
5962
gmsh -3 cube_unstructured.geo; \
60-
../../scripts/gmsh2triangle cube_unstructured.msh; \
63+
../../bin/gmsh2triangle cube_unstructured.msh; \
6164
cd -
6265

6366

0 commit comments

Comments
 (0)