commit 9dba47efd95a209a93434b0f5e7d8606afcfa5a3
parent bc0d5a35a84e6df3dbebad5718075d873e57e3f3
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Sat, 11 Jun 2016 17:20:05 -0600
bin: generate citrun-wrap from template
Diffstat:
4 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/Jamrules b/Jamrules
@@ -3,7 +3,7 @@ OPTIM = -O2 ;
# This should be set by the packaging system so that we can make binaries that
# will find everything they need to.
# If not, it will build binaries pointing to in-tree versions of everything.
-PREFIX ?= `pwd`/$(TOP) ;
+PREFIX ?= `pwd` ;
if $(OS) = OPENBSD {
C++ = eg++ ;
diff --git a/bin/Jamfile b/bin/Jamfile
@@ -1,4 +1,17 @@
SubDir TOP bin ;
+rule Generate
+{
+ Depends $(1) : $(2) ;
+ Depends all : $(1) ;
+}
+
+actions Generate
+{
+ sed -e s,%PREFIX%,$(PREFIX), -e s,%SHLIB_SUF%,$(SHLIB_SUF), < $(2) > $(1) ;
+}
+
+Generate $(TOP)/bin/citrun-wrap : $(TOP)/bin/citrun-wrap.sh ;
+
InstallBin $(PREFIX)/bin : citrun-wrap ;
InstallMan $(PREFIX)/man : citrun-wrap.1 ;
diff --git a/bin/citrun-wrap b/bin/citrun-wrap
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-export CITRUN_PATH="/usr/local/share/citrun"
-export CITRUN_LIB="/usr/local/lib/libcitrun.so.0.0"
-export PATH="$CITRUN_PATH:$PATH"
-
-exec $@
diff --git a/bin/citrun-wrap.sh b/bin/citrun-wrap.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+export CITRUN_PATH="%PREFIX%/share/citrun"
+export CITRUN_LIB="%PREFIX%/lib/libcitrun.%SHLIB_SUF%"
+export PATH="$CITRUN_PATH:$PATH"
+
+exec $@