Use move-if-changed and a timestamp file to avoid re-running commands and
authorKen Raeburn <raeburn@mit.edu>
Sat, 20 Jan 2007 19:11:34 +0000 (19:11 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 20 Jan 2007 19:11:34 +0000 (19:11 +0000)
updating krb5.h when there are no textual changes.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19098 dc483132-0cff-0310-8789-dd5450dbe970

src/include/Makefile.in

index e5293dba90a4eb85ea18774822668c07ff94f096..d4083faccdf2c5d08b930e95bc2aa049db704191 100644 (file)
@@ -77,16 +77,19 @@ osconf.h: $(OSCONFSRC) Makefile
 ##DOS##!endif
 ###############################################################################
 
-krb5/krb5.h: $(srcdir)/krb5/krb5.hin $(K5_ET_HEADERS)
+krb5/krb5.h: krb5.stamp; : krb5.h
+krb5.stamp: $(srcdir)/krb5/krb5.hin $(K5_ET_HEADERS)
        test -d krb5 || mkdir krb5
        if test -r krb5.h; then \
          if cmp -s krb5.h $(srcdir)/krb5.h; then :; else rm -f krb5.h; fi; \
        else :; fi
-       echo "/* This file is generated, please don't edit it directly.  */" > krb5/krb5.h
-       echo "#ifndef KRB5_KRB5_H_INCLUDED" >> krb5/krb5.h
-       echo "#define KRB5_KRB5_H_INCLUDED" >> krb5/krb5.h
-       cat $(srcdir)/krb5/krb5.hin $(K5_ET_HEADERS) >> krb5/krb5.h
-       echo "#endif /* KRB5_KRB5_H_INCLUDED */" >> krb5/krb5.h
+       echo "/* This file is generated, please don't edit it directly.  */" > krb5/krb5.new
+       echo "#ifndef KRB5_KRB5_H_INCLUDED" >> krb5/krb5.new
+       echo "#define KRB5_KRB5_H_INCLUDED" >> krb5/krb5.new
+       cat $(srcdir)/krb5/krb5.hin $(K5_ET_HEADERS) >> krb5/krb5.new
+       echo "#endif /* KRB5_KRB5_H_INCLUDED */" >> krb5/krb5.new
+       $(MOVEIFCHANGED) krb5/krb5.new krb5/krb5.h
+       touch krb5.stamp
 
 verify-calling-conventions-krb5: private-and-public-decls
        $(PERL) -w $(SRCTOP)/util/def-check.pl private-and-public-decls $(SRCTOP)/lib/krb5_32.def
@@ -107,7 +110,7 @@ force:
 
 clean-unix::
        $(RM) krb5/krb5.h krb5_err.h kdb5_err.h kv5m_err.h krb524_err.h \
-               asn1_err.h private-and-public-decls
+               asn1_err.h private-and-public-decls krb5.stamp
        $(RM) $(ET_HEADERS) autoconf.stamp
 
 clean-windows::