summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-08-21 21:45:38 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-08-21 21:45:38 -0400
commit8bbef6b1f8fe61ae8b0f24693af28b7fa6e68237 (patch)
treeeaddcd8a1f6f735dc6ea2fe3380e5fe1c90754e6 /Makefile
parent77d547596c23d5878fee417d3aa0a3bf38037e65 (diff)
pke: embed shaders in executable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 16 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 6685083..ea46f58 100644
--- a/Makefile
+++ b/Makefile
@@ -60,13 +60,25 @@ $(1): $(2)
$(CC) -std=c2x -O3 -c $$< -o $$@
endef
-FLG_PKE = -Isub/imgui -Isub/stb -Isub/cgltf -Isub/bullet3/src
+FLG_PKE = -Iembed -Isub/imgui -Isub/stb -Isub/cgltf -Isub/bullet3/src
FLG_EDT = $(FLG_PKE) -Isrc -Isub/msdfgen -Isub/msdf-atlas-gen
FLG_MPL = $(FLG_PKE) -Isrc
FLG_RUN = $(FLG_PKE) -Isrc
FLG_TST = $(FLG_PKE) -Isrc
+DST_SHADERS = \
+ $(DIR_OBJ)/shaders/3d.frag.spv \
+ $(DIR_OBJ)/shaders/3d.vert.spv \
+ $(DIR_OBJ)/shaders/glyph.frag.spv \
+ $(DIR_OBJ)/shaders/glyph.vert.spv \
+ $(DIR_OBJ)/shaders/present.frag.spv \
+ $(DIR_OBJ)/shaders/present.vert.spv \
+ $(DIR_OBJ)/shaders/ui-base.frag.spv \
+ $(DIR_OBJ)/shaders/ui-base.vert.spv \
+ $(DIR_OBJ)/shaders/ui-txtr.frag.spv \
+
FILES_BIN = \
+ $(DST_SHADERS) \
assets/fonts/font-mannequin.png \
assets/fonts/font-mannequin.glyph \
@@ -86,24 +98,12 @@ $(foreach f,$(FILES_BIN_SAFE), \
) \
)
-DST_SHADERS = \
- $(DIR_OBJ)/shaders/vertex.vert.spv \
- $(DIR_OBJ)/shaders/present.vert.spv \
- $(DIR_OBJ)/shaders/texture.frag.spv \
- $(DIR_OBJ)/shaders/present.frag.spv \
- $(DIR_OBJ)/shaders/glyph.vert.spv \
- $(DIR_OBJ)/shaders/glyph.frag.spv \
- $(DIR_OBJ)/shaders/ui-base.vert.spv \
- $(DIR_OBJ)/shaders/ui-base.frag.spv \
- $(DIR_OBJ)/shaders/ui-txtr.frag.spv \
-
.PHONY: default
default: options .WAIT $(DIR_OBJ)/libpke-editor.$(OBJ_EXT) $(DIR_OBJ)/libpke-example.$(LIB_EXT) $(DIR_EXE)/pke-runtime ;
.PHONY: prepare
prepare: config.h
prepare: config.mk
-prepare: $(FILES_BIN_GCH)
prepare:
mkdir -p $(DIR_EXE)
mkdir -p $(DIR_OBJ)/shaders
@@ -136,7 +136,7 @@ $(DIR_OBJ)/shaders/%.frag.spv: assets/shaders/%.frag | prepare
$(DIR_OBJ)/%.$(OBJ_EXT) : src/%.c | prepare
$(cc-command) $(FLG_PKE)
-$(DIR_OBJ)/%.$(OBJ_EXT) : embed/%.c | prepare
+$(DIR_OBJ)/%.$(OBJ_EXT) : embed/%.c | prepare $(FILES_BIN_GCH)
$(cc-command) $(FLG_PKE)
$(DIR_OBJ)/%.$(OBJ_EXT) : editor/%.c | prepare
$(cc-command) $(FLG_PKE)
@@ -145,7 +145,7 @@ $(DIR_OBJ)/%.$(OBJ_EXT) : tests/%.c | prepare
$(DIR_OBJ)/%.$(OBJ_EXT) : src/%.cpp | prepare
$(cxx-command) $(FLG_PKE)
-$(DIR_OBJ)/%.$(OBJ_EXT) : embed/%.cpp | prepare
+$(DIR_OBJ)/%.$(OBJ_EXT) : embed/%.cpp | prepare $(FILES_BIN_GCH)
$(cxx-command) $(FLG_PKE)
$(DIR_OBJ)/%.$(OBJ_EXT) : editor/%.cpp | prepare
$(cxx-command) $(FLG_EDT)
@@ -185,7 +185,6 @@ $(DIR_OBJ)/libmsdf-atlas-gen.$(LIB_EXT): prepare
ar rc $@ sub/msdf-atlas-gen/$(DIR_OBJ)/*.$(OBJ_EXT)
ranlib $@
-$(DIR_OBJ)/libpke.$(LIB_EXT): $(DST_SHADERS)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/arg-handler.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/asset-manager.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/audio.$(OBJ_EXT)
@@ -195,6 +194,7 @@ $(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/camera.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/dynamic-array.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/ecs.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/embedded-fonts.$(OBJ_EXT)
+$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/embedded-shaders.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/entities.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/font.$(OBJ_EXT)
$(DIR_OBJ)/libpke.$(LIB_EXT): $(DIR_OBJ)/game-settings.$(OBJ_EXT)