Skip to content
Snippets Groups Projects
Commit a2bf8db5 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: makefile fixes

parent e54f5df3
Branches
Tags
1 merge request!540feat: install environment and push to buildcache with Makefile
MAKEFLAGS += -Orecurse
SPACK ?= spack
SPACK_INSTALL_FLAGS += --no-check-signature
export SPACK_COLOR = always
SPACK_ENV ?= dev
BUILDCACHE := $(SPACK_ENV)/cache
.PHONY: all clean
all: push
all: $(SPACK_ENV)/push
ifeq (,$(filter clean,$(MAKECMDGOALS)))
include ${SPACK_ENV}/spack.mk
include $(SPACK_ENV)/spack.mk
endif
${SPACK_ENV}/push: $(addprefix ${SPACK_ENV}/push/,$(SPACK_PACKAGE_IDS))
$(SPACK) buildcache update-index --directory $(BUILDCACHE)
$(SPACK_ENV)/push: $(addprefix $(SPACK_ENV)/push/,$($(SPACK_ENV)/SPACK_PACKAGE_IDS))
@mkdir -p $(BUILDCACHE)
$(foreach buildcache, $(BUILDCACHE), $(SPACK) buildcache update-index $(buildcache) ;)
${SPACK_ENV}/push/%: ${SPACK_ENV}/install/%
@mkdir -p $(dir $@)
$(foreach buildcache, $(BUILDCACHE), $(SPACK) buildcache create --allow-root --only=package --unsigned $(buildcache) /$(HASH);)
@touch $@
$(SPACK_ENV)/push/%: $(SPACK_ENV)/install/%
@mkdir -p $(dir $@)
$(foreach buildcache, $(BUILDCACHE), $(SPACK) buildcache create --allow-root --only=package --unsigned $(buildcache) /$(HASH) ;) # push $(SPEC)
@touch $@
${SPACK_ENV}/spack.lock: ${SPACK_ENV}/spack.yaml
$(SPACK) concretize --force
$(SPACK_ENV)/spack.lock: $(SPACK_ENV)/spack.yaml Makefile
$(SPACK) concretize --force --fresh
${SPACK_ENV}/spack.mk: ${SPACK_ENV}/spack.lock
$(SPACK) env depfile --output $@ --make-target-prefix ""
$(SPACK_ENV)/spack.mk: $(SPACK_ENV)/spack.lock Makefile
$(SPACK) env depfile --output $@ --make-prefix $(SPACK_ENV)
clean:
rm -rf ${SPACK_ENV}/spack.lock ${SPACK_ENV}/spack.mk
rm -rf $(SPACK_ENV)/spack.lock $(SPACK_ENV)/spack.mk
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment