# SHELL = /bin/sh RAYDIR=$(shell pwd) UN=$(shell echo ${USER}) HOST=$(shell echo `hostname`) EXEC=kdistribution_light.exe FOR=mpif77 MAKE=make #ARCH=-m486 -msparclite -mips3 # options pour une machine 32 bits #ARCH=-march=i686 -m64 # options pour un i686 en 64 bits ARCH=-m64 OPTI= -O3 -static #-fast WARNING= DEBUG= OSV=MacOSX OSTYPEV=$(shell echo ${OSTYPE}) ############################# # FFLAGS= -O # FFLAGS= -ff90 # FFLAGS= -ftrength-reduce (les loop vont plus vite cf gcc) # FFLAGS= -g -ftrenght-reduce (cf gcc option va unused corteu) ############################Mieux vaut ajuster par des directives de compilation ############################inserer dans le prog quand le compilateur le permet. FFLAGS = $(ARCH) $(OPTI) $(WARNING) $(IEEE) $(EMUL90) $(DEBUG) #################################################################################### # DIR is the path to source files directory # # OBJ is the path to object files directory # # SRC_PROG is the list of source files to be compiled # # INCLUDES is: -I+path to directory that contains 'include' files # #################################################################################### DIR=${RAYDIR}/source OBJ=${RAYDIR}/objects DAT=${RAYDIR}/data SRC_PROG = \ $(DIR)/acceleration.for \ $(DIR)/add_slash_if_absent.for \ $(DIR)/analyse_g.for \ $(DIR)/calc_rho.for \ $(DIR)/clean.for \ $(DIR)/cubic_spline.for \ $(DIR)/cubic_spline_function.for \ $(DIR)/cumulative.for \ $(DIR)/error.for \ $(DIR)/exec.for \ $(DIR)/findroots.for \ $(DIR)/g_inversion.for \ $(DIR)/gaussq.for \ $(DIR)/generate_kfile.for \ $(DIR)/get_nlines.for \ $(DIR)/idx2str.for \ $(DIR)/interpolation.for \ $(DIR)/look_for_errors.for \ $(DIR)/main.for \ $(DIR)/make_model.for \ $(DIR)/mean_tr.for \ $(DIR)/minmax.for \ $(DIR)/my_quadrature.for \ $(DIR)/navigation.for \ $(DIR)/num2str.for \ $(DIR)/read_data.for \ $(DIR)/read_ka.for \ $(DIR)/read_model.for \ $(DIR)/read_nu.for \ $(DIR)/read_options.for \ $(DIR)/sort.for \ $(DIR)/sort_gw.for \ $(DIR)/strlen.for \ $(DIR)/test_nan.for \ $(DIR)/test_procedure.for \ $(DIR)/tridiag.for \ $(DIR)/utils.for \ $(DIR)/write_kdist_results.for \ $(DIR)/write_quad_results.for INCLUDES= -I./includes #dependencies #quoi compiler ? OBJ_PROG=$(SRC_PROG:$(DIR)/%.for=$(OBJ)/%.o) #comment compiler ? $(OBJ)/%.o: $(DIR)/%.for $(FOR) $(FFLAGS) $(INCLUDES) -c -o $@ $(@:$(OBJ)/%.o=$(DIR)/%.for) to : read leurre touch * clean : @rm -f *.o $(OBJ)/*.o *.oub *.oup *.oug @rm -f *% @rm -f *~ @rm -f $(DIR)/*.~ @rm -f $(DIR)/*.*~ @rm -f tmp.tmp @rm -f *.sum @rm -f *.eps @rm -f *.ps @rm -f *.jpg @rm -f core @rm -f last.kumac @rm -f paw.metafile @rm -f core @touch core @chmod 000 core @chmod a+r core @echo 'Files have been removed' dat : @cd ./data;f0;make_data.exe @echo 'Program has been compiled' wipe : @rm -f *% @rm -f *~ @rm -f $(DIR)/*.~ @rm -f $(DIR)/*.*~ @rm -f tmp.tmp @rm -f *.sum @rm -f *.eps @rm -f *.ps @rm -f *.jpg @rm -f core @rm -f last.kumac @rm -f paw.metafile @rm -f core @touch core @chmod 000 core @echo 'Files have been removed' skel : clean rm -f $(EXEC) @echo 'Files have been removed' where : @echo Current directory: $(RAYDIR) @echo Source directory: $(DIR) info : @echo Host name: $(HOSTNAME) @echo Operating system: $(OSV) @echo Type of system: $(OSTYPEV) @echo User name: $(USER) @echo Special compilation options: $(SPEC) all : # @echo "UN="$(UN) # @echo "HOST="$(HOST) @echo $(DIR) @echo '------ Compilation -------' make -f Makefile allend allend : ray ray : $(OBJ_PROG) @echo '------ Edition de liens -------' $(FOR) -o $(EXEC) $(OBJ_PROG) $(SPEC) @echo '--- Use program ' $(EXEC) '(compiled for :' $(OSV) $(OSTYPEV) 'by:' $(USER) ')' @date > compdate.in # @echo 'ln -s ray' run : @$(EXEC) @echo 'Done' runmulti : @echo 'Differents MCM stationnaires' @echo '/!\Pousuivre si les fichiers *.in existent' @echo 'de 1 a 19' @echo '#! /bin/sh' > z1.txt @echo 'N=1' > z2.txt @echo 'FIN=19' > z3.txt read leurre cat z1.txt z2.txt z3.txt monlotmulti2_sstete.bat > monlotmulti2.bat rm z1.txt z2.txt z3.txt at now +0 minutes < monlotmulti.bat #outils pour debugger autres que print gbd : @echo 'gdb ou xxgdb (ray)' #outils pour profiling : optimisations scalaire (ou vectorielle) gprof : # @gprof -s -l ray.exe gmon.out > gprof_sl @gprof $(EXEC) gmon.out > gprof_sl @more gprof_sl edit : xemacs & save : @sauve.1d @echo 'done' shell : xterm man : make help help : @echo '|------------------------------------------|' @echo '|------------------------------------------|' @echo '| AIDE-MEMOIRE |' @echo '|------------------------------------------|' @echo '| help, edit, shell |' @echo '| gdb, gprof for debug |' @echo '|------------------------------------------|' @echo '| clean: remove (.o, *~, etc.) |' @echo '| skel: remove ' $(EXEC) ' |' @echo '| to, all, run, runmulti |' @echo '|------------------------------------------|'