diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2009-07-26 17:58:28 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-06-26 00:30:12 -0600 |
commit | c283a7d4327d7d18620ac97e927d88d5667781a4 (patch) | |
tree | 4041d43acc01c58236c5bd7accc9bb42021aaf3c /Makefile.orig | |
parent | dd78d7c7724e4da4b6f44f0483f0d28792c8f13c (diff) |
much refactoring. also, screw `bzr mv'. That's why I'm writing my own system.
Diffstat (limited to 'Makefile.orig')
-rw-r--r-- | Makefile.orig | 92 |
1 files changed, 53 insertions, 39 deletions
diff --git a/Makefile.orig b/Makefile.orig index 975cb06..9b8473d 100644 --- a/Makefile.orig +++ b/Makefile.orig @@ -1,4 +1,4 @@ -# +#!/usr/bin/make -f # rvs Makefile # version 0.7.0 # Copyright (C) 2009 Luke Shumaker @@ -10,66 +10,80 @@ # Originally written by Luke Shumaker <lukeshu@sbcglobal.net>. -# Make Programs ##################################################### +# Variables ######################################################## 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 +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 : -wrapper : out/rvs +# targets ########################################################## -core : shellScripts +rvs : out/rvs out/plugins/plugins -srcFiles = $(shell find $(sourcedir)/src/core/ -type f) -outFiles = $(patsubst $(sourcedir)/src/%,out/%,${basename $(srcFiles)}) -libFiles = $(patsubst out/core/%,$(libdir)/%, $(outFiles) ) -shellScripts : $(outFiles) - -# install - -install : rvs i-wrapper i-core - -i-wrapper : $(prefix)/$(bindir)/rvs +out/plugins/plugins : $(srcdir)/src/plugins/plugins $(PRE) + $(MKDIR) $(dir $@) + $(PRE) <$< > $@ +$(rvsdir)/plugins : + $(MKDIR) -d $(dir $@) + $(TOUCH) $@ -i-core : $(libFiles) +# install/clean/remove ############################################# -# clean/remove +install : $(prefix)/$(bindir)/rvs $(rvsdir)/plugins $(install-plugins) clean : - $(RM) -r tmp $(RM) -r out + $(RM) var.sed $(RM) Makefile remove : $(RM) $(prefix)/$(bindir)/rvs - $(RM) -r $(libdir) + $(RM) -r $(rvsdir) -# implicit rules +# implicit rules ################################################### -out/% : $(sourcedir)/src/%.sh $(PRE) +# 'build' shell scripts +out/% : $(srcdir)/%.sh $(MKDIR) $(dir $@) $(PRE) <$< > $@ +# install $(prefix)/$(bindir)/% : out/% - $(INSTALL) -m 755 -o root -g root -T $< $@ + $(MKDIR) $(dir $@) + $(INSTALL_PROGRAM) $< $@ + +# make plugins +make-% : $(srcdir)/plugins/% + $(MAKE) -C $($< -$(libdir)/% : out/core/% - $(INSTALL) -m 755 -o root -g root -d $(dir $@) - $(INSTALL) -m 755 -o root -g root -T $< $@ +# install plugins +install-% : make-% + $(MAKE) -C $< install + +#remove-% |