commit 6bfd5d20fc3fff45811425e0f8f5949616abc2cd
parent 39a1b45998e8e047838ded92e62d569bf56bca55
Author: Kyle Milz <kyle@0x30.net>
Date:   Sat, 20 Aug 2016 13:37:15 -0600
Jam: simplify wrapper making
Diffstat:
2 files changed, 8 insertions(+), 25 deletions(-)
diff --git a/Jamrules b/Jamrules
@@ -3,14 +3,13 @@
 # instrumentation. If PREFIX is set, assume we're building a package.
 #
 if $(PREFIX) {
-	BUILD_MODE = "RELEASE" ;
+	echo ...build citrun (RELEASE) on $(OS)... ;
 	CITRUN_SHARE = $(PREFIX)/share/citrun ;
 }
 else {
-	BUILD_MODE = "DEBUG" ;
+	echo ...build citrun (DEBUG) on $(OS)... ;
 	CITRUN_SHARE = "`readlink -f $(TOP)/src`" ;
 }
-echo ...build citrun ($(BUILD_MODE)) on $(OS)... ;
 
 # Try and respect this, {pkg,llvm}-config gives -O? too unfortunately
 OPTIM = $(CFLAGS) ;
@@ -72,13 +71,6 @@ if $(CITRUN_COVERAGE) {
 # automatically.
 LINK = $(C++) ;
 
-actions Test {
-	prove ;
-}
-
-Test test : ;
-Test regress : ;
-
 rule Stringize
 {
 	MakeLocate $(1) : $(LOCATE_SOURCE) ;
@@ -92,19 +84,9 @@ actions Stringize
 	$(TOP)/bin/stringize "static const char *$(1:B)" $(2) > $(1) ;
 }
 
-rule MkWrap
-{
-	MakeLocate $(1) : $(LOCATE_SOURCE) ;
-	SEARCH on $(2) = $(SEARCH_SOURCE) ;
-	Depends $(1) : $(2) ;
-	Depends exe : $(1) ;
-	Clean clean : $(1) ;
-}
-
-actions MkWrap
+actions ReplaceTokens
 {
-	sed -e s,%CITRUN_SHARE%,$(CITRUN_SHARE), < $(2) > $(1) ;
-	chmod 755 $(1) ;
+	sed -i -e s,%CITRUN_SHARE%,$(CITRUN_SHARE), $(<) ;
 }
 
 rule InstallSyms
diff --git a/src/Jamfile b/src/Jamfile
@@ -12,10 +12,11 @@ LinkLibraries citrun-dump citrun-term citrun-gl : utils ;
 #
 # citrun-wrap, citrun-check
 #
-MkWrap citrun-wrap : wrap.in ;
-
-MakeLocate citrun-check : $(LOCATE_SOURCE) ;
+MakeLocate citrun-check citrun-wrap : $(LOCATE_SOURCE) ;
 Shell citrun-check : check.in ;
+Shell citrun-wrap : wrap.in ;
+
+ReplaceTokens citrun-wrap ;
 
 #
 # citrun-dump (not installed)