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 /Makefile.orig | |
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 'Makefile.orig')
-rw-r--r-- | Makefile.orig | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/Makefile.orig b/Makefile.orig index 9b8473d..7a3e131 100644 --- a/Makefile.orig +++ b/Makefile.orig @@ -13,12 +13,13 @@ # Variables ######################################################## RM = rm -f CP = cp +SED = sed INSTALL = install MKDIR = $(INSTALL) -d #mkdir -p INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 TOUCH = touch -export RM CP INSTALL MKDIR INSTALL_PROGRAM INSTALL_DATA +export RM CP SED INSTALL MKDIR INSTALL_PROGRAM INSTALL_DATA SHELL = @SHELL@ prefix = @prefix@ @@ -29,61 +30,61 @@ rvsdir = @rvsdir@/rvs srcdir = @srcdir@ export SHELL rvsdir srcdir -plugins = $(shell find $(srcdir)/plugins/* -maxdepth 0 -type d) +plugins = $(patsubst $(srcdir)/plugins/%,%,\ + $(shell find $(srcdir)/plugins/* -maxdepth 0 -type d)) # phony targets #################################################### -make-plugins = $(addprefix make-,$(plugins)) -install-plugins = $(addprefix install-,$(plugins)) -remove-plugins = $(addprefix remove-,$(plugins)) +make-plugins = $(addprefix p-,$(plugins)) +install-plugins = $(addprefix install-p-,$(plugins)) +remove-plugins = $(addprefix remove-p-,$(plugins)) all-plugins = $(make-plugins) $(install-plugins) $(remove-plugins) all : rvs $(make-plugins) -.PHONY : rvs install clean remove $(all-plugins) +#.PHONY : install uninstall clean distclean $(all-plugins) +.PHONY : install uninstall clean distclean .SUFFIXES : # targets ########################################################## -rvs : out/rvs out/plugins/plugins - -out/plugins/plugins : $(srcdir)/src/plugins/plugins $(PRE) - $(MKDIR) $(dir $@) - $(PRE) <$< > $@ - $(rvsdir)/plugins : - $(MKDIR) -d $(dir $@) + $(MKDIR) $(dir $@) $(TOUCH) $@ # install/clean/remove ############################################# -install : $(prefix)/$(bindir)/rvs $(rvsdir)/plugins $(install-plugins) +install : $(bindir)/rvs $(rvsdir)/plugins $(install-plugins) clean : - $(RM) -r out + +distclean : clean $(RM) var.sed $(RM) Makefile -remove : +uninstall : $(RM) $(prefix)/$(bindir)/rvs $(RM) -r $(rvsdir) # implicit rules ################################################### # 'build' shell scripts -out/% : $(srcdir)/%.sh +b := @ +% : $(srcdir)/%.sh $(MKDIR) $(dir $@) - $(PRE) <$< > $@ + $(SED) -e 's/$bSHELL@/$(subst /,\/,$(SHELL) )/g' \ + -e 's/$brvsdir@/$(subst /,\/,$(rvsdir))/g' <$< > $@ # install -$(prefix)/$(bindir)/% : out/% +$(bindir)/% : % $(MKDIR) $(dir $@) $(INSTALL_PROGRAM) $< $@ # make plugins -make-% : $(srcdir)/plugins/% - $(MAKE) -C $($< +p-% : plugins/% plugins/%/Makefile $(srcdir)/plugins/% + $(MAKE) -C $< # install plugins -install-% : make-% +install-p-% : plugins/% plugins/%/Makefile $(srcdir)/plugins/% p-% $(MAKE) -C $< install - -#remove-% +# uninstall plugins +uninstall-p-% : plugins/% plugins/%/Makefile + $(MAKE) -C $< uninstall |