Commit 19e954a45ea46c43cbae54ed22c62d0446eff026

Authored by cwaterkeyn
1 parent 1258bdafaf

ChW : added modules (and submodules) targets into makefiles

- this is presently used for builds in Sophia under SunStudio :
  - insert the following line into SunStudio Makefile as pre-build code
	( export F95FLAGS=-m64 && export BTREE="$$(pwd)" && cd Sources && make modules && mv -f *.mod $$BTREE )
  - insert .WAIT in the build prerequisites between .build-pre and .build-impl
  - create a file Make.inc in the root of the project containing at least F95=f95
  - the project must contain the directory "Sources" which is at the same time the working directory of svn


git-svn-id: https://lxsd.femto-st.fr/svn/fvn@51 b657c933-2333-4658-acf2-d3c7c2708721

Showing 8 changed files with 56 additions and 7 deletions Side-by-side Diff

1 1  
2   -include $(BTREE)/Make.inc
  2 +include $(BTREE)/Make.inc #définir dans Make.inc une variable sophia, et prévoir F95FLAGS ad hoc pour compil et modules
3 3  
4 4  
  5 +ifdef SOPHIA
  6 +objects = fvnlib_sophia.o
  7 +else
5 8 objects = fvnlib.o
  9 +endif
  10 +modobjects = $(objects)
  11 +
6 12 library = libfvn$(libext)
7 13  
8 14 all: sub $(library)
9 15  
10 16  
11 17  
... ... @@ -12,11 +18,28 @@
12 18 ( cd fvn_linear && make && make install )
13 19 ( cd fvn_integ && make && make install )
14 20 ( cd fvn_interpol && make && make install )
  21 +ifndef SOPHIA
15 22 ( cd fvn_sparse && make && make install )
  23 +endif
16 24 ( cd fvn_fnlib && make && make install )
17 25 ( cd fvn_misc && make && make install )
18 26  
  27 +submodules:
  28 +#builds only modules local to fvn: go to sub-project, build sub-project modules, transfer them back here
  29 +#if sub-project depend on another, it is built after, and its proper make searches modules here, not in the install tree
  30 + ( cd fvn_common && make modules && mv *.mod .. )
  31 + ( cd fvn_linear && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
  32 + ( cd fvn_integ && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
  33 + ( cd fvn_interpol && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
  34 +ifndef SOPHIA
  35 + ( cd fvn_sparse && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
  36 +endif
  37 + ( cd fvn_fnlib && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
  38 + ( cd fvn_misc && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
19 39  
  40 +modules: submodules $(modobjects)
  41 + rm -f $(modobjects)
  42 +
20 43 clean:
21 44 rm -f {*.o,*.oo,*.ipo,*.a,*.mod}
22 45 ( cd fvn_common && make clean )
... ... @@ -34,7 +57,8 @@
34 57 %.o: %.f90
35 58 $(F95) $(F95FLAGS) -c $< -o $@
36 59  
37   -$(objects):fvnlib.f90
  60 +# cette ligne est elle utile et nécessaire?
  61 +#$(objects):fvnlib.f90
38 62  
39 63 $(library): $(objects) sub
40 64 $(AR) rcu $@ $(objects)
... ... @@ -5,7 +5,12 @@
5 5  
6 6 objects = fvn_common.o d1mach.o r1mach.o
7 7  
  8 +modobjects = fvn_common.o
  9 +
8 10 lib:$(objects)
  11 +
  12 +modules: $(modobjects)
  13 + rm -f $(modobjects)
9 14  
10 15 install:
11 16 cp fvn_common.mod $(BTREE)/modules
... ... @@ -63,7 +63,12 @@
63 63 besjn.o dbesyn.o dbesjn.o beskn.o \
64 64 besin.o dbeskn.o dbesin.o
65 65  
  66 +modobjects = fvn_fnlib.o
  67 +
66 68 lib:$(objects)
  69 +
  70 +modules: $(modobjects)
  71 + rm -f $(modobjects)
67 72  
68 73 install:
69 74 cp fvn_fnlib.mod $(BTREE)/modules
... ... @@ -2,8 +2,12 @@
2 2 include $(BTREE)/Make.inc
3 3  
4 4 objects = fvn_integ.o
  5 +modobjects = fvn_integ.o
5 6  
6 7 all: $(objects)
  8 +
  9 +modules: $(modobjects)
  10 + rm -f $(modobjects)
7 11  
8 12 clean:
9 13 rm -f {*.o,*.oo,*.ipo,*.a,*.mod}
fvn_interpol/Makefile
... ... @@ -2,8 +2,12 @@
2 2 include $(BTREE)/Make.inc
3 3  
4 4 objects = fvn_interpol.o
  5 +modobjects = fvn_interpol.o
5 6  
6 7 lib:$(objects)
  8 +
  9 +modules: $(modobjects)
  10 + rm -f $(modobjects)
7 11  
8 12 install:
9 13 cp fvn_interpol.mod $(BTREE)/modules
... ... @@ -2,8 +2,12 @@
2 2 include $(BTREE)/Make.inc
3 3  
4 4 objects = fvn_linear.o
  5 +modobjects = fvn_linear.o
5 6  
6 7 lib:$(objects)
  8 +
  9 +modules: $(modobjects)
  10 + rm -f $(modobjects)
7 11  
8 12 install:
9 13 cp fvn_linear.mod $(BTREE)/modules
... ... @@ -2,8 +2,12 @@
2 2 include $(BTREE)/Make.inc
3 3  
4 4 objects = fvn_misc.o
  5 +modobjects = fvn_misc.o
5 6  
6 7 lib:$(objects)
  8 +
  9 +modules: $(modobjects)
  10 + rm -f $(modobjects)
7 11  
8 12 install:
9 13 cp fvn_misc.mod $(BTREE)/modules
... ... @@ -2,11 +2,15 @@
2 2 include $(BTREE)/Make.inc
3 3  
4 4 objects = fvn_sparse.o umfpack_wrapper.o
  5 +modobjects = fvn_sparse.o
5 6  
6 7 all: suitesparse $(objects)
7 8  
8 9 suitesparse:
9 10 ( cd UMFPACK && make )
  11 +
  12 +modules: $(modobjects)
  13 + rm -f $(modobjects)
10 14  
11 15 clean:
12 16 ( cd AMD && make clean )