diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-08 23:25:51 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-08 23:25:51 +0900 |
commit | 50c75c12597b230cec4d7a29559cde263025eeb2 (patch) | |
tree | 9fa8afe8bcf6e1219186e5c567930831a3b5eab5 /pacc/glsl/Makefile | |
parent | 4cfeddd04dcbbf658195bd837d7daff7f08b37bc (diff) |
pacc: initial
Diffstat (limited to 'pacc/glsl/Makefile')
-rw-r--r-- | pacc/glsl/Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pacc/glsl/Makefile b/pacc/glsl/Makefile new file mode 100644 index 0000000..36aace4 --- /dev/null +++ b/pacc/glsl/Makefile @@ -0,0 +1,40 @@ +VSHADERS:=blit.vert +FSHADERS:=copy.frag color.frag color_trans.frag key.frag fill.frag font.frag +DSHEADER:=dsheader +ESHEADER:=esheader +INCS:=$(addsuffix .inc,$(VSHADERS) $(FSHADERS) $(DSHEADER) $(ESHEADER)) +SHADERS2:=$(addsuffix .ds.vert,$(basename $(VSHADERS))) +SHADERS2+=$(addsuffix .es.vert,$(basename $(VSHADERS))) +SHADERS2+=$(addsuffix .ds.frag,$(basename $(FSHADERS))) +SHADERS2+=$(addsuffix .es.frag,$(basename $(FSHADERS))) +VALS:=$(addsuffix .vald,$(SHADERS2)) +VALIDATOR:=glslangValidator +VFLAGS:= + +all: $(INCS) + +val: $(VALS) + +%.es.vert: %.vert + cat $(ESHEADER) $< > $@ + +%.es.frag: %.frag + cat $(ESHEADER) $< > $@ + +%.ds.vert: %.vert + cat $(DSHEADER) $< > $@ + +%.ds.frag: %.frag + cat $(DSHEADER) $< > $@ + +%.vald: % + $(VALIDATOR) $(VFLAGS) $< + +%.inc: %.zt + xxd -i $< | sed -e '/^unsigned char /c\static const uint8_t $(shell echo $(basename $<) | sed -e 's/\./_/g')[] = {' -e '/^unsigned int /c\\' > $@ + +%.zt: % + dd bs=1 count=1 if=/dev/zero | cat $< - > $@ + +clean: + rm -f $(INCS) |