Browse Source

Added build rule to examples makefile.

Бранимир Караџић 5 years ago
parent
commit
f232f93017
2 changed files with 67 additions and 13 deletions
  1. 41 1
      examples/makefile
  2. 26 12
      scripts/shader.mk

+ 41 - 1
examples/makefile

@@ -3,6 +3,46 @@
 # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
 # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
 #
 #
 
 
+all:
+	@make -s --no-print-directory build -C 01-cubes
+#embedded @make -s --no-print-directory -C 02-metaballs
+	@make -s --no-print-directory build -C 03-raymarch
+	@make -s --no-print-directory build -C 04-mesh
+	@make -s --no-print-directory build -C 05-instancing
+	@make -s --no-print-directory build -C 06-bump
+	@make -s --no-print-directory build -C 07-callback
+	@make -s --no-print-directory build -C 08-update
+	@make -s --no-print-directory build -C 09-hdr
+#embedded @make -s --no-print-directory build -C 10-font
+#embedded @make -s --no-print-directory build -C 11-fontsdf
+	@make -s --no-print-directory build -C 12-lod
+	@make -s --no-print-directory build -C 13-stencil
+	@make -s --no-print-directory build -C 14-shadowvolumes
+	@make -s --no-print-directory build -C 15-shadowmaps-simple
+	@make -s --no-print-directory build -C 16-shadowmaps
+#embedded @make -s --no-print-directory build -C 17-drawstress
+	@make -s --no-print-directory build -C 18-ibl
+	@make -s --no-print-directory build -C 19-oit
+#embedded @make -s --no-print-directory build -C 20-nanovg
+	@make -s --no-print-directory build -C 21-deferred
+	@make -s --no-print-directory build -C 23-vectordisplay
+	@make -s --no-print-directory build -C 24-nbody
+#reused @make -s --no-print-directory build -C 25-c99
+#reused @make -s --no-print-directory build -C 26-occlusion
+	@make -s --no-print-directory build -C 27-terrain
+	@make -s --no-print-directory build -C 28-wireframe
+	@make -s --no-print-directory build -C 30-picking
+	@make -s --no-print-directory build -C 31-rsm
+	@make -s --no-print-directory build -C 33-pom
+#reused @make -s --no-print-directory build -C 34-mvs
+#reused @make -s --no-print-directory build -C 35-dynamic
+	@make -s --no-print-directory build -C 36-sky
+#	@make -s --no-print-directory build -C 37-gpudrivenrendering
+	@make -s --no-print-directory build -C 38-bloom
+#	@make -s --no-print-directory build -C 39-assao
+	@make -s --no-print-directory build -C 40-svt
+	@make -s --no-print-directory build -C 42-bunnylod
+
 rebuild:
 rebuild:
 	@make -s --no-print-directory rebuild -C 01-cubes
 	@make -s --no-print-directory rebuild -C 01-cubes
 #embedded @make -s --no-print-directory rebuild -C 02-metaballs
 #embedded @make -s --no-print-directory rebuild -C 02-metaballs
@@ -23,7 +63,7 @@ rebuild:
 #embedded @make -s --no-print-directory rebuild -C 17-drawstress
 #embedded @make -s --no-print-directory rebuild -C 17-drawstress
 	@make -s --no-print-directory rebuild -C 18-ibl
 	@make -s --no-print-directory rebuild -C 18-ibl
 	@make -s --no-print-directory rebuild -C 19-oit
 	@make -s --no-print-directory rebuild -C 19-oit
-#embedded	@make -s --no-print-directory rebuild -C 20-nanovg
+#embedded @make -s --no-print-directory rebuild -C 20-nanovg
 	@make -s --no-print-directory rebuild -C 21-deferred
 	@make -s --no-print-directory rebuild -C 21-deferred
 	@make -s --no-print-directory rebuild -C 23-vectordisplay
 	@make -s --no-print-directory rebuild -C 23-vectordisplay
 	@make -s --no-print-directory rebuild -C 24-nbody
 	@make -s --no-print-directory rebuild -C 24-nbody

+ 26 - 12
scripts/shader.mk

@@ -15,24 +15,38 @@ ifndef TARGET
 .PHONY: all
 .PHONY: all
 all:
 all:
 	@echo Usage: make TARGET=# [clean, all, rebuild]
 	@echo Usage: make TARGET=# [clean, all, rebuild]
-	@echo "  TARGET=0 (hlsl  - d3d9)"
-	@echo "  TARGET=1 (hlsl  - d3d11)"
-	@echo "  TARGET=2 (essl  - nacl)"
+	@echo "  TARGET=0 (hlsl  - d3d9  / Windows only!)"
+	@echo "  TARGET=1 (hlsl  - d3d11 / Windows only!)"
 	@echo "  TARGET=3 (essl  - android)"
 	@echo "  TARGET=3 (essl  - android)"
 	@echo "  TARGET=4 (glsl)"
 	@echo "  TARGET=4 (glsl)"
 	@echo "  TARGET=5 (metal)"
 	@echo "  TARGET=5 (metal)"
 	@echo "  TARGET=6 (pssl)"
 	@echo "  TARGET=6 (pssl)"
 	@echo "  TARGET=7 (spirv)"
 	@echo "  TARGET=7 (spirv)"
 
 
+.PHONY: build
+build:
+ifeq ($(OS), windows)
+	@make -s --no-print-directory TARGET=0 all
+	@make -s --no-print-directory TARGET=1 all
+endif
+	@make -s --no-print-directory TARGET=3 all
+	@make -s --no-print-directory TARGET=4 all
+	@make -s --no-print-directory TARGET=5 all
+	@make -s --no-print-directory TARGET=7 all
+
+.PHONY: clean
+clean:
+ifeq ($(OS), windows)
+	@make -s --no-print-directory TARGET=0 clean
+	@make -s --no-print-directory TARGET=1 clean
+endif
+	@make -s --no-print-directory TARGET=3 clean
+	@make -s --no-print-directory TARGET=4 clean
+	@make -s --no-print-directory TARGET=5 clean
+	@make -s --no-print-directory TARGET=7 clean
+
 .PHONY: rebuild
 .PHONY: rebuild
-rebuild:
-	@make -s --no-print-directory TARGET=0 clean all
-	@make -s --no-print-directory TARGET=1 clean all
-	@make -s --no-print-directory TARGET=2 clean all
-	@make -s --no-print-directory TARGET=3 clean all
-	@make -s --no-print-directory TARGET=4 clean all
-	@make -s --no-print-directory TARGET=5 clean all
-	@make -s --no-print-directory TARGET=7 clean all
+rebuild: clean build
 
 
 else
 else
 
 
@@ -138,7 +152,7 @@ $(BUILD_INTERMEDIATE_DIR)/cs_%.bin: $(SHADERS_DIR)cs_%.sc
 
 
 .PHONY: all
 .PHONY: all
 all: dirs $(BIN)
 all: dirs $(BIN)
-	@echo Target $(SHADER_PATH)
+	@echo Target $(notdir $(CURDIR)) / $(SHADER_PATH)
 
 
 .PHONY: clean
 .PHONY: clean
 clean:
 clean: