summaryrefslogtreecommitdiff
path: root/wrapper/main.mk.in
diff options
context:
space:
mode:
Diffstat (limited to 'wrapper/main.mk.in')
-rw-r--r--wrapper/main.mk.in57
1 files changed, 23 insertions, 34 deletions
diff --git a/wrapper/main.mk.in b/wrapper/main.mk.in
index ecc6cc6..0f24d6b 100644
--- a/wrapper/main.mk.in
+++ b/wrapper/main.mk.in
@@ -17,59 +17,48 @@ ver = 0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-rvs = @name@
-dirs += $(libexecdir)/$(rvs)
-
-CFLAGS = -g \
- -DNAME=\"$(name)\" \
- -DVER=\"$(ver)\" \
- -Dlibexecdir=\"$(libexecdir)/$(rvs)\" \
- -Dplugin_conf=\"plugin.conf\"
+sysconfdir ?= @sysconfdir@
+BINDIR ?= @BINDIR@
+TMPDIR ?= @TMPDIR@
+LIBDIR ?= @LIBDIR@
+ETCDIR ?= @ETCDIR@
+dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
# phony targets ####################################################
-all : Makefiles rvs runcom
-.PHONY : install uninstall clean distclean dist install-runcom
-.SUFFIXES : .c .o
-VPATH = $(srcdir)/wrapper
-filelist=$(patsubst $(srcdir)/wrapper/%,%,$(shell find $(srcdir)/wrapper/* -type f))
+.PHONY : all
+all : Makefiles rvs
+VPATH = $(srcdir)
+filelist=$(patsubst $(srcdir)/%,%,$(shell find $(srcdir)/* -type f))
# most everything ##################################################
-RUNCOM = $(DESTDIR)$(libexecdir)/$(rvs)/runcom
-install : $(RVS) $(RUNCOM)
-$(RVS) : rvs $(dir $(RVS))
- $(INSTALL_PROGRAM) $< $@
-
-OBJ = runcom.o rvs.o plugins.o \
- plugin-depend.o \
- plugin-find.o \
- plugin-load.o \
- plugin-parse.o \
- plugin-run.o \
-runcom: $(OBJ)
- $(CC) -o $@ $^
-
-$(RUNCOM): runcom $(dir $(RUNCOM))
+# the installed wrapper
+$(RVS) : rvs $(dir $(RVS))
$(INSTALL_PROGRAM) $< $@
+# build the wrapper
b := @
-# build shell scripts
rvs : rvs.sh
$(INSTALL_PROGRAM) $< $@
$(SED) -i \
-e 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' \
- -e 's/$bname@/$(rvs)/g' \
- -e 's/$blibexecdir@/$(subst /,\/,$(libexecdir))/g' \
+ -e 's/$bname@/$(subst /,\/,$(rvs))/g' \
+ -e 's/$bBINDIR@/$(subst /,\/,$(BINDIR))/' \
+ -e 's/$bTMPDIR@/$(subst /,\/,$(TMPDIR))/' \
+ -e 's/$bLIBDIR@/$(subst /,\/,$(LIBDIR))/' \
+ -e 's/$bETCDIR@/$(subst /,\/,$(ETCDIR))/' \
$@
+# standard targes ####################################################
+.PHONY : install uninstall clean distclean
+install : $(RVS)
+
uninstall :
$(RM) $(RVS)
- $(RM) $(DESTDIR)$(libexecdir)/$(rvs)/runcom
clean :
- $(RM) *.o *.d
distclean : clean
$(RM) rvs
- $(RM) Makefile
+ $(RM) Makefile *.mk