2019-03-22 16:51:16 +03:00
|
|
|
#See help target below for documentation
|
|
|
|
|
|
|
|
ifeq ($(build_name),)
|
2019-04-29 20:17:03 +03:00
|
|
|
_build_name := $(shell git symbolic-ref --short HEAD 2>/dev/null)-local
|
|
|
|
else
|
|
|
|
_build_name := $(build_name)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(_build_name),)
|
2019-03-22 16:51:16 +03:00
|
|
|
$(error ERROR: Unable to auto-detect build name. Check out a branch or specify with "build_name=...")
|
|
|
|
endif
|
|
|
|
|
|
|
|
# remove special chars
|
2019-04-29 20:17:03 +03:00
|
|
|
override _build_name := $(shell echo $(_build_name) | tr -dc '[:alnum:] ._-')
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2020-11-05 10:49:33 +03:00
|
|
|
# make doesn't handle spaces well... replace them with underscores in paths
|
|
|
|
BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
|
2019-02-05 01:31:22 +03:00
|
|
|
STEAM_DIR := $(HOME)/.steam/root
|
2019-04-29 20:17:03 +03:00
|
|
|
|
|
|
|
ifeq ($(build_name),)
|
2021-06-02 18:24:56 +03:00
|
|
|
DEPLOY_DIR := $(shell git describe --tags --always --exclude proton-sdk*)
|
2019-04-29 20:17:03 +03:00
|
|
|
else
|
|
|
|
DEPLOY_DIR := $(_build_name)
|
|
|
|
endif
|
|
|
|
|
2020-08-17 18:06:22 +03:00
|
|
|
enable_ccache := 1
|
|
|
|
ifneq ($(enable_ccache),0)
|
|
|
|
CCACHE_FLAG := ENABLE_CCACHE=1
|
|
|
|
endif
|
|
|
|
|
2019-07-09 22:48:49 +03:00
|
|
|
ifneq ($(module),)
|
|
|
|
ifneq ($(findstring .,$(module)),)
|
|
|
|
MODULE_SFX :=
|
|
|
|
else
|
|
|
|
MODULE_SFX := .dll
|
|
|
|
endif
|
|
|
|
endif
|
2019-04-29 20:17:03 +03:00
|
|
|
|
2019-09-27 22:28:02 +03:00
|
|
|
ifneq ($(unstripped),)
|
|
|
|
UNSTRIPPED := UNSTRIPPED_BUILD=1
|
|
|
|
DEPLOY_DIR := $(DEPLOY_DIR)_unstripped
|
|
|
|
endif
|
|
|
|
|
2019-06-24 17:32:26 +03:00
|
|
|
CONFIGURE_CMD := ../proton/configure.sh \
|
2019-10-07 22:14:58 +03:00
|
|
|
--build-name="$(_build_name)"
|
2019-03-22 16:51:16 +03:00
|
|
|
|
2021-05-27 17:58:39 +03:00
|
|
|
ifneq ($(protonsdk_version),)
|
|
|
|
CONFIGURE_CMD += --proton-sdk-image=registry.gitlab.steamos.cloud/proton/soldier/sdk:$(protonsdk_version)
|
|
|
|
else
|
|
|
|
protonsdk_version := $(shell grep '^arg_protonsdk_image=' configure.sh|xargs echo|cut -d: -f2)
|
|
|
|
endif
|
|
|
|
|
2019-03-22 16:51:16 +03:00
|
|
|
|
|
|
|
all: help
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2021-01-12 16:31:00 +03:00
|
|
|
.PHONY: help vagrant clean configure proton install deploy module protonsdk
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2019-03-22 16:51:16 +03:00
|
|
|
help:
|
|
|
|
@echo "Proton Makefile instructions"
|
|
|
|
@echo ""
|
2019-10-18 18:41:20 +03:00
|
|
|
@echo "\"Quick start\" Makefile targets:"
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " install - Install Proton into current user's Steam installation"
|
2019-10-18 18:41:20 +03:00
|
|
|
@echo " redist - Build a package suitable for manual installation or distribution"
|
|
|
|
@echo " to other users in vagrant_share/ named after the nearest git tag"
|
|
|
|
@echo " deploy - Build Steam deployment files into a directory in vagrant_share/ named"
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " after the nearest git tag"
|
|
|
|
@echo " clean - Delete the Proton build directory"
|
|
|
|
@echo ""
|
|
|
|
@echo "Configuration variables:"
|
|
|
|
@echo " build_name - The name of the build, will be displayed in Steam. Defaults to"
|
|
|
|
@echo " current proton.git branch name if available. A new build dir"
|
|
|
|
@echo " will be created for each build_name, so if you override this,"
|
|
|
|
@echo " remember to always set it!"
|
2019-04-29 20:17:03 +03:00
|
|
|
@echo " Current build name: $(_build_name)"
|
2019-09-27 22:28:02 +03:00
|
|
|
@echo " unstripped - Set to non-empty to avoid stripping installed library files."
|
2020-08-17 18:06:22 +03:00
|
|
|
@echo " enable_ccache - Enabled by default, set to 0 to disable ccache."
|
2021-01-12 16:31:00 +03:00
|
|
|
@echo " protonsdk_version - Version of the proton sdk image to use for building,"
|
|
|
|
@echo " use protonsdk_version=local to build it locally."
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo ""
|
|
|
|
@echo "Development targets:"
|
|
|
|
@echo " vagrant - Start Vagrant VM"
|
|
|
|
@echo " configure - Configure Proton build directory"
|
|
|
|
@echo " proton - Build Proton"
|
2019-06-13 17:53:25 +03:00
|
|
|
@echo ""
|
|
|
|
@echo " The following targets are development targets only useful after building Proton."
|
|
|
|
@echo " module - Rebuild a single Wine module and copy into vagrant_share/."
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " Specify module variable: make module=kernel32 module"
|
2019-06-13 17:53:25 +03:00
|
|
|
@echo " dxvk - Rebuild DXVK and copy it into vagrant_share/."
|
|
|
|
@echo " lsteamclient - Rebuild the Steam client wrapper and copy it into vagrant_share/."
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo ""
|
|
|
|
@echo "Examples:"
|
2019-10-18 18:41:20 +03:00
|
|
|
@echo " make install - Build Proton and install into this user's Steam installation,"
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " with the current Proton branch name as the tool's name."
|
|
|
|
@echo ""
|
2019-10-18 18:41:20 +03:00
|
|
|
@echo " make redist - Build a Proton redistribution package in a tagged directory"
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " in vagrant_share/."
|
|
|
|
@echo ""
|
2019-10-18 18:41:20 +03:00
|
|
|
@echo " make build_name=mytest install - Build Proton with the tool name \"mytest\" and"
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " install into this user's Steam installation."
|
|
|
|
@echo ""
|
2019-10-18 18:41:20 +03:00
|
|
|
@echo " make build_name=mytest module=dsound module - Build only the dsound module"
|
2019-03-22 16:51:16 +03:00
|
|
|
@echo " in the \"mytest\" build directory and place it into vagrant_share/dsound/."
|
2019-10-03 16:36:01 +03:00
|
|
|
@echo ""
|
|
|
|
@echo "Running out of disk space in the VM? See resize-vagrant-disk.sh"
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2021-05-27 17:57:22 +03:00
|
|
|
VAGRANT_SHELL := vagrant ssh
|
|
|
|
|
|
|
|
vagrant: private SHELL := $(SHELL)
|
2019-02-05 01:31:22 +03:00
|
|
|
vagrant:
|
|
|
|
vagrant up
|
2019-10-04 16:16:29 +03:00
|
|
|
vagrant rsync debian10
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2021-05-27 17:57:22 +03:00
|
|
|
clean: private SHELL := $(VAGRANT_SHELL)
|
2019-03-22 16:21:45 +03:00
|
|
|
clean: vagrant
|
2021-05-27 17:57:22 +03:00
|
|
|
rm -rf $(BUILD_DIR)/
|
2019-03-22 16:21:45 +03:00
|
|
|
|
2021-05-27 17:57:22 +03:00
|
|
|
protonsdk: private SHELL := $(VAGRANT_SHELL)
|
2021-01-12 16:31:00 +03:00
|
|
|
protonsdk: vagrant
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C proton/docker $(UNSTRIPPED) $(CCACHE_FLAG) PROTONSDK_VERSION=$(protonsdk_version) proton
|
2021-01-12 16:31:00 +03:00
|
|
|
|
2021-05-27 17:57:22 +03:00
|
|
|
configure: private SHELL := $(VAGRANT_SHELL)
|
2019-03-22 16:21:45 +03:00
|
|
|
configure: vagrant
|
2021-05-27 17:57:22 +03:00
|
|
|
if [ ! -e $(BUILD_DIR)/Makefile ]; \
|
|
|
|
then mkdir -p $(BUILD_DIR); \
|
|
|
|
(cd $(BUILD_DIR) && $(CONFIGURE_CMD)); \
|
2021-04-02 14:21:07 +03:00
|
|
|
fi
|
2019-03-22 16:21:45 +03:00
|
|
|
|
2021-01-12 16:31:00 +03:00
|
|
|
ifeq ($(protonsdk_version),local)
|
|
|
|
configure: protonsdk
|
|
|
|
endif
|
|
|
|
|
2021-04-02 14:21:07 +03:00
|
|
|
downloads: private SHELL := $(VAGRANT_SHELL)
|
|
|
|
downloads: configure
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR) downloads
|
2021-04-02 14:21:07 +03:00
|
|
|
|
2021-05-27 17:57:22 +03:00
|
|
|
proton: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
proton: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist && \
|
2019-02-05 01:31:22 +03:00
|
|
|
echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build."
|
|
|
|
|
2021-04-02 13:12:50 +03:00
|
|
|
install-internal: | vagrant_share/compatibilitytools.d/$(_build_name)
|
2021-05-27 17:57:22 +03:00
|
|
|
install-internal: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
install-internal: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) STEAM_DIR=/vagrant/ install
|
2021-04-02 13:12:50 +03:00
|
|
|
|
|
|
|
install: install-internal
|
2019-03-25 16:59:24 +03:00
|
|
|
mkdir -p $(STEAM_DIR)/compatibilitytools.d/
|
2021-05-28 13:04:30 +03:00
|
|
|
rm -rf $(STEAM_DIR)/compatibilitytools.d/$(_build_name)/files/ #remove proton's internal files, but preserve user_settings etc from top-level
|
2020-07-15 21:55:28 +03:00
|
|
|
cp -Rf --no-dereference --preserve=mode,links vagrant_share/compatibilitytools.d/$(_build_name) $(STEAM_DIR)/compatibilitytools.d/
|
2019-02-05 01:31:22 +03:00
|
|
|
echo "Proton installed to your local Steam installation"
|
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
redist: | vagrant_share/$(DEPLOY_DIR)
|
2021-05-27 17:57:22 +03:00
|
|
|
redist: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
redist: downloads
|
2021-05-28 13:04:30 +03:00
|
|
|
rm -rf /vagrant/$(DEPLOY_DIR)/* && \
|
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && \
|
|
|
|
cp -Rf $(BUILD_DIR)/redist/* /vagrant/$(DEPLOY_DIR) && \
|
2019-10-18 18:41:20 +03:00
|
|
|
echo "Proton build available at vagrant_share/$(DEPLOY_DIR)"
|
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
deploy: | vagrant_share/$(DEPLOY_DIR)-deploy
|
2021-05-27 17:57:22 +03:00
|
|
|
deploy: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
deploy: downloads
|
2021-05-28 13:04:30 +03:00
|
|
|
rm -rf /vagrant/$(DEPLOY_DIR)-deploy/* && \
|
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) deploy && \
|
|
|
|
cp -Rf $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)-deploy && \
|
2019-10-18 18:41:20 +03:00
|
|
|
echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)-deploy"
|
2019-02-05 19:04:53 +03:00
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
module: | vagrant_share/$(module)/lib/wine/
|
|
|
|
module: | vagrant_share/$(module)/lib64/wine/
|
2021-05-27 17:57:22 +03:00
|
|
|
module: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
module: downloads
|
2021-05-27 20:13:23 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
|
2021-05-27 17:57:22 +03:00
|
|
|
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/ && \
|
2021-07-12 21:49:18 +03:00
|
|
|
if [ -e $(BUILD_DIR)/obj-wine32/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 && \
|
2021-05-27 17:57:22 +03:00
|
|
|
rm -f /vagrant/$(module)/lib*/wine/*.fake
|
2019-06-13 17:53:25 +03:00
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
dxvk: | vagrant_share/dxvk/lib/wine/dxvk
|
|
|
|
dxvk: | vagrant_share/dxvk/lib64/wine/dxvk
|
2021-05-27 17:57:22 +03:00
|
|
|
dxvk: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
dxvk: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
|
2021-05-28 13:04:30 +03:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/
|
2019-11-15 18:57:43 +03:00
|
|
|
|
2021-05-11 00:27:49 +03:00
|
|
|
dxvk-nvapi: | vagrant_share/dxvk-nvapi/lib/wine/nvapi
|
|
|
|
dxvk-nvapi: | vagrant_share/dxvk-nvapi/lib64/wine/nvapi
|
|
|
|
dxvk-nvapi: private SHELL := $(VAGRANT_SHELL)
|
|
|
|
dxvk-nvapi: downloads
|
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk-nvapi && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/nvapi/*.dll /vagrant/dxvk-nvapi/lib/wine/nvapi/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/nvapi/*.dll /vagrant/dxvk-nvapi/lib64/wine/nvapi/
|
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
vkd3d-proton: | vagrant_share/vkd3d-proton/lib/wine/vkd3d-proton
|
|
|
|
vkd3d-proton: | vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton
|
2021-05-27 17:57:22 +03:00
|
|
|
vkd3d-proton: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
vkd3d-proton: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
|
2021-05-28 13:04:30 +03:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib/wine/vkd3d-proton/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/vkd3d-proton/
|
2019-08-22 22:44:30 +03:00
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
lsteamclient: | vagrant_share/lsteamclient/lib/wine
|
|
|
|
lsteamclient: | vagrant_share/lsteamclient/lib64/wine
|
2021-05-27 17:57:22 +03:00
|
|
|
lsteamclient: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
lsteamclient: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \
|
2021-05-28 13:04:30 +03:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib/wine && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/wine
|
2019-07-13 13:14:10 +03:00
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
vrclient: | vagrant_share/vrclient/lib/wine
|
|
|
|
vrclient: | vagrant_share/vrclient/lib64/wine
|
2021-05-27 17:57:22 +03:00
|
|
|
vrclient: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
vrclient: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \
|
2021-05-28 13:04:30 +03:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/vrclient.dll.so /vagrant/vrclient/lib/wine && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vrclient_x64.dll.so /vagrant/vrclient/lib64/wine
|
2020-12-30 22:35:28 +03:00
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
wineopenxr: | vagrant_share/wineopenxr/lib/wine
|
|
|
|
wineopenxr: | vagrant_share/wineopenxr/lib64/wine
|
2021-05-27 17:57:22 +03:00
|
|
|
wineopenxr: private SHELL := $(VAGRANT_SHELL)
|
2021-04-02 14:21:07 +03:00
|
|
|
wineopenxr: downloads
|
2021-04-19 15:48:08 +03:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \
|
2021-05-28 13:04:30 +03:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/wineopenxr.dll.so /vagrant/wineopenxr/lib64/wine
|
2021-04-02 12:42:06 +03:00
|
|
|
|
2021-03-24 19:51:34 +03:00
|
|
|
battleye: | vagrant_share/battleye/v1/lib/wine
|
|
|
|
battleye: | vagrant_share/battleye/v1/lib64/wine
|
|
|
|
battleye: private SHELL := $(VAGRANT_SHELL)
|
|
|
|
battleye: downloads
|
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) battleye && \
|
|
|
|
cp -f $(BUILD_DIR)/dist-battleye/v1/lib/wine/beclient.dll.so /vagrant/battleye/v1/lib/wine && \
|
|
|
|
cp -f $(BUILD_DIR)/dist-battleye/v1/lib64/wine/beclient_x64.dll.so /vagrant/battleye/v1/lib64/wine
|
|
|
|
|
2021-04-02 12:42:06 +03:00
|
|
|
vagrant_share/%:
|
|
|
|
mkdir -p $@
|