Based on a quick git diff we check that the glsl code has not changed.
This should fix out-of-tree builds and avoid all source modification
unless required.
When compiling from a tarball there should be no git tree (err 129),
or if there's one the files should not be checked in (ie. no diff).
If you changed the glsl files in a tarball... too bad for you.
If this is still not enough to fix the build, then go ahead and disable
the script from Makefile_Evas.am
I would like to note that the auto-generation during make is extremely
useful when working on the shaders, which is why I'd rather keep it enabled.
@fix
-/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
- * See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
typedef enum {
SHADER_RECT,
-/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
- * See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
#include "../evas_gl_private.h"
#endif
"
+# Skip generation if there is no diff (or no git)
+if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
+if git diff --quiet --exit-code -- "$DIR"
+then
+ touch "${OUTPUT}" "${OUTPUT_ENUM}"
+ exit 0
+fi
+
function upper() {
echo $@ |tr '[:lower:]' '[:upper:]'
}
IFS=$OIFS
# Write header
-printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n" > ${OUTPUT}
+printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n\n" > ${OUTPUT}
# Including private for hilights and stuff :)
printf "#include \"../evas_gl_private.h\"\n\n" >> ${OUTPUT}
printf "${shaders_source}};\n\n" >> ${OUTPUT}
-printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */
+printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
typedef enum {
${shaders_enum} SHADER_LAST
-/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
- * See: modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh */
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
static const char vertex_color_vert_glsl[] =
"#ifdef GL_ES\n"
OUTPUT=${DIR}/evas_gl_3d_shaders.x
+# Skip generation if there is no diff (or no git)
+if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
+if git diff --quiet --exit-code -- "$DIR"
+then
+ touch "${OUTPUT}"
+ exit 0
+fi
+
exec 1<&-
exec 1>${OUTPUT}
frag_shaders_source=""
# Write header
-printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n"
+printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n\n"
for shd in ${SHADERS} ; do
lname=`basename ${shd} .shd`