Added rule that can be used to avoid unnecessary recompilation of
[gedcom-parse.git] / Makefile.inc
index f86ad01d7b2867f6d5869c446567a5b52557c61a..a8e17c75fc46f4b0a44b05296e7448c6b214cbdb 100644 (file)
@@ -1,4 +1,4 @@
-## File to include in other Makefile's, defining common commands
+## File to include in other Makefile's, defining common commands and rules
 # $Id$
 # $Name$
 
@@ -10,3 +10,14 @@ define replace-VERSION
   mv $$file.new $$file; \
   done
 endef
+
+%.tabgen.h:    %.tab.h
+       if [ ! -r $@ ] ; \
+       then \
+         touch $@; \
+       fi
+       if ! diff -q $< $@ > /dev/null; \
+       then \
+         rm $@; \
+         cp $< $@; \
+       fi