| 1 | # Generate Pascal include files from all GLSL code in source/ . |
| 2 | # |
| 3 | # Uses file_to_pascal_string, which is part of PasDoc. See: |
| 4 | # - PasDoc main webpage: |
| 5 | # https://github.com/pasdoc/pasdoc/wiki |
| 6 | # - file_to_pascal_string trivial source code (you can just get this one file and compile it yourself): |
| 7 | # https://github.com/pasdoc/pasdoc/blob/master/source/tools/file_to_pascal_string.dpr |
| 8 | # |
| 9 | # Placing source/ and generated-pascal/ in separate subdirectories makes it easier |
| 10 | # to browse, and to grep inside GLSL files, since you can easily grep only within source/ . |
| 11 | |
| 12 | ALL_SOURCES := $(wildcard source/*.fs) \ |
| 13 | $(wildcard source/*.vs) \ |
| 14 | $(wildcard source/*.gs) \ |
| 15 | $(wildcard source/*.glsl) |
| 16 | ALL_OUTPUT := $(addsuffix .inc, $(subst source/,generated-pascal/,$(ALL_SOURCES))) |
| 17 | |
| 18 | .PHONY: all |
| 19 | all: $(ALL_OUTPUT) |
| 20 | |
| 21 | generated-pascal/%.inc: source/% |
| 22 | file_to_pascal_string $< $@ |
| 23 | |
| 24 | .PHONY: clean |
| 25 | clean: |
| 26 | rm -f $(ALL_OUTPUT) |