cogl-fixed-vertex-shader.glsl \
cogl-fixed-fragment-shader.glsl
-.glsl.h :
- /bin/sh $(top_srcdir)/clutter/cogl/gles/stringify.sh -h $<
+BUILT_SOURCES = \
+ cogl-fixed-vertex-shader.h \
+ cogl-fixed-vertex-shader.c \
+ cogl-fixed-fragment-shader.h \
+ cogl-fixed-fragment-shader.c
-.glsl.c :
- /bin/sh $(top_srcdir)/clutter/cogl/gles/stringify.sh $<
+%.h: $(srcdir)/%.glsl
+ /bin/sh $(srcdir)/stringify.sh -h $< > $@
+%.c: $(srcdir)/%.glsl
+ /bin/sh $(srcdir)/stringify.sh $< > $@
-cogl-gles2-wrapper.lo : cogl-fixed-vertex-shader.h cogl-fixed-fragment-shader.h
output_copyright ()
{
- cat <<EOF > "$1";
+ cat <<EOF
/*
* Cogl
*
# If two arguments are given then generate the header file instead
if test "$#" = 2; then
- bfname="${2%.glsl}";
- bname=`basename "$bfname"`;
- varname=`echo -n "${bname}" | tr -c a-z _`;
- guardname=`echo -n "${varname}" | tr a-z A-Z`;
- guardname="__${guardname}_H";
- headername="${bfname}.h";
+ bfname="${2%.glsl}"
+ bname=`basename "$bfname"`
+ varname=`echo -n "${bname}" | tr -c a-z _`
+ guardname=`echo -n "${varname}" | tr a-z A-Z`
+ guardname="__${guardname}_H"
- output_copyright "${headername}";
- echo >> "${headername}";
- echo "#ifndef ${guardname}" >> "${headername}";
- echo "#define ${guardname}" >> "${headername}";
- echo >> "${headername}";
+ output_copyright
+ echo
+ echo "#ifndef ${guardname}"
+ echo "#define ${guardname}"
+ echo
sed -n \
-e 's/^ *\/\*\*\* \([a-zA-Z0-9_]*\) \*\*\*\//extern const char \1[];/p' \
- < "$2" >> "${headername}";
+ < "$2"
- echo >> "${headername}";
- echo "#endif /* ${guardname} */" >> "${headername}";
+ echo
+ echo "#endif /* ${guardname} */"
else
bfname="${1%.glsl}";
bname=`basename "${bfname}"`;
- cname="${bfname}.c";
varname=`echo -n "${bname}" | tr -c a-z _`;
- output_copyright "${cname}";
- echo >> "${cname}";
+ output_copyright
+ echo
sed -n \
-e h \
-e 's/^ *\/\*\*\* \([a-zA-Z0-9_]*\) \*\*\*\// ;\nconst char \1[] =/' \
-e 's/$/\\n"/' \
-e ': got' \
-e p \
- < "$1" >> "${cname}";
- echo " ;" >> "${cname}";
-fi;
+ < "$1"
+ echo " ;"
+fi