citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 3597d6dbeb84ad03ec37880e9f7aa4e3e131eece
parent 20b0e057ba70c92e6d3e413c1448282b0a4cd8c3
Author: Kyle Milz <kyle@0x30.net>
Date:   Sat,  9 Jul 2016 13:03:31 -0600

detect when PREFIX is given and adjust paths accordingly

Diffstat:
MJamrules | 15++++++++++++---
Msrc/Jamfile | 2+-
Msrc/wrap.in | 2+-
3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Jamrules b/Jamrules @@ -1,10 +1,19 @@ -VERSION = 0 ; -PREFIX ?= `pwd` ; +if ! $(PREFIX) { + # No PREFIX means an in tree build. Use absolute paths to local copies. + PWD = `pwd` ; + CITRUN_LIB = $(PWD)/lib/libcitrun.a ; + CITRUN_PATH = $(PWD)/share ; +} +else { + # PREFIX was set, use absolute install paths. + CITRUN_LIB = $(PREFIX)/lib/libcitrun.a ; + CITRUN_PATH = $(PREFIX)/share/citrun ; +} # Packaging systems like for build systems to respect this. OPTIM = $(CFLAGS) ; -C++FLAGS += -DCITRUN_LIB=$(PREFIX)/lib/libcitrun.a -DCITRUN_PATH=$(PREFIX)/share/citrun ; +C++FLAGS += -DCITRUN_LIB=$(CITRUN_LIB) -DCITRUN_PATH=$(CITRUN_PATH) ; if $(OS) = OPENBSD { C++ = eg++ ; diff --git a/src/Jamfile b/src/Jamfile @@ -9,7 +9,7 @@ rule MkCitrunWrap actions MkCitrunWrap { - sed -e s,%PREFIX%,$(PREFIX), < $(2) > $(1) ; + sed -e s,%CITRUN_PATH%,$(CITRUN_PATH), < $(2) > $(1) ; chmod 755 $(1) ; } diff --git a/src/wrap.in b/src/wrap.in @@ -1,4 +1,4 @@ #!/bin/sh -export PATH="%PREFIX%/share/citrun:$PATH" +export PATH="%CITRUN_PATH%:$PATH" exec $@