# # Compilation makefile of CERN FLUKA (binary distribution) # # author: Luigi.Salvatore.Esposito@cern.ch # date: 22.08.2019 # FLUKA := $(dir $(shell pwd)) NAME := fluka EXEC := ${FLUKA}/bin/${NAME} EXECDPM := ${FLUKA}/bin/${NAME}dpm SUBDIRS := tools include config.mk include rules.mk EXECS := ${EXEC} ifneq (${DPM}, no) EXECS += ${EXECDPM} endif # Interface object files for RQMD/DPMET are returned by fluka-config # This way an error is raised at compilation if any of those files # is accidentaly missing CONFIG=${FLUKA}/bin/fluka-config INTOBJS=$(shell ${CONFIG} --intobjs) # ******* TARGETS ******** .PHONY: all clean all: ${EXECS} tools # Compile subdirectories ${SUBDIRS}: FORCE @echo @echo "# Compiling: $@" @${MAKE} -C $@ FLUKA=${FLUKA} # make default executable ${EXEC}: ${FC} -o $@ ${LFLAGS} -L${LIBPATH} ${LIB} @echo "# Created" $@ # make executable including dpmjet + rqmd # note the order of the libraries: RQMD, FLUKA, DPMJET ${EXECDPM}: ${FC} -o $@ ${LFLAGS} ${INTOBJS} -L${LIBPATH} ${LIBRQMD} ${LIB} ${LIBDPM} @echo "# Created" $@ # ***************************************************************************** # Phony targets for helping compilation # ***************************************************************************** # Phony target to force entering in all subdirectories .PHONY: FORCE FORCE: # Clean everything .PHONY: clean clean: rm -f ${EXECS} for d in ${SUBDIRS}; do ${MAKE} -C $$d FLUKA=${FLUKA} clean; done .PHONY: help help: @echo @echo "FLUKA_CERN makefile" @echo @echo "Targets:" @echo " compile programs" @echo " clean clean up" @echo " help print this screen" @echo @echo "Options:" # @echo " COMP=[clang|c++] compiler choice (Default c++)" # @echo " DESTDIR=[path] where to install (Default /usr/local/flair)" # @echo " DUMP=[no|yes] enable extra printout information (Default no)" # @echo " TARGET=i386|i686|x86_64|android" # @echo " architecture to compile for (Default system depended)" @echo @echo "Systems and compiler supported:" @echo " Linux gfortran" @echo " Mac OS/X gfortran" # @echo " Windows cygwin gfortran" @echo @echo "Example:" @echo " To compile the program with gfortran" @echo " make" @echo @echo "Useful make options:" @echo " -j nnn To compile in parallel using (nnn) cores" @echo " -B To force recompiling everything" @echo @echo "author: Luigi.Salvatore.Esposito@cern.ch" @echo