Skip to content

Commit 29dc87c

Browse files
committed
Simplify build scripts.
1 parent 1ab3e5a commit 29dc87c

3 files changed

Lines changed: 42 additions & 120 deletions

File tree

Examples/Makefile.am

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,53 +19,34 @@ LDADD = \
1919
Hello_SOURCES = Hello.c
2020
HelloCompute_SOURCES = HelloCompute.c
2121

22-
# All GLSL sources and compiled blobs are versioned in the repository.
23-
# Normal builds never invoke glslc or shadercross. Run 'make shaders' after
24-
# editing a .glsl file to regenerate the platform blobs.
25-
26-
GLSLC = glslc
27-
SHADERCROSS = shadercross
28-
29-
GLSL_SHADERS = \
22+
# The compiled .spv/.metal blobs are versioned, so normal builds never need
23+
# glslc/shadercross. Run 'make shaders' after editing a .glsl.
24+
EXTRA_DIST = \
3025
Hello.vert.glsl \
3126
Hello.frag.glsl \
32-
HelloCompute.comp.glsl \
33-
HelloCompute.vert.glsl \
34-
HelloCompute.frag.glsl
35-
36-
METAL_SHADERS = \
3727
Hello.vert.metal \
3828
Hello.frag.metal \
39-
HelloCompute.comp.metal \
40-
HelloCompute.vert.metal \
41-
HelloCompute.frag.metal
42-
43-
SPIRV_SHADERS = \
4429
Hello.vert.spv \
4530
Hello.frag.spv \
31+
HelloCompute.comp.glsl \
32+
HelloCompute.vert.glsl \
33+
HelloCompute.frag.glsl \
34+
HelloCompute.comp.metal \
35+
HelloCompute.vert.metal \
36+
HelloCompute.frag.metal \
4637
HelloCompute.comp.spv \
4738
HelloCompute.vert.spv \
4839
HelloCompute.frag.spv
4940

50-
EXTRA_DIST = $(GLSL_SHADERS) $(METAL_SHADERS) $(SPIRV_SHADERS)
51-
5241
.PHONY: shaders
53-
shaders: $(METAL_SHADERS) $(SPIRV_SHADERS)
54-
55-
$(srcdir)/%.vert.metal: $(srcdir)/%.vert.spv
56-
$(SHADERCROSS) $< -s SPIRV -d MSL -t vertex -o $@
57-
58-
$(srcdir)/%.frag.metal: $(srcdir)/%.frag.spv
59-
$(SHADERCROSS) $< -s SPIRV -d MSL -t fragment -o $@
60-
61-
$(srcdir)/%.comp.metal: $(srcdir)/%.comp.spv
62-
$(SHADERCROSS) $< -s SPIRV -d MSL -t compute -o $@
63-
64-
$(srcdir)/%.vert.spv: $(srcdir)/%.vert.glsl
65-
$(GLSLC) -fshader-stage=vert $< -o $@
66-
67-
$(srcdir)/%.frag.spv: $(srcdir)/%.frag.glsl
68-
$(GLSLC) -fshader-stage=frag $< -o $@
69-
70-
$(srcdir)/%.comp.spv: $(srcdir)/%.comp.glsl
71-
$(GLSLC) -fshader-stage=comp $< -o $@
42+
shaders:
43+
$(GLSLC) -fshader-stage=vert Hello.vert.glsl -o Hello.vert.spv
44+
$(GLSLC) -fshader-stage=frag Hello.frag.glsl -o Hello.frag.spv
45+
$(GLSLC) -fshader-stage=comp HelloCompute.comp.glsl -o HelloCompute.comp.spv
46+
$(GLSLC) -fshader-stage=vert HelloCompute.vert.glsl -o HelloCompute.vert.spv
47+
$(GLSLC) -fshader-stage=frag HelloCompute.frag.glsl -o HelloCompute.frag.spv
48+
$(SHADERCROSS) Hello.vert.spv -s SPIRV -d MSL -t vertex -o Hello.vert.metal
49+
$(SHADERCROSS) Hello.frag.spv -s SPIRV -d MSL -t fragment -o Hello.frag.metal
50+
$(SHADERCROSS) HelloCompute.comp.spv -s SPIRV -d MSL -t compute -o HelloCompute.comp.metal
51+
$(SHADERCROSS) HelloCompute.vert.spv -s SPIRV -d MSL -t vertex -o HelloCompute.vert.metal
52+
$(SHADERCROSS) HelloCompute.frag.spv -s SPIRV -d MSL -t fragment -o HelloCompute.frag.metal

ObjectivelyGPU.xcodeproj/project.pbxproj

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
A09AD953AC672E0DE9D1E26D /* ObjectivelyGPU.h in Headers */ = {isa = PBXBuildFile; fileRef = C16D60B0E94469E649953EC5 /* ObjectivelyGPU.h */; settings = {ATTRIBUTES = (Public, ); }; };
3434
AA000000000000000000FF01 /* SDL3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; };
3535
CCCB11DB70E4A962360A2119 /* CopyPass.c in Sources */ = {isa = PBXBuildFile; fileRef = C862954A9DD435C1FF7CD31D /* CopyPass.c */; };
36+
CE1643392FF413C000863996 /* HelloCompute.comp.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AB2FEF712F00CB0CCA /* HelloCompute.comp.metal */; };
37+
CE16433A2FF413C000863996 /* HelloCompute.comp.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AC2FEF712F00CB0CCA /* HelloCompute.comp.spv */; };
38+
CE16433B2FF413C000863996 /* HelloCompute.frag.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AE2FEF712F00CB0CCA /* HelloCompute.frag.metal */; };
39+
CE16433C2FF413C000863996 /* HelloCompute.frag.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AF2FEF712F00CB0CCA /* HelloCompute.frag.spv */; };
40+
CE16433D2FF413C000863996 /* HelloCompute.vert.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83B12FEF712F00CB0CCA /* HelloCompute.vert.metal */; };
41+
CE16433E2FF413C000863996 /* HelloCompute.vert.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83B22FEF712F00CB0CCA /* HelloCompute.vert.spv */; };
3642
CEA0030000000000000000F1 /* Objectively.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA0030000000000000000F0 /* Objectively.framework */; };
3743
CEBA3F602FF30F1E00758CA6 /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = CEBA3F5E2FF30F1E00758CA6 /* Texture.h */; settings = {ATTRIBUTES = (Public, ); }; };
3844
CEBA3F612FF30F1E00758CA6 /* Texture.c in Sources */ = {isa = PBXBuildFile; fileRef = CEBA3F5F2FF30F1E00758CA6 /* Texture.c */; };
@@ -49,22 +55,10 @@
4955
CEBA3F772FF3418E00758CA6 /* Objectively.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA0030000000000000000F0 /* Objectively.framework */; };
5056
CEBA3F782FF3419100758CA6 /* ObjectivelyGPU.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6251F22589273797656C269E /* ObjectivelyGPU.framework */; };
5157
CECF83982FEF6A7200CB0CCA /* Mathlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CECF83972FEF6A7200CB0CCA /* Mathlib.h */; settings = {ATTRIBUTES = (Public, ); }; };
52-
CECF83B52FEF765400CB0CCA /* Hello.frag.glsl in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83A42FEF712F00CB0CCA /* Hello.frag.glsl */; };
5358
CECF83B62FEF765400CB0CCA /* Hello.frag.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83A52FEF712F00CB0CCA /* Hello.frag.metal */; };
5459
CECF83B72FEF765400CB0CCA /* Hello.frag.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83A62FEF712F00CB0CCA /* Hello.frag.spv */; };
55-
CECF83B82FEF765400CB0CCA /* Hello.vert.glsl in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83A72FEF712F00CB0CCA /* Hello.vert.glsl */; };
5660
CECF83B92FEF765400CB0CCA /* Hello.vert.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83A82FEF712F00CB0CCA /* Hello.vert.metal */; };
5761
CECF83BA2FEF765400CB0CCA /* Hello.vert.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83A92FEF712F00CB0CCA /* Hello.vert.spv */; };
58-
CECF83BB2FEF765400CB0CCA /* HelloCompute.c in CopyFiles */ = {isa = PBXBuildFile; fileRef = EE00020000000000000000B2 /* HelloCompute.c */; };
59-
CECF83BC2FEF765400CB0CCA /* HelloCompute.comp.glsl in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AA2FEF712F00CB0CCA /* HelloCompute.comp.glsl */; };
60-
CECF83BD2FEF765400CB0CCA /* HelloCompute.comp.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AB2FEF712F00CB0CCA /* HelloCompute.comp.metal */; };
61-
CECF83BE2FEF765400CB0CCA /* HelloCompute.comp.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AC2FEF712F00CB0CCA /* HelloCompute.comp.spv */; };
62-
CECF83BF2FEF765400CB0CCA /* HelloCompute.frag.glsl in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AD2FEF712F00CB0CCA /* HelloCompute.frag.glsl */; };
63-
CECF83C02FEF765400CB0CCA /* HelloCompute.frag.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AE2FEF712F00CB0CCA /* HelloCompute.frag.metal */; };
64-
CECF83C12FEF765400CB0CCA /* HelloCompute.frag.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AF2FEF712F00CB0CCA /* HelloCompute.frag.spv */; };
65-
CECF83C22FEF765400CB0CCA /* HelloCompute.vert.glsl in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83B02FEF712F00CB0CCA /* HelloCompute.vert.glsl */; };
66-
CECF83C32FEF765400CB0CCA /* HelloCompute.vert.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83B12FEF712F00CB0CCA /* HelloCompute.vert.metal */; };
67-
CECF83C42FEF765400CB0CCA /* HelloCompute.vert.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83B22FEF712F00CB0CCA /* HelloCompute.vert.spv */; };
6862
CECF83C72FF03A3500CB0CCA /* Framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CECF83C52FF03A3500CB0CCA /* Framebuffer.h */; settings = {ATTRIBUTES = (Public, ); }; };
6963
CECF83C82FF03A3500CB0CCA /* Framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = CECF83C62FF03A3500CB0CCA /* Framebuffer.c */; };
7064
DF73824CC25298378B451056 /* CopyPass.h in Headers */ = {isa = PBXBuildFile; fileRef = 59334BDAED542AB6DE565EDD /* CopyPass.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -103,6 +97,21 @@
10397
/* End PBXContainerItemProxy section */
10498

10599
/* Begin PBXCopyFilesBuildPhase section */
100+
CE1643382FF413A800863996 /* CopyFiles */ = {
101+
isa = PBXCopyFilesBuildPhase;
102+
buildActionMask = 2147483647;
103+
dstPath = "";
104+
dstSubfolderSpec = 7;
105+
files = (
106+
CE1643392FF413C000863996 /* HelloCompute.comp.metal in CopyFiles */,
107+
CE16433A2FF413C000863996 /* HelloCompute.comp.spv in CopyFiles */,
108+
CE16433B2FF413C000863996 /* HelloCompute.frag.metal in CopyFiles */,
109+
CE16433C2FF413C000863996 /* HelloCompute.frag.spv in CopyFiles */,
110+
CE16433D2FF413C000863996 /* HelloCompute.vert.metal in CopyFiles */,
111+
CE16433E2FF413C000863996 /* HelloCompute.vert.spv in CopyFiles */,
112+
);
113+
runOnlyForDeploymentPostprocessing = 0;
114+
};
106115
CECF83B32FEF75A400CB0CCA /* CopyFiles */ = {
107116
isa = PBXCopyFilesBuildPhase;
108117
buildActionMask = 2147483647;
@@ -118,22 +127,10 @@
118127
dstPath = "";
119128
dstSubfolderSpec = 7;
120129
files = (
121-
CECF83B52FEF765400CB0CCA /* Hello.frag.glsl in CopyFiles */,
122130
CECF83B62FEF765400CB0CCA /* Hello.frag.metal in CopyFiles */,
123131
CECF83B72FEF765400CB0CCA /* Hello.frag.spv in CopyFiles */,
124-
CECF83B82FEF765400CB0CCA /* Hello.vert.glsl in CopyFiles */,
125132
CECF83B92FEF765400CB0CCA /* Hello.vert.metal in CopyFiles */,
126133
CECF83BA2FEF765400CB0CCA /* Hello.vert.spv in CopyFiles */,
127-
CECF83BB2FEF765400CB0CCA /* HelloCompute.c in CopyFiles */,
128-
CECF83BC2FEF765400CB0CCA /* HelloCompute.comp.glsl in CopyFiles */,
129-
CECF83BD2FEF765400CB0CCA /* HelloCompute.comp.metal in CopyFiles */,
130-
CECF83BE2FEF765400CB0CCA /* HelloCompute.comp.spv in CopyFiles */,
131-
CECF83BF2FEF765400CB0CCA /* HelloCompute.frag.glsl in CopyFiles */,
132-
CECF83C02FEF765400CB0CCA /* HelloCompute.frag.metal in CopyFiles */,
133-
CECF83C12FEF765400CB0CCA /* HelloCompute.frag.spv in CopyFiles */,
134-
CECF83C22FEF765400CB0CCA /* HelloCompute.vert.glsl in CopyFiles */,
135-
CECF83C32FEF765400CB0CCA /* HelloCompute.vert.metal in CopyFiles */,
136-
CECF83C42FEF765400CB0CCA /* HelloCompute.vert.spv in CopyFiles */,
137134
);
138135
runOnlyForDeploymentPostprocessing = 0;
139136
};
@@ -448,6 +445,7 @@
448445
buildPhases = (
449446
EE00500000000000000000B1 /* Sources */,
450447
EE00600000000000000000B1 /* Frameworks */,
448+
CE1643382FF413A800863996 /* CopyFiles */,
451449
);
452450
buildRules = (
453451
);

ObjectivelyGPU.xcodeproj/xcshareddata/xcschemes/ObjectivelyGPU-xcframework.xcscheme

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)