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
|
|
|
|
|
|
|
STEAM_DIR := $(HOME)/.steam/root
|
2019-04-29 20:17:03 +03:00
|
|
|
BUILD_DIR := $(_build_name)
|
|
|
|
|
|
|
|
ifeq ($(build_name),)
|
|
|
|
DEPLOY_DIR := $(shell git describe --tags --always)
|
|
|
|
else
|
|
|
|
DEPLOY_DIR := $(_build_name)
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
CONFIGURE_CMD := ../proton/configure.sh --steam-runtime64=docker:steam-proton-dev --steam-runtime32=docker:steam-proton-dev32 --steam-runtime="$$HOME"/steam-runtime/runtime/ --build-name="$(_build_name)"
|
2019-03-22 16:51:16 +03:00
|
|
|
|
|
|
|
# make doesn't handle spaces well... replace them with underscores in paths
|
2019-04-29 20:17:03 +03:00
|
|
|
BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
|
2019-03-22 16:51:16 +03:00
|
|
|
|
|
|
|
all: help
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2019-03-22 16:51:16 +03:00
|
|
|
.PHONY: help vagrant clean configure proton install deploy module
|
2019-02-05 01:31:22 +03:00
|
|
|
|
2019-03-22 16:51:16 +03:00
|
|
|
help:
|
|
|
|
@echo "Proton Makefile instructions"
|
|
|
|
@echo ""
|
|
|
|
@echo ""Quick start" Makefile targets:"
|
|
|
|
@echo " install - Install Proton into current user's Steam installation"
|
|
|
|
@echo " deploy - Build deployment files into a directory in vagrant_share/ named"
|
|
|
|
@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-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"
|
|
|
|
@echo " module - Build a single Wine module and copy into the shared directory."
|
|
|
|
@echo " Note: This is a development loop target. Use it only after building"
|
|
|
|
@echo " all of wine with one of the other targets."
|
|
|
|
@echo " Specify module variable: make module=kernel32 module"
|
|
|
|
@echo ""
|
|
|
|
@echo "Examples:"
|
|
|
|
@echo " "make install" - Build Proton and install into this user's Steam installation,"
|
|
|
|
@echo " with the current Proton branch name as the tool's name."
|
|
|
|
@echo ""
|
|
|
|
@echo " "make deploy" - Build a Proton deployment package in a tagged directory"
|
|
|
|
@echo " in vagrant_share/."
|
|
|
|
@echo ""
|
|
|
|
@echo " "make build_name=mytest install" - Build Proton with the tool name \"mytest\" and"
|
|
|
|
@echo " install into this user's Steam installation."
|
|
|
|
@echo ""
|
|
|
|
@echo " "make build_name=mytest module=dsound module" - Build only the dsound module"
|
|
|
|
@echo " in the \"mytest\" build directory and place it into vagrant_share/dsound/."
|
2019-02-05 01:31:22 +03:00
|
|
|
|
|
|
|
vagrant:
|
|
|
|
vagrant up
|
|
|
|
vagrant rsync
|
|
|
|
|
2019-03-22 16:21:45 +03:00
|
|
|
clean: vagrant
|
2019-03-22 16:51:16 +03:00
|
|
|
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
|
2019-03-22 16:21:45 +03:00
|
|
|
|
|
|
|
configure: vagrant
|
2019-03-22 16:51:16 +03:00
|
|
|
vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then mkdir $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi'
|
2019-03-22 16:21:45 +03:00
|
|
|
|
|
|
|
proton: configure
|
2019-03-22 16:51:16 +03:00
|
|
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ dist'
|
2019-02-05 01:31:22 +03:00
|
|
|
echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build."
|
|
|
|
|
2019-03-22 16:21:45 +03:00
|
|
|
install: configure
|
2019-03-22 16:51:16 +03:00
|
|
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ STEAM_DIR=/vagrant/ install'
|
2019-03-25 16:59:24 +03:00
|
|
|
mkdir -p $(STEAM_DIR)/compatibilitytools.d/
|
2019-05-01 18:22:52 +03:00
|
|
|
cp -R 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"
|
|
|
|
|
2019-03-22 16:21:45 +03:00
|
|
|
deploy: configure
|
2019-03-22 16:51:16 +03:00
|
|
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ deploy'
|
2019-02-05 01:31:22 +03:00
|
|
|
mkdir -p vagrant_share/$(DEPLOY_DIR)
|
2019-05-07 22:01:31 +03:00
|
|
|
vagrant ssh -c 'cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)'
|
2019-02-05 01:31:22 +03:00
|
|
|
echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)"
|
2019-02-05 19:04:53 +03:00
|
|
|
|
2019-03-22 16:21:45 +03:00
|
|
|
module: configure
|
2019-03-22 16:51:16 +03:00
|
|
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ module=$(module) module'
|
2019-02-05 19:04:53 +03:00
|
|
|
mkdir -p vagrant_share/$(module)/lib{,64}/wine/
|
2019-05-07 22:01:31 +03:00
|
|
|
vagrant ssh -c 'cp $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)*.so /vagrant/$(module)/lib/wine/'
|
|
|
|
vagrant ssh -c 'cp $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)*.so /vagrant/$(module)/lib64/wine/'
|