Portability fix: 'if ! diff ...' is not always supported in sh.
[gedcom-parse.git] / Makefile.inc
index a8e17c75fc46f4b0a44b05296e7448c6b214cbdb..aa01812cf7e657818cd3b060b17d25fef09da4e0 100644 (file)
@@ -12,12 +12,14 @@ define replace-VERSION
 endef
 
 %.tabgen.h:    %.tab.h
-       if [ ! -r $@ ] ; \
+       if [ ! -r $(srcdir)/$@ ] ; \
        then \
-         touch $@; \
+         touch $(srcdir)/$@; \
        fi
-       if ! diff -q $< $@ > /dev/null; \
+       if diff $< $(srcdir)/$@ > /dev/null 2>&1; \
        then \
-         rm $@; \
-         cp $< $@; \
+         : ; \
+       else \
+         rm $(srcdir)/$@; \
+         cp $(srcdir)/$< $(srcdir)/$@; \
        fi