Skip to content

Commit

Permalink
Makefile: Add BINTOPKGLIBEXECDIR macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZmnSCPxj authored and cdecker committed Jan 9, 2018
1 parent bba8a3c commit 1946f0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ WIRE_GEN := tools/generate-wire.py

ALL_PROGRAMS =

CPPFLAGS = -DBINTOPKGLIBEXECDIR='"'$(shell sh tools/rel.sh $(bindir) $(pkglibexecdir))'"'
CWARNFLAGS := -Werror -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition
CDEBUGFLAGS := -std=gnu11 -g -fstack-protector
CFLAGS = $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) $(EXTERNAL_INCLUDE_FLAGS) -I . $(FEATURES) $(COVFLAGS) $(DEV_CFLAGS) -DSHACHAIN_BITS=48
CFLAGS = $(CPPFLAGS) $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) $(EXTERNAL_INCLUDE_FLAGS) -I . $(FEATURES) $(COVFLAGS) $(DEV_CFLAGS) -DSHACHAIN_BITS=48

LDLIBS = -lgmp -lsqlite3 $(COVFLAGS)

Expand Down Expand Up @@ -311,6 +312,7 @@ prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libexecdir = $(exec_prefix)/libexec
pkglibexecdir = $(libexecdir)/$(PKGNAME)
datadir = $(prefix)/share
docdir = $(datadir)/doc/$(PKGNAME)
mandir = $(datadir)/man
Expand Down
7 changes: 7 additions & 0 deletions tools/rel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/sh

from=${1}
to=${2}
common=`printf '%s\0%s' "${from}" "${to}" | sed 's/\(.*\).*\x0\1.*/\1/' | sed 's@/[^/]*$@/@'`
prefix=`printf '%s\n' ${from#$common} | sed 's@[^/][^/]*@..@g'`
printf '%s\n' "$prefix/${to#$common}"

0 comments on commit 1946f0c

Please sign in to comment.