freebsd-ports/science/cp2k/files/patch-makefiles_Makefile

96 lines
4.5 KiB
Text

--- makefiles/Makefile.orig 2018-09-04 19:11:12 UTC
+++ makefiles/Makefile
@@ -11,7 +11,7 @@ SHELL = /bin/sh
# also works fine
#
CP2KHOME := $(abspath $(PWD)/..)
-ARCH := local
+XARCH := local
export VERSION=sopt
MAKEFILE := $(CP2KHOME)/makefiles/Makefile
@@ -25,7 +25,7 @@ PRETTYOBJDIR := $(CP2KHOME)/obj/prettifi
DOXIFYOBJDIR := $(CP2KHOME)/obj/doxified
TOOLSRC := $(CP2KHOME)/tools
SRCDIR := $(CP2KHOME)/src
-EXEDIR := $(MAINEXEDIR)/$(ARCH)
+EXEDIR := $(MAINEXEDIR)/$(XARCH)
REVISION := $(shell $(CP2KHOME)/tools/build_utils/get_revision_number $(SRCDIR))
@@ -39,10 +39,10 @@ EXE_NAMES := $(basename $(notdir $(ALL_E
# this only happens on stage 3 and 4
ifneq ($(ONEVERSION),)
MODDEPS = "lower"
-include $(CP2KHOME)/arch/$(ARCH).$(ONEVERSION)
-LIBDIR := $(MAINLIBDIR)/$(ARCH)/$(ONEVERSION)
-OBJDIR := $(MAINOBJDIR)/$(ARCH)/$(ONEVERSION)
-TSTDIR := $(MAINTSTDIR)/$(ARCH)/$(ONEVERSION)
+include $(CP2KHOME)/arch/$(XARCH).$(ONEVERSION)
+LIBDIR := $(MAINLIBDIR)/$(XARCH)/$(ONEVERSION)
+OBJDIR := $(MAINOBJDIR)/$(XARCH)/$(ONEVERSION)
+TSTDIR := $(MAINTSTDIR)/$(XARCH)/$(ONEVERSION)
ifeq ($(NVCC),)
EXE_NAMES := $(basename $(notdir $(filter-out %.cu, $(ALL_EXE_FILES))))
endif
@@ -130,7 +130,7 @@ all: dirs makedep
# foreground testing, compilation happens in do_regtest
test: dirs
- cd $(TSTDIR); $(TOOLSRC)/regtesting/do_regtest -nosvn -quick -arch $(ARCH) -version $(ONEVERSION) -cp2kdir ../../../ $(TESTOPTS)
+ cd $(TSTDIR); $(TOOLSRC)/regtesting/do_regtest -nosvn -quick -arch $(XARCH) -version $(ONEVERSION) -cp2kdir ../../../ $(TESTOPTS)
# background testing, compilation happens here
testbg: dirs makedep all
@@ -191,7 +191,7 @@ $(LIBDIR)/libcp2k$(ARCHIVE_EXT) : $(ALL_
testbg:
@echo "testing: $(ONEVERSION) : full log in $(TSTDIR)/regtest.log "
- @$(TOOLSRC)/regtesting/do_regtest -nobuild -nosvn -arch $(ARCH) -version $(ONEVERSION) -cp2kdir ../../../ $(TESTOPTS) >& $(TSTDIR)/regtest.log
+ @$(TOOLSRC)/regtesting/do_regtest -nobuild -nosvn -arch $(XARCH) -version $(ONEVERSION) -cp2kdir ../../../ $(TESTOPTS) >& $(TSTDIR)/regtest.log
@cat `grep 'regtesting location error_summary file:' $(TSTDIR)/regtest.log | awk '{print $$NF}'`
@cat `grep 'regtesting location summary file:' $(TSTDIR)/regtest.log | awk '{print $$NF}'`
@grep "Number of FAILED tests 0" $(TSTDIR)/regtest.log >& /dev/null
@@ -244,9 +244,9 @@ define get_extensions
endef
clean:
rm -rf $(LIBCUSMM_ABS_DIR)/libcusmm.cu $(LIBCUSMM_ABS_DIR)/libcusmm_part*.cu
- @echo rm -rf $(foreach v, $(VERSION), $(MAINOBJDIR)/$(ARCH)/$(v))
- @$(foreach v, $(VERSION), $(foreach ext, $(call get_extensions, $(MAINOBJDIR)/$(ARCH)/$(v)/), $(shell rm -rf $(MAINOBJDIR)/$(ARCH)/$(v)/*.$(ext))))
- rm -rf $(foreach v, $(VERSION), $(MAINLIBDIR)/$(ARCH)/$(v))
+ @echo rm -rf $(foreach v, $(VERSION), $(MAINOBJDIR)/$(XARCH)/$(v))
+ @$(foreach v, $(VERSION), $(foreach ext, $(call get_extensions, $(MAINOBJDIR)/$(XARCH)/$(v)/), $(shell rm -rf $(MAINOBJDIR)/$(XARCH)/$(v)/*.$(ext))))
+ rm -rf $(foreach v, $(VERSION), $(MAINLIBDIR)/$(XARCH)/$(v))
OTHER_HELP += "clean : Remove intermediate object and mod files, but not the libraries and executables, for given ARCH and VERSION"
execlean:
@@ -258,16 +258,16 @@ OTHER_HELP += "execlean : Remove the exe
# Use this if you want to fully rebuild an executable (for a given compiler and or VERSION)
#
realclean: clean execlean
- rm -rf $(foreach v, $(VERSION), $(MAINOBJDIR)/$(ARCH)/$(v))
- rm -rf $(foreach v, $(VERSION), $(MAINLIBDIR)/$(ARCH)/$(v))
+ rm -rf $(foreach v, $(VERSION), $(MAINOBJDIR)/$(XARCH)/$(v))
+ rm -rf $(foreach v, $(VERSION), $(MAINLIBDIR)/$(XARCH)/$(v))
OTHER_HELP += "realclean : Remove all files for given ARCH and VERSION"
testclean:
- rm -rf $(foreach v, $(VERSION), $(MAINTSTDIR)/$(ARCH)/$(v)/TEST-*)
+ rm -rf $(foreach v, $(VERSION), $(MAINTSTDIR)/$(XARCH)/$(v)/TEST-*)
OTHER_HELP += "testclean : Remove all TEST-* files for given ARCH and VERSION"
testrealclean: testclean
- rm -rf $(foreach v, $(VERSION), $(MAINTSTDIR)/$(ARCH)/$(v)/LAST-*)
+ rm -rf $(foreach v, $(VERSION), $(MAINTSTDIR)/$(XARCH)/$(v)/LAST-*)
OTHER_HELP += "testrealclean : Remove all LAST-* and TEST-* files for given ARCH and VERSION"
#
@@ -426,7 +426,7 @@ endif
# some practical variables for the build
ifeq ($(CPPSHELL),)
-CPPSHELL := -D__COMPILE_ARCH="\"$(ARCH)\""\
+CPPSHELL := -D__COMPILE_ARCH="\"$(XARCH)\""\
-D__COMPILE_DATE="\"$(shell date)\""\
-D__COMPILE_HOST="\"$(shell hostname)\""\
-D__COMPILE_REVISION="\"$(strip $(REVISION))\""\