freebsd-ports/science/cp2k/files/patch-Makefile
2022-07-11 21:10:08 -07:00

106 lines
4.7 KiB
Text

--- Makefile.orig 2022-07-08 20:23:24 UTC
+++ Makefile
@@ -11,7 +11,7 @@ CP2KHOME := $(abspath $(shell pwd))
export CP2KHOME
endif
-ARCH := local
+XARCH := local
export VERSION=ssmp
MAKEFILE := $(CP2KHOME)/Makefile
@@ -26,7 +26,7 @@ PRETTYOBJDIR := $(CP2KHOME)/obj/prettified
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))
EXTSDIR := exts
@@ -48,15 +48,15 @@ EXE_NAMES := $(basename $(notdir $(ALL_EXE_FILES)))
# this only happens on stage 3 and 4
ifneq ($(ONEVERSION),)
MODDEPS = "lower"
-include $(ARCHDIR)/$(ARCH).$(ONEVERSION)
-LIBDIR := $(MAINLIBDIR)/$(ARCH)/$(ONEVERSION)
+include $(ARCHDIR)/$(XARCH).$(ONEVERSION)
+LIBDIR := $(MAINLIBDIR)/$(XARCH)/$(ONEVERSION)
PKGCONFIGDIR := $(LIBDIR)/pkgconfig
PKGCONFIG := $(PKGCONFIGDIR)/libcp2k.pc
LIBEXTSDIR := $(LIBDIR)/$(EXTSDIR)
-OBJDIR := $(MAINOBJDIR)/$(ARCH)/$(ONEVERSION)
+OBJDIR := $(MAINOBJDIR)/$(XARCH)/$(ONEVERSION)
OBJEXTSDIR := $(OBJDIR)/$(EXTSDIR)
OBJEXTSINCL := $(foreach dir,$(EXTSPACKAGES),-I'$(OBJEXTSDIR)/$(dir)')
-TSTDIR := $(MAINTSTDIR)/$(ARCH)/$(ONEVERSION)
+TSTDIR := $(MAINTSTDIR)/$(XARCH)/$(ONEVERSION)
ifneq ($(LD_SHARED),)
ARCHIVE_EXT := .so
else
@@ -144,7 +144,7 @@ all: makedep | dirs exts
# compilation for testing happens here
test: dirs makedep all
- @$(TOOLSRC)/regtesting/print_environment.sh $(ARCH) $(ONEVERSION)
+ @$(TOOLSRC)/regtesting/print_environment.sh $(XARCH) $(ONEVERSION)
@+$(MAKE) --no-print-directory -C $(TSTDIR) -f $(MAKEFILE) test INCLUDE_DEPS=true
testbg: dirs makedep all
@@ -250,11 +250,11 @@ $(EXEDIR)/cp2k_shell.$(ONEVERSION): $(EXEDIR)/cp2k.$(O
cd $(EXEDIR); ln -sf cp2k.$(ONEVERSION) cp2k_shell.$(ONEVERSION)
test:
- @$(TOOLSRC)/regtesting/do_regtest.py $(ARCH) $(ONEVERSION) $(TESTOPTS)
+ @$(TOOLSRC)/regtesting/do_regtest.py $(XARCH) $(ONEVERSION) $(TESTOPTS)
testbg:
@echo "testing: $(ONEVERSION) : full log in $(TSTDIR)/regtest.log "
- @$(TOOLSRC)/regtesting/do_regtest.py $(ARCH) $(ONEVERSION) $(TESTOPTS) > $(TSTDIR)/regtest.log 2>&1
+ @$(TOOLSRC)/regtesting/do_regtest.py $(XARCH) $(ONEVERSION) $(TESTOPTS) > $(TSTDIR)/regtest.log 2>&1
@grep -e "Summary:" -e "Status:" $(TSTDIR)/regtest.log
endif
@@ -307,9 +307,9 @@ define get_extensions
$(shell test -d $(1) && find $(1) -type f -name "*.*" ! -name "*.gcda" | sed 's|.*\.||' | sort -u)
endef
clean:
- @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"
# The Intel compiler creates a corresponding .dbg file for each executable when static linking of the Intel MPI library is requested (flag -static_mpi)
@@ -323,16 +323,16 @@ OTHER_HELP += "execlean : Remove the executables, for
# Use this if you want to fully rebuild an executable (for a given compiler and or VERSION)
#
realclean: extclean 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"
#
@@ -499,7 +499,7 @@ FORCE: ;
cp2k_info.o: $(GIT_REF)
# Add some practical metadata about the build.
-FCFLAGS += -D__COMPILE_ARCH="\"$(ARCH)\""\
+FCFLAGS += -D__COMPILE_ARCH="\"$(XARCH)\""\
-D__COMPILE_DATE="\"$(shell date)\""\
-D__COMPILE_HOST="\"$(shell hostname 2>/dev/null || hostnamectl --transient)\""\
-D__COMPILE_REVISION="\"$(strip $(REVISION))\""\