build: Add a new "redist" target for distribution outside of Steam

This commit is contained in:
Andrew Eikum 2019-10-18 10:41:20 -05:00
parent 230b9d81a2
commit e30bd8ea88
2 changed files with 26 additions and 11 deletions

View file

@ -50,9 +50,11 @@ all: help
help:
@echo "Proton Makefile instructions"
@echo ""
@echo ""Quick start" Makefile targets:"
@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 " 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"
@echo " after the nearest git tag"
@echo " clean - Delete the Proton build directory"
@echo ""
@ -76,16 +78,16 @@ help:
@echo " lsteamclient - Rebuild the Steam client wrapper and copy it into vagrant_share/."
@echo ""
@echo "Examples:"
@echo " "make install" - Build Proton and install into this user's Steam installation,"
@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 " make redist - Build a Proton redistribution 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 " 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 " 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/."
@echo ""
@echo "Running out of disk space in the VM? See resize-vagrant-disk.sh"
@ -110,10 +112,15 @@ install: configure
cp -R vagrant_share/compatibilitytools.d/$(_build_name) $(STEAM_DIR)/compatibilitytools.d/
echo "Proton installed to your local Steam installation"
deploy: configure
redist: configure
mkdir -p vagrant_share/$(DEPLOY_DIR)
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)'
echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)"
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) redist && cp $(BUILD_DIR)/redist/* /vagrant/$(DEPLOY_DIR)'
echo "Proton build available at vagrant_share/$(DEPLOY_DIR)"
deploy: configure
mkdir -p vagrant_share/$(DEPLOY_DIR)-deploy
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)-deploy'
echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)-deploy"
module: configure
mkdir -p vagrant_share/$(module)/lib/wine/ vagrant_share/$(module)/lib64/wine/

View file

@ -129,6 +129,7 @@ TOOLS_DIR64 := ./obj-tools64
DST_BASE := ./dist
DST_DIR := $(DST_BASE)/dist
DEPLOY_DIR := ./deploy
REDIST_DIR := ./redist
# All top level goals. Lazy evaluated so they can be added below.
GOAL_TARGETS = $(GOAL_TARGETS_LIBS)
@ -351,6 +352,7 @@ DIST_TARGETS := $(DIST_COPY_TARGETS) $(DIST_OVR32) $(DIST_OVR64) \
$(DIST_COMPAT_MANIFEST) $(DIST_LICENSE) $(DIST_FONTS)
DEPLOY_COPY_TARGETS := $(DIST_COPY_TARGETS) $(DIST_VERSION) $(DIST_LICENSE)
REDIST_COPY_TARGETS := $(DEPLOY_COPY_TARGETS) $(DIST_COMPAT_MANIFEST)
$(DIST_LICENSE): $(LICENSE)
cp -a $< $@
@ -438,19 +440,25 @@ dist: $(DIST_TARGETS) wine vrclient lsteamclient steam dxvk d9vk | $(DST_DIR)
#The use of "cour" here is for compatibility with programs that require that exact string. This link does not point to Courier New.
#The use of "msyh" here is for compatibility with programs that require that exact string. This link does not point to Microsoft YaHei.
deploy: dist | $(filter-out dist deploy install,$(MAKECMDGOALS))
deploy: dist | $(filter-out dist deploy install redist,$(MAKECMDGOALS))
mkdir -p $(DEPLOY_DIR) && \
cp -a $(DEPLOY_COPY_TARGETS) $(DEPLOY_DIR) && \
tar -C $(DST_DIR) -c . > $(DEPLOY_DIR)/proton_dist.tar
@echo "Created deployment archive at "$(DEPLOY_DIR)"/proton_dist.tar"
install: dist | $(filter-out dist deploy install,$(MAKECMDGOALS))
install: dist | $(filter-out dist deploy install redist,$(MAKECMDGOALS))
if [ ! -d $(STEAM_DIR) ]; then echo >&2 "!! "$(STEAM_DIR)" does not exist, cannot install"; return 1; fi
mkdir -p $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
cp -r $(DST_BASE)/* $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
@echo "Installed Proton to "$(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
@echo "You may need to restart Steam to select this tool"
redist: dist | $(filter-out dist deploy install redist,$(MAKECMDGOALS))
mkdir -p $(REDIST_DIR)
cp -a $(REDIST_COPY_TARGETS) $(REDIST_DIR)
tar -C $(DST_DIR) -c . | gzip -c -1 > $(REDIST_DIR)/proton_dist.tar.gz
@echo "Created redistribution tarball at "$(REDIST_DIR)"/proton_dist.tar.gz"
.PHONY: module32 module64 module
module32: SHELL = $(CONTAINER_SHELL32)