# ---------------------------------------------------------------------- # # 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 external libraries, including KM3NeTROOT and AntaresDAQROOT; # 2/ make internal libraries, including lang, triggerROOT and jaanet; # 3/ make remainder. # # Steps 1/ and 2/ 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 # make KM3NeT_highQE # ---------------------------------------------------------------------- export JPP_DIR := $(shell pwd -L) export KM3NET_DATAFORMAT := $(JPP_DIR)/externals/km3net-dataformat 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.22.06.Linux-centos7-x86_64-gcc4.8.tar.gz DATAARTIFACT := http://sftp.km3net.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 \ externals/flux \ software/JAstronomy \ software/JLang \ software/JTrigger \ software/JReconstruction \ software/JDB \ software/JAcoustics \ software/JCompass \ 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 export PROJECT_NUMBER="$(GIT_VERSION)"; $(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 python3 $(JPP_DIR)/software/scripts/run_tests.py tests benchmarks: default examples DAQ python3 $(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 '/^# File/,/^# Finished Make/' \ | sed '/^# Not a target:/I,+1 d' \ | awk '{if ($$1 ~ "^[^.]*:") { sub(":","",$$1); print $$1 }}' \ | sort -u \ | tr '\n' ' ' @echo