build: Use SHELL variable to execute commands in Vagrant.

This commit is contained in:
Rémi Bernon 2021-05-27 16:57:22 +02:00
parent 1e561a8bc0
commit 9283c7b50d
No known key found for this signature in database
GPG key ID: 38D0E5827B54E5C9

View file

@ -99,30 +99,42 @@ help:
@echo ""
@echo "Running out of disk space in the VM? See resize-vagrant-disk.sh"
VAGRANT_SHELL := vagrant ssh
vagrant: private SHELL := $(SHELL)
vagrant:
vagrant up
vagrant rsync debian10
clean: private SHELL := $(VAGRANT_SHELL)
clean: vagrant
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
rm -rf $(BUILD_DIR)/
protonsdk: private SHELL := $(VAGRANT_SHELL)
protonsdk: vagrant
vagrant ssh -c 'make -C proton/docker $(UNSTRIPPED) $(CCACHE_FLAG) PROTONSDK_VERSION=$(protonsdk_version) proton'
make -C proton/docker $(UNSTRIPPED) $(CCACHE_FLAG) PROTONSDK_VERSION=$(protonsdk_version) proton
configure: private SHELL := $(VAGRANT_SHELL)
configure: vagrant
@vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads'
if [ ! -e $(BUILD_DIR)/Makefile ]; \
then mkdir -p $(BUILD_DIR); \
(cd $(BUILD_DIR) && $(CONFIGURE_CMD)); \
fi && \
make -C $(BUILD_DIR) downloads
ifeq ($(protonsdk_version),local)
configure: protonsdk
endif
proton: private SHELL := $(VAGRANT_SHELL)
proton: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist'
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist && \
echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build."
install-internal: | vagrant_share/compatibilitytools.d/$(_build_name)
install-internal: private SHELL := $(VAGRANT_SHELL)
install-internal: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) STEAM_DIR=/vagrant/ install'
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) STEAM_DIR=/vagrant/ install
install: install-internal
mkdir -p $(STEAM_DIR)/compatibilitytools.d/
@ -130,60 +142,66 @@ install: install-internal
echo "Proton installed to your local Steam installation"
redist: | vagrant_share/$(DEPLOY_DIR)
redist: private SHELL := $(VAGRANT_SHELL)
redist: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && cp $(BUILD_DIR)/redist/* /vagrant/$(DEPLOY_DIR)'
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && cp $(BUILD_DIR)/redist/* /vagrant/$(DEPLOY_DIR) && \
echo "Proton build available at vagrant_share/$(DEPLOY_DIR)"
deploy: | vagrant_share/$(DEPLOY_DIR)-deploy
deploy: private SHELL := $(VAGRANT_SHELL)
deploy: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)-deploy'
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)-deploy && \
echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)-deploy"
module: | vagrant_share/$(module)/lib/wine/
module: | vagrant_share/$(module)/lib64/wine/
module: private SHELL := $(VAGRANT_SHELL)
module: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib64/wine/ && \
if [ -e $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so ]; then \
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module).so /vagrant/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so /vagrant/$(module)/lib64/wine/; \
fi'
rm -f vagrant_share/$(module)/lib*/wine/*.fake
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so /vagrant/$(module)/lib64/wine/ && \
rm -f /vagrant/$(module)/lib*/wine/*.fake
dxvk: | vagrant_share/dxvk/lib/wine/dxvk
dxvk: | vagrant_share/dxvk/lib64/wine/dxvk
dxvk: private SHELL := $(VAGRANT_SHELL)
dxvk: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/'
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/
vkd3d-proton: | vagrant_share/vkd3d-proton/lib/wine/vkd3d-proton
vkd3d-proton: | vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton
vkd3d-proton: private SHELL := $(VAGRANT_SHELL)
vkd3d-proton: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib/wine/vkd3d-proton/ && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/vkd3d-proton/'
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/vkd3d-proton/
lsteamclient: | vagrant_share/lsteamclient/lib/wine
lsteamclient: | vagrant_share/lsteamclient/lib64/wine
lsteamclient: private SHELL := $(VAGRANT_SHELL)
lsteamclient: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/wine'
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/wine
vrclient: | vagrant_share/vrclient/lib/wine
vrclient: | vagrant_share/vrclient/lib64/wine
vrclient: private SHELL := $(VAGRANT_SHELL)
vrclient: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/vrclient.dll.so /vagrant/vrclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vrclient_x64.dll.so /vagrant/vrclient/lib64/wine'
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vrclient_x64.dll.so /vagrant/vrclient/lib64/wine
wineopenxr: | vagrant_share/wineopenxr/lib/wine
wineopenxr: | vagrant_share/wineopenxr/lib64/wine
wineopenxr: private SHELL := $(VAGRANT_SHELL)
wineopenxr: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/wineopenxr.dll.so /vagrant/wineopenxr/lib64/wine'
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/wineopenxr.dll.so /vagrant/wineopenxr/lib64/wine
vagrant_share/%:
mkdir -p $@