[hackers] [wmii] Greatly speed up recursive make from hg. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Mon, 26 Oct 2009 20:55:35 +0000 (UTC)

changeset: 2576:bc6ff98f6b17
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Mon Oct 26 16:35:43 2009 -0400
files: mk/dir.mk mk/hdr.mk mk/wmii.mk
description:
Greatly speed up recursive make from hg.

diff -r 529a390c6775 -r bc6ff98f6b17 mk/dir.mk
--- a/mk/dir.mk Mon Oct 26 15:27:43 2009 -0400
+++ b/mk/dir.mk Mon Oct 26 16:35:43 2009 -0400
@@ -2,6 +2,7 @@
         set -e; \
         targ=$@; targ=$${targ\#d}; \
         for i in $$dirs; do \
+ export $(SUBMAKE_EXPORT); \
                 export BASE=$(BASE)$$i/; \
                 if [ ! -d $$i ]; then \
                         echo Skipping nonexistent directory: $$i 1>&2; \
diff -r 529a390c6775 -r bc6ff98f6b17 mk/hdr.mk
--- a/mk/hdr.mk Mon Oct 26 15:27:43 2009 -0400
+++ b/mk/hdr.mk Mon Oct 26 16:35:43 2009 -0400
@@ -1,3 +1,23 @@
+DIR =
+DIRS =
+DOC =
+DOCDIR =
+DOCS =
+EXECS =
+HFILES =
+INCLUDES =
+LIB =
+LIBS =
+OBJ =
+OFILES =
+OFILES_PIC =
+PACKAGES =
+PROG =
+SO =
+TAGFILES =
+TARG =
+TEXT =
+
 FILTER = cat
 
 EXCFLAGS = $(INCLUDES) -D_XOPEN_SOURCE=600
diff -r 529a390c6775 -r bc6ff98f6b17 mk/wmii.mk
--- a/mk/wmii.mk Mon Oct 26 15:27:43 2009 -0400
+++ b/mk/wmii.mk Mon Oct 26 16:35:43 2009 -0400
@@ -1,11 +1,18 @@
+
 VERS = hg$$(hg identify -n)
-VERS = hg$$(hg log -r $$(hg id 2>/dev/null | awk -F'[+ ]' '{print $$1}') --template '{rev}' 2>/dev/null)
-VERSION = $(VERS)
-VERSION := $(shell echo $(VERS))
-VERSION != echo $(VERS)
+VERS = $$(test -n "$$WMII_HGVERSION" && echo $$WMII_HGVERSION || \
+ echo hg$$(hg log -r $$(hg id 2>/dev/null | awk -F'[+ ]' '{print $$1}') --template '{rev}' 2>/dev/null))
+
+WMII_HGVERSION = $(VERS)
+WMII_HGVERSION := $(shell echo $(VERS))
+WMII_HGVERSION != echo $(VERS)
+VERSION = $(WMII_HGVERSION)
 CONFVERSION = -hg
 COPYRIGHT = ©2009 Kris Maglione
 
+.MAKE.EXPORTED += WMII_HGVERSION
+SUBMAKE_EXPORT = WMII_HGVERSION=$(WMII_HGVERSION)
+
 LIBS9 = $(ROOT)/lib/libregexp9.a $(ROOT)/lib/libbio.a $(ROOT)/lib/libfmt.a $(ROOT)/lib/libutf.a
 
 CFLAGS += '-DVERSION=\"$(VERSION)\"' '-DCOPYRIGHT=\"$(COPYRIGHT)\"' \
Received on Mon Oct 26 2009 - 20:55:35 UTC

This archive was generated by hypermail 2.2.0 : Mon Oct 26 2009 - 21:00:10 UTC