#!/usr/bin/make -f # rvs Makefile # 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 . # Variables ######################################################## RM = rm -f CP = cp 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 SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ rvsdir = @rvsdir@/rvs srcdir = @srcdir@ export SHELL rvsdir 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)) all-plugins = $(make-plugins) $(install-plugins) $(remove-plugins) all : rvs $(make-plugins) .PHONY : rvs install clean remove $(all-plugins) .SUFFIXES : # targets ########################################################## rvs : out/rvs out/plugins/plugins out/plugins/plugins : $(srcdir)/src/plugins/plugins $(PRE) $(MKDIR) $(dir $@) $(PRE) <$< > $@ $(rvsdir)/plugins : $(MKDIR) -d $(dir $@) $(TOUCH) $@ # install/clean/remove ############################################# install : $(prefix)/$(bindir)/rvs $(rvsdir)/plugins $(install-plugins) clean : $(RM) -r out $(RM) var.sed $(RM) Makefile remove : $(RM) $(prefix)/$(bindir)/rvs $(RM) -r $(rvsdir) # implicit rules ################################################### # 'build' shell scripts out/% : $(srcdir)/%.sh $(MKDIR) $(dir $@) $(PRE) <$< > $@ # install $(prefix)/$(bindir)/% : out/% $(MKDIR) $(dir $@) $(INSTALL_PROGRAM) $< $@ # make plugins make-% : $(srcdir)/plugins/% $(MAKE) -C $($< # install plugins install-% : make-% $(MAKE) -C $< install #remove-%