File: Makefile.release

package info (click to toggle)
vulkan-loader 1.4.328.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,628 kB
  • sloc: cpp: 316,923; ansic: 46,199; xml: 33,647; python: 6,071; asm: 3,534; makefile: 71; sh: 53
file content (141 lines) | stat: -rw-r--r-- 4,913 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Copyright 2024-2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0

# Makefile.release - update external files generated in Vulkan spec
# repository when a public specification update is done.

# Needed to get the right version of test, apparently
SHELL  = /bin/bash

REVISION = 999

# Location of other repository clones
GIT	 = ..
SPEC	 = $(GIT)/Vulkan-Docs
# As of 1.4.322 spec update, the build process has been changed to use a
# Vulkan-Hpp located underneath Vulkan-Docs (not a submodule).
# If you are using one located elsewhere then override HPP.
HPP	 = $(SPEC)/Vulkan-Hpp
REGISTRY = $(GIT)/registry/vulkan

update: revision-check create-branch update-files push-branch

# Working branch for the update, and a test if it exists
BRANCH = update-$(REVISION)

# Switch to new branch which will contain the update
create-branch: revision-check
	git switch -q main
	git pull -q
	# If branch already exists, do nothing
	@if test `git branch -l $(BRANCH) | wc -l` == 1 ; then \
	    echo "Branch $(BRANCH) already exists" ; \
	    git switch $(BRANCH) ; \
	else \
	    echo "Creating branch $(BRANCH)" ; \
	    git switch -c $(BRANCH) ; \
	fi

# Update headers and scripts in the new branch
update-files: remove-files update-headers update-scripts

# To ensure updates are caught, old versions of installed files are
# removed.
# Files in include/ to keep
HEADERS_KEEP = \
    include/vulkan/vk_icd.h \
    include/vulkan/vk_layer.h

remove-files:
	rm -rf $(filter-out $(HEADERS_KEEP), $(wildcard include/vulkan/*))
	rm -rf include/vk_video
	rm -rf registry
	mkdir include/vk_video registry registry/profiles registry/spec_tools

# Vulkan SC Vulkan-Hpp headers not published in the Vulkan-Headers repository
SCHPPFILES = \
    include/vulkan/vulkansc.hpp \
    include/vulkan/vulkansc.cppm \
    include/vulkan/vulkansc_*.hpp

update-headers:
	if test ! -d $(SPEC)/gen/include/ ; then \
	    echo "No C header file source directory $(SPEC)/gen/include" ; \
	    exit 1 ; \
	fi
	if test ! -d $(HPP)/vulkan ; then \
	    echo "No C++ header file source directory $(HPP)/vulkan" ; \
	    exit 1 ; \
	fi
	cp -r $(SPEC)/gen/include/* include/
	cp -r $(HPP)/vulkan/* include/vulkan/
	rm -f $(SCHPPFILES)

# Top-level scripts / XML to install
SCRIPTS = \
    $(SPEC)/scripts/base_generator.py \
    $(SPEC)/scripts/cgenerator.py \
    $(SPEC)/scripts/generator.py \
    $(SPEC)/scripts/parse_dependency.py \
    $(SPEC)/scripts/reg.py \
    $(SPEC)/scripts/stripAPI.py \
    $(SPEC)/scripts/apiconventions.py \
    $(SPEC)/scripts/vkconventions.py \
    $(SPEC)/scripts/vulkan_object.py \
    $(SPEC)/xml/vk.xml \
    $(SPEC)/xml/video.xml \
    $(REGISTRY)/specs/latest/validation/validusage.json

# Scripts in registry/spec_tools to install
SCRIPT_TOOLS = \
    $(SPEC)/scripts/spec_tools/conventions.py \
    $(SPEC)/scripts/spec_tools/util.py

# Profiles to install
PROFILES = \
    $(wildcard $(SPEC)/xml/profiles/*)

update-scripts:
	cp $(SCRIPTS) registry/
	cp $(PROFILES) registry/profiles/
	cp $(SCRIPT_TOOLS) registry/spec_tools/

# Once the branch is updated, push it to upstream and create an MR
# This should be used cautiously after verifying the branch contents are
# indeed correct and updates.
#
# Ideally we could automatically create the github PR.
# This will require additional software, see e.g.
#   https://medium.com/@ravipatel.it/creating-a-git-pull-request-using-the-command-line-a-detailed-guide-4ef1ea017fe2
#   https://gist.github.com/devinschumacher/bc66c162d9c6c167952f1943d0e6419c
# Gitlab supports this via 'git push' options e.g.
#   -o merge_request.create -o merge_request.target=main -o merge_request.remove_source_branch \
#   -o merge_request.title="Update for Vulkan-Docs 1.4.$(REVISION)" \
#   -o merge_request.assign=oddhack
# But for github we must manually create a PR after pushing
push-branch: revision-check
	git switch $(BRANCH)
	git add -u
	echo "Detect new files and add them. This may not always succeed."
	echo "Adding new files:" `git diff --name-only main`
	git add `git diff --name-only main`
	git commit -m "Update for Vulkan-Docs 1.4.$(REVISION)"
	git push --set-upstream origin $(BRANCH)
	git switch main
	git branch -d $(BRANCH)
	echo "Now create a pull request by going to the URL:"
	echo "  https://github.com/KhronosGroup/Vulkan-Headers/pull/new/$(BRANCH)"
	echo "After accepting this PR, continue with:"
	echo "    cd $(shell pwd) && make -f Makefile.release REVISION=$(REVISION) tag-branch"

# Tag main for the update after accepting the update PR
TAG = v1.4.$(REVISION)
tag-branch:
	git switch main
	git pull
	git tag -a $(TAG) -m "Update for Vulkan-Docs 1.4.$(REVISION)"
	git push origin $(TAG)
	echo "Now continue with Step 12 of the process (update public registry) from the wiki, until more scripting is done"

revision-check:
	@if test $(REVISION) = 999 ; then echo "Must specify explicit REVISION= in make invocation" ; exit 1 ; fi