summaryrefslogtreecommitdiff
path: root/plugins/plugin.mk.in
diff options
context:
space:
mode:
authorLuke Shumaker <luke@HP-dv6246us-u910.(none)>2010-03-28 12:25:08 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:19 -0600
commit30f1fbf2aab8ae6c45907bab2eafdb0e09998c15 (patch)
tree9166382abde44ee694b209f60e0f75b4fccc6133 /plugins/plugin.mk.in
parentfb5ce668f909c96628df33f9cb9421032db8dfdc (diff)
Rework rvs a lot (no longer needs complex C dependency tracker!)
Rework ./configure, and how it uses `srcdir'. Probably broke all the other packages. Oh well, everything only half-works right now.
Diffstat (limited to 'plugins/plugin.mk.in')
-rw-r--r--plugins/plugin.mk.in53
1 files changed, 32 insertions, 21 deletions
diff --git a/plugins/plugin.mk.in b/plugins/plugin.mk.in
index 6980538..8af5fcc 100644
--- a/plugins/plugin.mk.in
+++ b/plugins/plugin.mk.in
@@ -18,37 +18,51 @@ include info.mk # this contains the actuall name/version for the plugin
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
+sysconfdir ?= @sysconfdir@
+BINDIR ?= @BINDIR@
+TMPDIR ?= @TMPDIR@
+LIBDIR ?= @LIBDIR@
+ETCDIR ?= @ETCDIR@
+dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
+
rvs = @name@
id = $(name)-$(ver)
# phony targets ####################################################
all : $(name)
-.PHONY : $(name) install uninstall clean distclean dist
+.PHONY : $(name) install uninstall clean distclean
.SUFFIXES :
# build ############################################################
-mysrcdir = $(srcdir)/plugins/$(name)
-myoutdir = out
+$(info srcdir:$(srcdir))
-srcFiles = $(filter-out %/Makefile.in,$(shell find $(mysrcdir)/ -type f))
+srcFiles = $(filter-out %/Makefile.in,$(shell find $(srcdir)/ -type f))
shSrcFiles = $(filter %.sh,$(srcFiles))
-shOutFiles = $(patsubst $(mysrcdir)/%,$(myoutdir)/%,$(basename $(shSrcFiles)))
+shOutFiles = $(patsubst $(srcdir)/%,%,$(basename $(shSrcFiles)))
-$(name) : $(myoutdir) $(shOutFiles) $(myoutdir)/plugin.conf
-
-$(myoutdir)/plugin.conf : $(mysrcdir)/plugin.conf.in
- $(INSTALL_DATA) $< $@
- $(SED) -i \
- -e 's/$bname@/$(subst /,\/,$(name))/g' \
- -e 's/$bver@/$(subst /,\/,$(ver))/g' \
- $@
+outFiles = $(shOutFiles)
+outBin = $(addprefix bin-,$(notdir $(filter bin/%,$(outFiles))))
+outEtc = $(addprefix $(ETCDIR)/$(name),$(notdir $(filter etc/%,$(outFiles))))
+outLib = $(addprefix $(LIBDIR)/$(name),$(notdir $(filter lib/%,$(outFiles))))
+$(name) : $(myoutdir) $(shOutFiles)
# (un)install ######################################################
-install : all
- $(RVS) install $(name)-$(ver) $(myoutdir)
+install : $(outBin) $(outEtc) $(outLib)
+
+unbin-% : bin/%
+ $(RVS) uninstall $(notdir $<) $(name)
+
+bin-% : bin/%
+ $(RVS) install $< $(notdir $<) $(name) $(priority)
+
+$(ECTDIR)/$(name)/% : etc/%
+ $(CP) $< $@
+
+$(LIBDIR)/$(name)/% : lib/%
+ $(CP) $< $@
uninstall :
$(RVS) uninstall $(name)
@@ -58,14 +72,14 @@ uninstall :
clean :
distclean : clean
- $(RM) Makefile
- $(RM) -r out
+ find ./ -name Makefile -exec $(RM) '{}' \;
+ find ./ -name '*.mk' -exec $(RM) '{}' \;
# implicit rules ###################################################
b := @
# build shell scripts
-$(myoutdir)/% : $(mysrcdir)/%.sh $(myoutdir)
+% : %.sh
$(INSTALL_PROGRAM) $< $@
$(SED) -i \
-e 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' \
@@ -73,6 +87,3 @@ $(myoutdir)/% : $(mysrcdir)/%.sh $(myoutdir)
-e 's/$bID@/$(subst /,\/,$(id))/g' \
$@
-$(DESTDIR)$(libexecdir)/$(rvs) $(myoutdir) :
- $(MKDIR) $@
-