# rvs Makefile # # 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 . # Make Programs ##################################################### RM = rm -f CP = cp MKDIR = mkdir -p INSTALL = install PRE = @@pre@@ # code pre-processor # Variables ######################################################## SHELL = $$SHELL$$ prefix = $$prefix$$ bindir = $$bindir$$ libdir = $$libdir$$ sourcedir = @@sourcedir@@ # Targets ########################################################## rvs : wrapper core .PHONY : rvs install clean remove wrapper i-wrapper core i-core .SUFFIXES : wrapper : out/rvs core : shellScripts srcFiles = $(shell find $(sourcedir)/src/rvs-core/ -type f) outFiles = $(patsubst $(sourcedir)/src/%,out/%,${basename $(srcFiles)}) libFiles = $(patsubst out/rvs-core/%,$(libdir)/%, $(outFiles) ) shellScripts : $(outFiles) # install install : rvs i-wrapper i-core i-wrapper : $(prefix)/$(bindir)/rvs i-core : $(libFiles) # clean/remove clean : $(RM) -r tmp $(RM) -r out $(RM) Makefile remove : $(RM) $(prefix)/$(bindir)/rvs $(RM) -r $(libdir) # implicit rules out/% : $(sourcedir)/src/%.sh $(PRE) $(MKDIR) $(dir $@) $(PRE) <$< > $@ $(prefix)/$(bindir)/% : out/% $(INSTALL) -m 755 -o root -g root -T $< $@ $(libdir)/% : out/rvs-core/% $(libdir) $(INSTALL) -m 755 -o root -g root -d $(dir $@) $(INSTALL) -m 755 -o root -g root -T $< $@