diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2009-07-27 17:19:52 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:12 -0600 |
commit | 87348edd1b6f1e0f79f76d0c95676214396a5fcd (patch) | |
tree | 32a6dff83f6f1f1d75ad1255b0194718dc765aea /plugins | |
parent | 13ac989be47ce85bd9776c9787c9dc17ddda92f8 (diff) |
Further refactoring. Mostly tweaking makefiles. Switched to
autoconf-style variables. This means I had to change every shell script...
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/repo/Makefile.orig | 44 | ||||
-rw-r--r-- | plugins/repo/commit.d.sh | 2 | ||||
-rw-r--r-- | plugins/repo/commit.f.sh | 2 | ||||
-rw-r--r-- | plugins/repo/commit.sh | 2 | ||||
-rw-r--r-- | plugins/repo/get.d.sh | 2 | ||||
-rw-r--r-- | plugins/repo/get.f.sh | 2 | ||||
-rw-r--r-- | plugins/repo/get.sh | 2 | ||||
-rw-r--r-- | plugins/repo/lib/stdio.sh | 2 | ||||
-rw-r--r-- | plugins/users/Makefile.orig | 79 | ||||
-rw-r--r-- | plugins/users/init.sh | 2 | ||||
-rw-r--r-- | plugins/users/mkuser.sh | 2 | ||||
-rw-r--r-- | plugins/users/rmuser.sh | 2 |
12 files changed, 118 insertions, 25 deletions
diff --git a/plugins/repo/Makefile.orig b/plugins/repo/Makefile.orig index 00ffc5f..e4114be 100644 --- a/plugins/repo/Makefile.orig +++ b/plugins/repo/Makefile.orig @@ -13,6 +13,7 @@ name = repo # Variables ######################################################## RM ?= rm -f CP ?= cp +SED ?= sed INSTALL = install MKDIR ?= $(INSTALL) -d #mkdir -p INSTALL_PROGRAM ?= $(INSTALL) @@ -22,10 +23,11 @@ SHELL ?= @SHELL@ rvsdir ?= @rvsdir@/rvs srcdir ?= @srcdir@ -libdir = $(rvsdir)/$(name) +libdir = $(rvsdir)/$(name) reldir = plugins/$(name) -VPATH = $(srcdir)/$(reldir) +mysrcdir = $(srcdir)/$(reldir) +VPATH = $(mysrcdir) # phony targets #################################################### all : $(name) @@ -33,30 +35,42 @@ all : $(name) .SUFFIXES : # targets ########################################################## -srcFiles = $(filter-out %/Makefile.orig,$(shell find $(VPATH)/ -type f)) -shFiles = $(patsubst $(VPATH)/%,%,$(basename $(filter %.sh,$(srcFiles)))) +srcFiles = $(filter-out %/Makefile.orig,$(shell find $(mysrcdir)/ -type f)) -$(name) : $(shFiles) -#$(name) : +shSrcFiles = $(filter %.sh,$(srcFiles)) +shOutFiles = $(patsubst $(mysrcdir)/%,%,$(basename $(shSrcFiles))) +shExeFiles = $(patsubst %,$(libdir)/%, $(shOutFiles) ) +$(name) : $(shOutFiles) -# install/clean/remove ############################################# +# (un)install ###################################################### -#install : +install : $(shExeFiles) + echo $(name) >> $(rvsdir)/plugins + +uninstall : + $(RM) -r $(libdir) + $(SED) -i "/^$(name)$/ d" $(rvsdir)/plugins + +# clean ############################################################ clean : - $(RM) -r ./* - $(RM) Makefile + $(RM) $(shOutFiles) -remove : - $(RM) -r $(libdir) +distclean : clean + $(RM) Makefile # implicit rules ################################################### -# 'build' shell scripts -% : %.sh +b := @ +# build shell scripts +% : $(mysrcdir)/%.sh + $(MKDIR) $(dir $@) + $(SED) 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' <$< > $@ +# workaround... idk why it doesn't match `lib/' +lib/% : $(mysrcdir)/lib/%.sh $(MKDIR) $(dir $@) - $(CP) $< $@ + $(SED) 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' <$< > $@ # install $(libdir)/% : % diff --git a/plugins/repo/commit.d.sh b/plugins/repo/commit.d.sh index 7cfe98a..eabdc78 100644 --- a/plugins/repo/commit.d.sh +++ b/plugins/repo/commit.d.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs commit.d' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/repo/commit.f.sh b/plugins/repo/commit.f.sh index c3a652c..bb4a7d8 100644 --- a/plugins/repo/commit.f.sh +++ b/plugins/repo/commit.f.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs commit.f' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/repo/commit.sh b/plugins/repo/commit.sh index e5e8eba..fbfd7ca 100644 --- a/plugins/repo/commit.sh +++ b/plugins/repo/commit.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs commit' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/repo/get.d.sh b/plugins/repo/get.d.sh index 77107c2..98c490c 100644 --- a/plugins/repo/get.d.sh +++ b/plugins/repo/get.d.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs get.d' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/repo/get.f.sh b/plugins/repo/get.f.sh index f6ab761..37d7b26 100644 --- a/plugins/repo/get.f.sh +++ b/plugins/repo/get.f.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs get.f' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/repo/get.sh b/plugins/repo/get.sh index e1289f7..5618d0a 100644 --- a/plugins/repo/get.sh +++ b/plugins/repo/get.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs get' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/repo/lib/stdio.sh b/plugins/repo/lib/stdio.sh index e20cb7f..f85b7fa 100644 --- a/plugins/repo/lib/stdio.sh +++ b/plugins/repo/lib/stdio.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ #name='rvs stdio' #ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/users/Makefile.orig b/plugins/users/Makefile.orig new file mode 100644 index 0000000..ab109a7 --- /dev/null +++ b/plugins/users/Makefile.orig @@ -0,0 +1,79 @@ +#!/usr/bin/make -f +name = users +# version 0.7.0 +# Copyright (C) 2009 Luke Shumaker +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>. + + +# Variables ######################################################## +RM ?= rm -f +CP ?= cp +SED ?= sed +INSTALL = install +MKDIR ?= $(INSTALL) -d #mkdir -p +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= $(INSTALL) -m 644 + +SHELL ?= @SHELL@ +rvsdir ?= @rvsdir@/rvs +srcdir ?= @srcdir@ + +libdir = $(rvsdir)/$(name) +reldir = plugins/$(name) + +mysrcdir = $(srcdir)/$(reldir) +VPATH = $(mysrcdir) + +# phony targets #################################################### +all : $(name) +.PHONY : $(name) install clean remove +.SUFFIXES : + +# targets ########################################################## +srcFiles = $(filter-out %/Makefile.orig,$(shell find $(mysrcdir)/ -type f)) + +shSrcFiles = $(filter %.sh,$(srcFiles)) +shOutFiles = $(patsubst $(mysrcdir)/%,%,$(basename $(shSrcFiles))) +shExeFiles = $(patsubst %,$(libdir)/%, $(shOutFiles) ) + +$(name) : $(shOutFiles) + +# (un)install ###################################################### + +install : $(shExeFiles) + echo $(name) >> $(rvsdir)/plugins + +uninstall : + $(RM) -r $(libdir) + $(SED) -i "/^$(name)$/ d" $(rvsdir)/plugins + +# clean ############################################################ + +clean : + $(RM) $(shOutFiles) + +distclean : clean + $(RM) Makefile + +# implicit rules ################################################### + +b := @ +# build shell scripts +% : $(mysrcdir)/%.sh + $(MKDIR) $(dir $@) + $(SED) 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' <$< > $@ +# workaround... idk why it doesn't match `lib/' +lib/% : $(mysrcdir)/lib/%.sh + $(MKDIR) $(dir $@) + $(SED) 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' <$< > $@ + +# install +$(libdir)/% : % + $(MKDIR) $(dir $@) + $(INSTALL_PROGRAM) $< $@ + diff --git a/plugins/users/init.sh b/plugins/users/init.sh index ee570ff..ce1c6fd 100644 --- a/plugins/users/init.sh +++ b/plugins/users/init.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs init' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/users/mkuser.sh b/plugins/users/mkuser.sh index 594c024..de4aeea 100644 --- a/plugins/users/mkuser.sh +++ b/plugins/users/mkuser.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs mkuser' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker diff --git a/plugins/users/rmuser.sh b/plugins/users/rmuser.sh index 598bae9..85ba64a 100644 --- a/plugins/users/rmuser.sh +++ b/plugins/users/rmuser.sh @@ -1,4 +1,4 @@ -#!$$SHELL$$ +#!@SHELL@ name='rvs rmuser' ver='0.7.0' # Copyright (C) 2009 Luke Shumaker |