• - 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

    cwaterkeyn
     
Makefile 2.19 KB
include $(BTREE)/Make.inc	#définir dans Make.inc une variable sophia, et prévoir F95FLAGS ad hoc pour compil et modules


ifdef SOPHIA
objects = fvnlib_sophia.o
else
objects = fvnlib.o
endif
modobjects = $(objects)

library = libfvn$(libext)

all: sub $(library)

sub:
		( cd fvn_common && make && make install )
		( cd fvn_linear && make && make install )
		( cd fvn_integ && make && make install )
		( cd fvn_interpol && make && make install )
ifndef SOPHIA
		( cd fvn_sparse && make && make install )
endif
		( cd fvn_fnlib && make && make install )
		( cd fvn_misc && make && make install )

submodules:
#builds only modules local to fvn: go to sub-project, build sub-project modules, transfer them back here
#if sub-project depend on another, it is built after, and its proper make searches modules here, not in the install tree
		( cd fvn_common && make modules && mv *.mod .. )
		( cd fvn_linear && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
		( cd fvn_integ && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
		( cd fvn_interpol && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
ifndef SOPHIA
		( cd fvn_sparse && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
endif
		( cd fvn_fnlib && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )
		( cd fvn_misc && make modules F95FLAGS="$(F95FLAGS) -M.." && mv *.mod .. )

modules: submodules $(modobjects)
		rm -f $(modobjects)

clean:
		rm -f {*.o,*.oo,*.ipo,*.a,*.mod}
		( cd fvn_common && make clean )
		( cd fvn_linear && make clean )
		( cd fvn_integ && make clean )
		( cd fvn_interpol && make clean )
		( cd fvn_sparse && make clean )
		( cd fvn_fnlib && make clean )
		( cd fvn_misc && make clean)

install:
		cp fvn.mod $(BTREE)/modules
		cp $(library) $(BTREE)/lib

%.o: %.f90
		$(F95) $(F95FLAGS) -c $< -o $@

# cette ligne est elle utile et nécessaire?
#$(objects):fvnlib.f90

$(library): $(objects) sub
		$(AR) rcu $@ $(objects)
		$(AR) ru $@ fvn_common/*.o
		$(AR) ru $@ fvn_linear/*.o
		$(AR) ru $@ fvn_integ/*.o
		$(AR) ru $@ fvn_interpol/*.o
		$(AR) ru $@ fvn_sparse/*.o
		$(AR) ru $@ fvn_sparse/AMD/Lib/*.o
		$(AR) ru $@ fvn_sparse/UMFPACK/Lib/*.o
		$(AR) ru $@ fvn_fnlib/*.o
		$(AR) ru $@ fvn_misc/*.o
		$(RANLIB) $@