2019-03-22 14:51:16 +01:00
|
|
|
#See help target below for documentation
|
|
|
|
|
|
|
|
ifeq ($(build_name),)
|
2019-04-29 19:17:03 +02: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 14:51:16 +01: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 19:17:03 +02:00
|
|
|
override _build_name := $(shell echo $(_build_name) | tr -dc '[:alnum:] ._-')
|
2019-02-04 23:31:22 +01:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
BUILD_ROOT := build
|
|
|
|
|
2020-11-05 08:49:33 +01:00
|
|
|
# make doesn't handle spaces well... replace them with underscores in paths
|
2021-12-22 17:36:28 +01:00
|
|
|
BUILD_DIR := $(BUILD_ROOT)/build-$(shell echo $(_build_name) | sed -e 's/ /_/g')
|
2019-02-04 23:31:22 +01:00
|
|
|
STEAM_DIR := $(HOME)/.steam/root
|
2019-04-29 19:17:03 +02:00
|
|
|
|
|
|
|
ifeq ($(build_name),)
|
2021-06-02 17:24:56 +02:00
|
|
|
DEPLOY_DIR := $(shell git describe --tags --always --exclude proton-sdk*)
|
2019-04-29 19:17:03 +02:00
|
|
|
else
|
|
|
|
DEPLOY_DIR := $(_build_name)
|
|
|
|
endif
|
|
|
|
|
2019-07-09 21:48:49 +02:00
|
|
|
ifneq ($(module),)
|
2022-03-16 16:25:18 +01:00
|
|
|
ifneq ($(findstring .drv,$(module)),)
|
|
|
|
MODULE_PEFILE := $(module)
|
|
|
|
MODULE_SOFILE := $(subst .drv,.so,$(module))
|
|
|
|
else ifneq ($(findstring .sys,$(module)),)
|
|
|
|
MODULE_PEFILE := $(module)
|
|
|
|
MODULE_SOFILE := $(subst .sys,.so,$(module))
|
|
|
|
else
|
|
|
|
MODULE_PEFILE := $(module).dll
|
|
|
|
MODULE_SOFILE := $(module).so
|
|
|
|
endif
|
2019-07-09 21:48:49 +02:00
|
|
|
endif
|
2019-04-29 19:17:03 +02:00
|
|
|
|
2019-09-27 21:28:02 +02:00
|
|
|
ifneq ($(unstripped),)
|
|
|
|
UNSTRIPPED := UNSTRIPPED_BUILD=1
|
|
|
|
DEPLOY_DIR := $(DEPLOY_DIR)_unstripped
|
|
|
|
endif
|
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
CONFIGURE_CMD := ../../configure.sh \
|
2019-10-07 21:14:58 +02:00
|
|
|
--build-name="$(_build_name)"
|
2019-03-22 14:51:16 +01:00
|
|
|
|
2021-05-27 16:58:39 +02: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
|
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
enable_ccache := 1
|
|
|
|
ifneq ($(enable_ccache),0)
|
|
|
|
CONFIGURE_CMD += --enable-ccache
|
|
|
|
endif
|
2019-03-22 14:51:16 +01:00
|
|
|
|
2022-12-16 10:23:03 +01:00
|
|
|
TOPLEVELGOALS := all any clean configure deploy downloads help install module proton protonsdk redist
|
|
|
|
CONTAINERGOALS := $(filter-out $(TOPLEVELGOALS),$(MAKECMDGOALS))
|
|
|
|
CONTAINERGOALS := $(filter-out $(BUILD_ROOT)/%,$(CONTAINERGOALS))
|
2019-02-04 23:31:22 +01:00
|
|
|
|
2022-12-16 10:23:03 +01:00
|
|
|
all: help
|
|
|
|
.PHONY: $(TOPLEVELGOALS)
|
2019-02-04 23:31:22 +01:00
|
|
|
|
2019-03-22 14:51:16 +01:00
|
|
|
help:
|
|
|
|
@echo "Proton Makefile instructions"
|
|
|
|
@echo ""
|
2019-10-18 17:41:20 +02:00
|
|
|
@echo "\"Quick start\" Makefile targets:"
|
2019-03-22 14:51:16 +01:00
|
|
|
@echo " install - Install Proton into current user's Steam installation"
|
2019-10-18 17:41:20 +02:00
|
|
|
@echo " redist - Build a package suitable for manual installation or distribution"
|
2021-12-22 17:36:28 +01:00
|
|
|
@echo " to other users in $(BUILD_ROOT)/ named after the nearest git tag"
|
|
|
|
@echo " deploy - Build Steam deployment files into a directory in $(BUILD_ROOT)/ named"
|
2019-03-22 14:51:16 +01: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 19:17:03 +02:00
|
|
|
@echo " Current build name: $(_build_name)"
|
2019-09-27 21:28:02 +02:00
|
|
|
@echo " unstripped - Set to non-empty to avoid stripping installed library files."
|
2021-12-22 21:16:25 +01:00
|
|
|
@echo " enable_ccache - Enabled by default, set to 0 prior to configuring to disable ccache."
|
2021-01-12 14:31:00 +01: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 14:51:16 +01:00
|
|
|
@echo ""
|
|
|
|
@echo "Development targets:"
|
|
|
|
@echo " configure - Configure Proton build directory"
|
|
|
|
@echo " proton - Build Proton"
|
2019-06-13 16:53:25 +02:00
|
|
|
@echo ""
|
|
|
|
@echo " The following targets are development targets only useful after building Proton."
|
2021-12-22 17:36:28 +01:00
|
|
|
@echo " module - Rebuild a single Wine module and copy into $(BUILD_ROOT)/<module>/."
|
2019-03-22 14:51:16 +01:00
|
|
|
@echo " Specify module variable: make module=kernel32 module"
|
2021-12-22 17:36:28 +01:00
|
|
|
@echo " dxvk - Rebuild DXVK and copy it into $(BUILD_ROOT)/."
|
|
|
|
@echo " lsteamclient - Rebuild the Steam client wrapper and copy it into $(BUILD_ROOT)/."
|
2019-03-22 14:51:16 +01:00
|
|
|
@echo ""
|
|
|
|
@echo "Examples:"
|
2019-10-18 17:41:20 +02:00
|
|
|
@echo " make install - Build Proton and install into this user's Steam installation,"
|
2019-03-22 14:51:16 +01:00
|
|
|
@echo " with the current Proton branch name as the tool's name."
|
|
|
|
@echo ""
|
2019-10-18 17:41:20 +02:00
|
|
|
@echo " make redist - Build a Proton redistribution package in a tagged directory"
|
2021-12-22 17:36:28 +01:00
|
|
|
@echo " in $(BUILD_ROOT)/."
|
2019-03-22 14:51:16 +01:00
|
|
|
@echo ""
|
2019-10-18 17:41:20 +02:00
|
|
|
@echo " make build_name=mytest install - Build Proton with the tool name \"mytest\" and"
|
2019-03-22 14:51:16 +01:00
|
|
|
@echo " install into this user's Steam installation."
|
|
|
|
@echo ""
|
2019-10-18 17:41:20 +02:00
|
|
|
@echo " make build_name=mytest module=dsound module - Build only the dsound module"
|
2021-12-22 17:36:28 +01:00
|
|
|
@echo " in the \"mytest\" build directory and place it into $(BUILD_ROOT)/dsound/."
|
2019-02-04 23:31:22 +01:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD_DIR)
|
2021-05-27 16:57:22 +02:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
protonsdk:
|
2022-04-13 20:51:32 +02:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C docker $(UNSTRIPPED) PROTONSDK_VERSION=$(protonsdk_version) proton
|
2021-01-12 14:31:00 +01:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
configure: | $(BUILD_DIR)
|
|
|
|
if [ ! -e $(BUILD_DIR)/Makefile ]; then \
|
2021-05-27 16:57:22 +02:00
|
|
|
(cd $(BUILD_DIR) && $(CONFIGURE_CMD)); \
|
2021-04-02 13:21:07 +02:00
|
|
|
fi
|
2019-03-22 14:21:45 +01:00
|
|
|
|
2021-01-12 14:31:00 +01:00
|
|
|
ifeq ($(protonsdk_version),local)
|
|
|
|
configure: protonsdk
|
|
|
|
endif
|
|
|
|
|
2022-01-11 11:07:10 +01:00
|
|
|
proton: configure
|
2021-12-22 21:16:25 +01:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) dist && \
|
2022-04-22 17:55:49 +02:00
|
|
|
echo "Proton built locally. Use 'install', 'deploy' or 'redist' targets."
|
2019-02-04 23:31:22 +01:00
|
|
|
|
2022-01-11 11:07:10 +01:00
|
|
|
install: configure
|
2021-05-28 12:04:30 +02:00
|
|
|
rm -rf $(STEAM_DIR)/compatibilitytools.d/$(_build_name)/files/ #remove proton's internal files, but preserve user_settings etc from top-level
|
2021-12-22 21:16:25 +01:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) install
|
2019-02-04 23:31:22 +01:00
|
|
|
echo "Proton installed to your local Steam installation"
|
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
redist: | $(BUILD_ROOT)/$(DEPLOY_DIR)
|
2022-01-11 11:07:10 +01:00
|
|
|
redist: configure
|
2021-12-22 17:36:28 +01:00
|
|
|
rm -rf $(BUILD_ROOT)/$(DEPLOY_DIR)/* && \
|
2021-12-22 21:16:25 +01:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) redist && \
|
2021-12-22 17:36:28 +01:00
|
|
|
cp -Rf $(BUILD_DIR)/redist/* $(BUILD_ROOT)/$(DEPLOY_DIR) && \
|
|
|
|
echo "Proton build available at $(BUILD_ROOT)/$(DEPLOY_DIR)"
|
2019-10-18 17:41:20 +02:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
deploy: | $(BUILD_ROOT)/$(DEPLOY_DIR)-deploy
|
2022-01-11 11:07:10 +01:00
|
|
|
deploy: configure
|
2021-12-22 17:36:28 +01:00
|
|
|
rm -rf $(BUILD_ROOT)/$(DEPLOY_DIR)-deploy/* && \
|
2021-12-22 21:16:25 +01:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) deploy && \
|
2021-12-22 17:36:28 +01:00
|
|
|
cp -Rf $(BUILD_DIR)/deploy/* $(BUILD_ROOT)/$(DEPLOY_DIR)-deploy && \
|
|
|
|
echo "Proton deployed to $(BUILD_ROOT)/$(DEPLOY_DIR)-deploy"
|
|
|
|
|
|
|
|
module: | $(BUILD_ROOT)/$(module)/lib/wine/i386-windows
|
|
|
|
module: | $(BUILD_ROOT)/$(module)/lib/wine/i386-unix
|
|
|
|
module: | $(BUILD_ROOT)/$(module)/lib64/wine/x86_64-windows
|
|
|
|
module: | $(BUILD_ROOT)/$(module)/lib64/wine/x86_64-unix
|
2022-01-11 11:07:10 +01:00
|
|
|
module: configure
|
2021-12-22 21:16:25 +01:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) module=$(module) module && \
|
2022-03-16 16:25:18 +01:00
|
|
|
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(MODULE_PEFILE) $(BUILD_ROOT)/$(module)/lib/wine/i386-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(MODULE_PEFILE) $(BUILD_ROOT)/$(module)/lib64/wine/x86_64-windows/ && \
|
|
|
|
if [ -e $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(MODULE_PEFILE).so ]; then \
|
|
|
|
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(MODULE_PEFILE).so $(BUILD_ROOT)/$(module)/lib/wine/i386-unix/ && \
|
|
|
|
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(MODULE_PEFILE).so $(BUILD_ROOT)/$(module)/lib64/wine/x86_64-unix/; \
|
|
|
|
fi
|
|
|
|
if [ -e $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(MODULE_SOFILE) ]; then \
|
|
|
|
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(MODULE_SOFILE) $(BUILD_ROOT)/$(module)/lib/wine/i386-unix/ && \
|
|
|
|
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(MODULE_SOFILE) $(BUILD_ROOT)/$(module)/lib64/wine/x86_64-unix/; \
|
2021-12-13 18:15:21 +01:00
|
|
|
fi
|
2019-06-13 16:53:25 +02:00
|
|
|
|
2022-01-11 11:07:10 +01:00
|
|
|
any $(CONTAINERGOALS): configure
|
2022-12-16 10:23:03 +01:00
|
|
|
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CONTAINERGOALS)
|
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
dxvk: | $(BUILD_ROOT)/dxvk/lib/wine/dxvk
|
|
|
|
dxvk: | $(BUILD_ROOT)/dxvk/lib64/wine/dxvk
|
2022-12-16 10:23:03 +01:00
|
|
|
dxvk: any
|
2021-05-28 12:04:30 +02:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib/wine/dxvk/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib64/wine/dxvk/
|
2019-11-15 16:57:43 +01:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
dxvk-nvapi: | $(BUILD_ROOT)/dxvk-nvapi/lib/wine/nvapi
|
|
|
|
dxvk-nvapi: | $(BUILD_ROOT)/dxvk-nvapi/lib64/wine/nvapi
|
2022-12-16 10:23:03 +01:00
|
|
|
dxvk-nvapi: any
|
2021-12-22 17:36:28 +01:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/nvapi/*.dll $(BUILD_ROOT)/dxvk-nvapi/lib/wine/nvapi/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/nvapi/*.dll $(BUILD_ROOT)/dxvk-nvapi/lib64/wine/nvapi/
|
2021-05-10 23:27:49 +02:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
vkd3d-proton: | $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton
|
|
|
|
vkd3d-proton: | $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton
|
2022-12-16 10:23:03 +01:00
|
|
|
vkd3d-proton: any
|
2021-05-28 12:04:30 +02:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton/
|
2019-08-22 21:44:30 +02:00
|
|
|
|
2021-12-23 13:05:38 +01:00
|
|
|
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows
|
|
|
|
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix
|
|
|
|
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows
|
|
|
|
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix
|
2022-12-16 10:23:03 +01:00
|
|
|
lsteamclient: any
|
2021-05-28 12:04:30 +02:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix/
|
2021-12-23 13:05:38 +01:00
|
|
|
|
|
|
|
vrclient: | $(BUILD_ROOT)/vrclient/lib/wine/i386-windows
|
|
|
|
vrclient: | $(BUILD_ROOT)/vrclient/lib/wine/i386-unix
|
|
|
|
vrclient: | $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows
|
|
|
|
vrclient: | $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix
|
2022-12-16 10:23:03 +01:00
|
|
|
vrclient: any
|
2021-05-28 12:04:30 +02:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-windows/vrclient.dll $(BUILD_ROOT)/vrclient/lib/wine/i386-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-unix/vrclient.dll.so $(BUILD_ROOT)/vrclient/lib/wine/i386-unix/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/vrclient_x64.dll $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/vrclient_x64.dll.so $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix/
|
2020-12-30 20:35:28 +01:00
|
|
|
|
2021-12-23 13:05:38 +01:00
|
|
|
wineopenxr: | $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows
|
|
|
|
wineopenxr: | $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix
|
2022-12-16 10:23:03 +01:00
|
|
|
wineopenxr: any
|
2021-05-28 12:04:30 +02:00
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/wineopenxr.dll $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/wineopenxr.dll.so $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix/
|
2021-04-02 11:42:06 +02:00
|
|
|
|
2021-12-23 13:05:38 +01:00
|
|
|
battleye: | $(BUILD_ROOT)/battleye/v1/lib/wine/i386-windows
|
|
|
|
battleye: | $(BUILD_ROOT)/battleye/v1/lib/wine/i386-unix
|
|
|
|
battleye: | $(BUILD_ROOT)/battleye/v1/lib64/wine/x86_64-windows
|
|
|
|
battleye: | $(BUILD_ROOT)/battleye/v1/lib64/wine/x86_64-unix
|
2022-12-16 10:23:03 +01:00
|
|
|
battleye: any
|
2021-12-23 13:05:38 +01:00
|
|
|
cp -f $(BUILD_DIR)/dist-battleye/v1/lib/wine/i386-windows/beclient.dll $(BUILD_ROOT)/battleye/v1/lib/wine/i386-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist-battleye/v1/lib/wine/i386-unix/beclient.dll.so $(BUILD_ROOT)/battleye/v1/lib/wine/i386-unix/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist-battleye/v1/lib64/wine/x86_64-windows/beclient_x64.dll $(BUILD_ROOT)/battleye/v1/lib64/wine/x86_64-windows/ && \
|
|
|
|
cp -f $(BUILD_DIR)/dist-battleye/v1/lib64/wine/x86_64-unix/beclient_x64.dll.so $(BUILD_ROOT)/battleye/v1/lib64/wine/x86_64-unix/
|
2021-03-24 17:51:34 +01:00
|
|
|
|
2021-12-22 17:36:28 +01:00
|
|
|
$(BUILD_ROOT)/%:
|
2021-04-02 11:42:06 +02:00
|
|
|
mkdir -p $@
|