commands: install helpers in libexec

Script helpers to the evl command are installed in $prefix/libexec. By
convention, source scripts are suffixed by ".evl" to identify them
unambiguously. They are copied to $libexec/evl-<script>.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
This commit is contained in:
Philippe Gerum 2019-03-31 12:42:03 +02:00
parent 2014a9aff7
commit 333cacc1f5
4 changed files with 13 additions and 7 deletions

View File

@ -2,10 +2,11 @@
include ../config.mk
CMDFILES := $(wildcard *.c)
BINARIES = $(CMDFILES:%.c=%)
TARGETS = $(CMDFILES:%.c=$(O_DIR)/%)
DEPFILES = $(CMDFILES:%.c=$(O_DIR)/%.d)
SRCFILES := $(wildcard *.c)
BINARIES = $(SRCFILES:%.c=%)
TARGETS = $(SRCFILES:%.c=$(O_DIR)/%)
DEPFILES = $(SRCFILES:%.c=$(O_DIR)/%.d)
HELPERS = $(wildcard *.evl)
CMD_CPPFLAGS := $(BASE_CPPFLAGS) -I.
CMD_CFLAGS := $(CMD_CPPFLAGS) $(BASE_CFLAGS)
@ -14,9 +15,13 @@ override CFLAGS := $(CMD_CFLAGS) $(CFLAGS)
all: $(TARGETS)
install: all
$(Q)for bin in $(BINARIES); do \
$(INSTALL) -D $(O_DIR)/$$bin $(DESTDIR)/$(bindir)/$$bin; \
done
$(call inst-cmd,commands, \
for bin in $(BINARIES); do \
$(INSTALL) -D $(O_DIR)/$$bin $(DESTDIR)/$(bindir)/$$bin; done)
$(call inst-cmd,helpers, \
for hlp in $(HELPERS); do \
name=evl-$$(basename $$hlp .evl); \
$(INSTALL) -D $$hlp $(DESTDIR)/$(libexecdir)/$$name; done)
clean clobber mrproper:
$(Q)$(RM) -f $(TARGETS) $(DEPFILES)

View File

@ -24,6 +24,7 @@ libdir ?= lib
includedir ?= include
bindir ?= bin
testdir ?= tests
libexecdir ?= libexec
export ARCH CROSS_COMPILE CC LD AR UAPI CFLAGS LDFLAGS DESTDIR