svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk

Jilles Tjoelker jilles at stack.nl
Sun Sep 15 20:16:41 UTC 2013


On Fri, Sep 13, 2013 at 12:19:27AM +0200, Jilles Tjoelker wrote:
> On Thu, Sep 05, 2013 at 10:15:40PM +0200, Joel Dahl wrote:
> > Installworld is still broken on systems with readonly /usr/obj.

> I use this. It makes the mapper.dir and similar files depend on their
> actual sources instead of phony targets, and therefore only rebuilt when
> needed.

The previous patch had some problems (two makes in parallel in the same
directory, no rebuild when the sources of the $i/foo.$i files changed in
-DNOCLEAN mode). This patch should work better. It avoids changing the
targets and instead leaves the destination file untouched if the content
remains the same.

Index: share/i18n/csmapper/Makefile
===================================================================
--- share/i18n/csmapper/Makefile	(revision 255570)
+++ share/i18n/csmapper/Makefile	(working copy)
@@ -7,10 +7,11 @@
 	KAZAKH KOI KS MISC TCVN
 
 mapper.dir: ${SUBDIR}
-	> ${.TARGET}
-.for i in ${SUBDIR}
-	cat ${i}/mapper.dir.${i} >> ${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/mapper.dir.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 mapper.dir.db: mapper.dir
 	${MKCSMAPPER} -m -o ${.TARGET} ${.ALLSRC}
 
@@ -18,10 +19,11 @@
 CLEANFILES+= mapper.dir mapper.dir.db
 
 charset.pivot: ${SUBDIR}
-	> ${.TARGET}
-.for i in ${SUBDIR}
-	cat ${i}/charset.pivot.${i} >> ${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/charset.pivot.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 charset.pivot.pvdb: charset.pivot
 	${MKCSMAPPER} -p -o ${.TARGET} ${.ALLSRC}
 
Index: share/i18n/esdb/Makefile
===================================================================
--- share/i18n/esdb/Makefile	(revision 255570)
+++ share/i18n/esdb/Makefile	(working copy)
@@ -10,18 +10,20 @@
 CLEANFILES= ${FILES}
 
 esdb.dir: ${SUBDIR}
-	> $@
-.for i in ${SUBDIR}
-	cat ${i}/esdb.dir.${i} >>${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/esdb.dir.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 esdb.dir.db: esdb.dir
 	${MKESDB} -m -o ${.TARGET} ${.ALLSRC}
 
 esdb.alias: ${SUBDIR}
-	> $@
-.for i in ${SUBDIR}
-	cat ${i}/esdb.alias.${i} >>${.TARGET}
-.endfor
+	newfile=$$(for i in ${SUBDIR}; do \
+		cat $$i/esdb.alias.$$i; \
+	done); \
+	[ "$$newfile" = "$$(cat ${.TARGET} 2>/dev/null)" ] || \
+		printf '%s\n' "$$newfile" >${.TARGET}
 esdb.alias.db: esdb.alias
 	${MKESDB} -m -o ${.TARGET} ${.ALLSRC}
 

-- 
Jilles Tjoelker


More information about the svn-src-all mailing list