# ---------------------------------------------------------------------- # # Top level make procedure. # # By default, the make procedure compiles, links and installs # all executable and library files. # # The make procedures proceeds in four steps, namely: # 1/ make primary internal libraries, including lang, KM3NeTDAQROOT and triggerROOT; # 2/ make external libraries, including aa and AntaresDAQROOT; # 3/ make secondary internal libraries, including jaanet; # 4/ make remainder. # # Steps 1/, 2/ and 3/ are handled with a separate target "libs". # # The target "examples" can be used to compile all examples. # # The target "DAQ" is available for installing only DAQ software. # # The default make procedure compiles all applications for KM3NeT. # A project specific installation can be made by: # # make Antares # make KM3NeT # ---------------------------------------------------------------------- JPP_DIR := $(shell pwd -L) include $(JPP_DIR)/make/JMakedefines .PHONY: default info tag examples libs DAQ doc documents mainpage doxygen clean distclean init install help print .NOTPARALLEL: # Handle options: # - if make is called with -k (keep-going), then the bash for loop should reflect that setting. ifneq (,$(findstring k,$(MAKEFLAGS))) BASH_STOP := "false" else BASH_STOP := "true" endif # wget DAQROOT := https://root.cern/download/root_v6.20.04.Linux-centos7-x86_64-gcc4.8.tar.gz DATAARTIFACT := http://pi1139.physik.uni-erlangen.de/data/latest/ # Make default default: info libs @for dir in software/*; do \ if [ -f $${dir}/Makefile ]; then \ $(MAKE) $(MFLAGS) -C $${dir} $@ || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ fi \ done info: @uname -a > $(INFO) @echo "GIT $(GIT_VERSION)" >> $(INFO) @echo "commit $(GIT_COMMIT)" >> $(INFO) @$(CXX) --version | head -1 >> $(INFO) @echo -n "ROOT " >> $(INFO) @root-config --version >> $(INFO) @echo "namespace $(NAMESPACE)" >> $(INFO) @cat $(INFO) tag: @echo "GIT $(GIT_VERSION)" print: $(foreach var, $(.VARIABLES), $(info $(var) = $($(var)))) @echo -n print-libs: $(foreach var, $(filter %_LIBS, $(.VARIABLES)), $(info $(var) = $($(var)))) @echo -n print-flags: $(foreach var, $(filter %FLAGS, $(.VARIABLES)), $(info $(var) = $($(var)))) @echo -n # Make examples examples: libs @for dir in examples/*; do \ if [ -f $${dir}/Makefile ]; then \ $(MAKE) $(MFLAGS) -C $${dir} $@ || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ fi \ done # Make libraries (order matters) libs: @for dir in \ externals/km3net-dataformat \ externals/antares-dataformat \ externals/dbclient \ software/JAstronomy \ software/JLang \ software/JTrigger \ software/JReconstruction \ software/JDB \ software/JAcoustics \ software/JAAnet; do \ $(MAKE) $(MFLAGS) -C $${dir} $@ || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ done # Make DAQ (order matters) DAQ: @for dir in \ externals/chsm; do \ $(MAKE) $(MFLAGS) -C $${dir} install || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ done @for dir in \ externals/km3net-dataformat \ software/JLang \ software/JTrigger; do \ $(MAKE) $(MFLAGS) -C $${dir} libs || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ done @for dir in \ software/JNet \ software/JLogger; do \ $(MAKE) $(MFLAGS) -C $${dir} || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ done @for dir in \ software/JRuncontrol \ software/*; do \ if [ -f $${dir}/$(MAKEFILE_DAQ) ]; then \ $(MAKE) $(MFLAGS) -C $${dir} -f $(MAKEFILE_DAQ) || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ fi \ done # Make documentation doc: doxygen doxygen: mainpage $(MKDIR) $(JPP_DOC) $(RM) -R $(JPP_DOC)/html $(DOXYGEN) Doxyfile mainpage: documents $(MKDIR) $(JPP_OUT) $(JPP_DIR)/software/scripts/doxygen.sh > $(JPP_OUT)/mainpage.dox documents: $(MKDIR) $(JPP_DOC) @for dir in documentation/*; do \ $(MAKE) $(MFLAGS) -C $${dir} doc || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ done # Make initialisation (this may take ~24h) init: default JMakePDF.sh -W $(JPP_DATA) -PMCc # Make installation install: default JMakePDF.sh -W $(JPP_DATA) -w $(DATAARTIFACT) -C JDetector.sh # Make tests and benchmarks tests: default examples DAQ python $(JPP_DIR)/software/scripts/run_tests.py tests benchmarks: default examples DAQ python $(JPP_DIR)/software/scripts/run_tests.py benchmarks test: tests # Make clean clean: @for dir in externals/* software/* examples/* documentation/* tests/*; do \ if [ -f $${dir}/Makefile ] || [ -f $${dir}/GNUmakefile ]; then \ $(MAKE) $(MFLAGS) -C $${dir} $@ || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ elif [ -f $${dir}/$(MAKEFILE_DAQ) ]; then \ $(MAKE) $(MFLAGS) -C $${dir} -f $(MAKEFILE_DAQ) $@ || if [ "true" = "$(BASH_STOP)" ]; then exit 1;fi \ fi \ done # Make distribution clean distclean: clean $(RM) -R $(JPP_OUT) $(RM) -R $(JPP_DOC) help: @echo -n "Possible targets: " @$(MAKE) -pRrq : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make/ {if ($$1 !~ "^[#.]") { print $$1 }}' | sort | tr '\n' ' ' @echo