summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2009-09-05 13:00:55 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:14 -0600
commitea8a13dfa2a25f52cc245a8992fbff5d1e41106d (patch)
tree7863baa36237143521d2480a216bdeb64569e124
parent67d3b5846d84d4a2e5a31d4e268bc9d51495d7e0 (diff)
work on tieing it all together
-rw-r--r--Makefile.in49
-rwxr-xr-xc/Makefile8
-rwxr-xr-xconfigure3
-rw-r--r--plugins/repo/Makefile.in1
-rw-r--r--plugins/users/Makefile.in1
-rwxr-xr-xwrapper/Makefile.in77
-rw-r--r--wrapper/plugin-debug.c (renamed from c/plugin-debug.c)4
-rw-r--r--wrapper/plugin-depend.c (renamed from c/plugin-depend.c)4
-rw-r--r--wrapper/plugin-parse.c (renamed from c/plugin-parse.c)4
-rw-r--r--wrapper/plugin.c (renamed from c/plugin.c)6
-rw-r--r--wrapper/plugin.h (renamed from c/plugin.h)4
-rw-r--r--wrapper/rvs.c (renamed from c/rvs.c)0
-rw-r--r--wrapper/rvs.h (renamed from c/rvs.h)4
-rw-r--r--wrapper/test.c (renamed from c/test.c)0
14 files changed, 129 insertions, 36 deletions
diff --git a/Makefile.in b/Makefile.in
index 165d11b..bef0841 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,6 +31,7 @@ dirs = $(srcdir) $(prefix) $(exec_prefix) $(bindir) $(sbindir) $(libexecdir)/
export srcdir prefix exec_prefix bindir sbindir libexecdir
# programs #########################################################
+CC = @CC@
RVS = @RVS@
SHELL = @SHELL@
RM = rm -f
@@ -44,40 +45,29 @@ TOUCH = touch
export RVS SHELL RM CP SED INSTALL MKDIR INSTALL_PROGRAM INSTALL_DATA TOUCH
# plugins ##########################################################
-plugins = $(patsubst $(srcdir)/plugins/%,%,\
+plugins = $(patsubst $(srcdir)/plugins/%,%, \
$(shell find $(srcdir)/plugins/* -maxdepth 0 -type d))
build-plugins = $(addprefix p-,$(plugins))
-install-plugins = $(addprefix install-p-,$(plugins))
+#install-plugins = $(addprefix install-p-,$(plugins))
+uninstall-plugins = $(addprefix uninstall-p-,$(plugins))
clean-plugins = $(addprefix clean-p-,$(plugins))
distclean-plugins = $(addprefix distclean-p-,$(plugins))
-
-#uninstall-plugins = $(addprefix uninstall-p-,$(plugins))
-#dist-plugins = $(addprefix dist-p-,$(plugins))
+dist-plugins = $(addprefix dist-p-,$(plugins))
# phony targets ####################################################
all : $(rvs) $(build-plugins)
-.PHONY : install uninstall clean distclean libexec
+.PHONY : install uninstall clean distclean dist libexec $(build-plugins) $(rvs)\
+$(install-plugins) $(uninstall-plugins) $(clean-plugins) $(distclean-plugins) \
+ install-$(rvs) uninstall-$(rvs) clean-$(rvs) distclean-$(rvs) \
+$(dist-plugins) \
+ dist-$(rvs)
.SUFFIXES :
-# build ############################################################
-b := @
-$(rvs) : $(srcdir)/rvs.sh
- $(SED) \
- -e 's/$bSHELL@/$(subst /,\/,$(SHELL))/g' \
- -e 's/$blibexecdir@/$(subst /,\/,$(libexecdir))/g' \
- -e 's/$bname@/$(subst /,\/,$(name))/g' \
- < $< > $@
-
# install ##########################################################
-install : install-$(name) libexec $(install-plugins)
+install : install-$(rvs) libexec $(install-plugins)
-# core executable
-install-$(name) : $(RVS)
-$(RVS) : $(rvs) $(bindir)
- $(INSTALL_PROGRAM) $< $@
-
# $(libexecdir)/rvs/*
libexec : $(libexecdir)/$(rvs)/plugins
$(libexecdir)/$(rvs)/plugins : $(libexecdir)/$(rvs)
@@ -91,12 +81,10 @@ uninstall :
# clean ############################################################
-clean : $(clean-plugins)
- $(RM) var.sed
+clean : $(clean-plugins) clean-$(rvs)
-distclean : clean $(distclean-plugins)
+distclean : clean $(distclean-plugins) distclean-$(rvs)
$(RM) Makefile
- $(RM) $(rvs)
# dist #############################################################
@@ -110,6 +98,17 @@ $(d) : distclean
$(INSTALL) -m 777 -d $@
$(CP) -r $(srcdir)/* $@
+# wrapper ##########################################################
+
+$(rvs) : wrapper/ wrapper/Makefile; $(MAKE) -C $<
+uninstall-$(rvs) : wrapper/ wrapper/Makefile; $(MAKE) -C $< uninstall
+clean-$(rvs) : wrapper/ wrapper/Makefile; $(MAKE) -C $< clean
+distclean-$(rvs) : wrapper/ wrapper/Makefile; $(MAKE) -C $< distclean
+dist-$(rvs) : wrapper/ wrapper/Makefile; $(MAKE) -C $< dist
+
+install-$(rvs) : wrapper/ wrapper/Makefile $(rvs); $(MAKE) -C $< install
+$(RVS) : install-$(rvs)
+
# plugins ##########################################################
install-p-% : plugins/% plugins/%/Makefile p-% libexec $(RVS)
diff --git a/c/Makefile b/c/Makefile
deleted file mode 100755
index 61a4763..0000000
--- a/c/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/make -f
-CC = gcc
-
-all :
- $(CC) rvs.c -Wall -ansi -g -o rvs
-
-test : test.c rvs.h plugin.c plugin.h plugin-debug.c plugin-depends.c
- $(CC) test.c -Wall -ansi -g -o test
diff --git a/configure b/configure
index 69fcd32..5e19b16 100755
--- a/configure
+++ b/configure
@@ -20,6 +20,7 @@ name='configure' # rvs configureation script
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
_name='rvs'
+ _CC='gcc'
_RVS='$(bindir)/$(rvs)'
_SHELL='/bin/sh'
_prefix='/usr/local'
@@ -29,7 +30,7 @@ _exec_prefix='$(prefix)'
_libexecdir='$(exec_prefix)/libexec'
_srcdir=$(readlink -f `dirname "$0"`)
-vars='name RVS SHELL prefix exec_prefix bindir sbindir libexecdir srcdir'
+vars='name CC RVS SHELL prefix exec_prefix bindir sbindir libexecdir srcdir'
error() {
echo "$name: $1" >> /dev/stderr
diff --git a/plugins/repo/Makefile.in b/plugins/repo/Makefile.in
index 8409705..412fb8e 100644
--- a/plugins/repo/Makefile.in
+++ b/plugins/repo/Makefile.in
@@ -31,6 +31,7 @@ dirs = $(srcdir) $(prefix) $(exec_prefix) $(bindir) $(sbindir) $(libexecdir)/
#export srcdir prefix exec_prefix bindir sbindir libexecdir
# programs #########################################################
+CC ?= @CC@
RVS ?= @RVS@
SHELL ?= @SHELL@
RM ?= rm
diff --git a/plugins/users/Makefile.in b/plugins/users/Makefile.in
index 5de6cb3..4d9df82 100644
--- a/plugins/users/Makefile.in
+++ b/plugins/users/Makefile.in
@@ -31,6 +31,7 @@ dirs = $(srcdir) $(prefix) $(exec_prefix) $(bindir) $(sbindir) $(libexecdir)/
#export srcdir prefix exec_prefix bindir sbindir libexecdir
# programs #########################################################
+CC ?= @CC@
RVS ?= @RVS@
SHELL ?= @SHELL@
RM ?= rm
diff --git a/wrapper/Makefile.in b/wrapper/Makefile.in
new file mode 100755
index 0000000..85f56f7
--- /dev/null
+++ b/wrapper/Makefile.in
@@ -0,0 +1,77 @@
+#!/usr/bin/make -f
+name = @name@
+ver = 0.8c
+# Copyright (C) 2009 Luke Shumaker
+#
+# This file is part of rvs.
+#
+# rvs is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+#
+# rvs 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with rvs; see the file COPYING.
+# If not, write to the Free Software Foundation,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+export rvs ?= @name@
+# directories ######################################################
+srcdir ?= @srcdir@
+prefix ?= @prefix@
+exec_prefix ?= @exec_prefix@
+bindir ?= @bindir@
+sbindir ?= @sbindir@
+libexecdir ?= @libexecdir@
+dirs = $(srcdir) $(prefix) $(exec_prefix) $(bindir) $(sbindir) $(libexecdir)/
+#export srcdir prefix exec_prefix bindir sbindir libexecdir
+
+# programs #########################################################
+RVS ?= @RVS@
+SHELL ?= @SHELL@
+RM ?= rm
+CP ?= cp
+SED ?= sed
+INSTALL ?= install
+MKDIR ?= $(INSTALL) -d #mkdir -p
+INSTALL_PROGRAM ?= $(INSTALL)
+INSTALL_DATA ?= $(INSTALL) -m 644
+TOUCH ?= touch # This file doesn't use touch
+#export RVS SHELL RM CP SED INSTALL MKDIR INSTALL_PROGRAM INSTALL_DATA TOUCH
+
+# phony targets ####################################################
+all : rvs
+.PHONY : install uninstall clean distclean dist
+.SUFFIXES : .c .o
+VPATH = $(srcdir)/wrapper
+
+# most everything ##################################################
+install : $(RVS)
+$(RVS) : rvs $(bindir)
+ $(INSTALL_PROGRAM) $< $@
+
+uninstall :
+ $(RM) $(RVS)
+
+clean :
+
+distclean : clean
+ $(RM) rvs
+ $(RM) Makefile
+
+# dist #############################################################
+
+d = $(name)-$(ver)
+dist : $(d).tar.gz
+
+$(d).tar.gz : $(d)
+ tar -czf $@ $<
+
+$(d) : distclean
+ $(INSTALL) -m 777 -d $@
+ $(CP) -r $(srcdir)/* $@
+
diff --git a/c/plugin-debug.c b/wrapper/plugin-debug.c
index 553237d..a0c8022 100644
--- a/c/plugin-debug.c
+++ b/wrapper/plugin-debug.c
@@ -17,6 +17,8 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifndef FILE_plugin-debug.c_SEEN
+#define FILE_plugin-debug.c_SEEN
size_t xstrlen (const char *s)
{
@@ -85,3 +87,5 @@ void _plugin_print(struct plugin_tree *tree)
_plugin_print_depend(tree->depends,0);
}
+#endif
+
diff --git a/c/plugin-depend.c b/wrapper/plugin-depend.c
index 4101fe1..3dfbf1b 100644
--- a/c/plugin-depend.c
+++ b/wrapper/plugin-depend.c
@@ -17,6 +17,8 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifndef FILE_plugin-depend.c_SEEN
+#define FILE_plugin-depend.c_SEEN
/* translates a string in syntax `plugin/command' into a pointer to the commnad
DON'T plan on using the string again, it will be mutilated!
@@ -100,3 +102,5 @@ _plugin_depend(struct plugin_tree *tree)
_plugin_depend_plugin(tree->plugins,tree);
}
+#endif
+
diff --git a/c/plugin-parse.c b/wrapper/plugin-parse.c
index c333193..3be7543 100644
--- a/c/plugin-parse.c
+++ b/wrapper/plugin-parse.c
@@ -17,7 +17,8 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+#ifndef FILE_plugin-parse.c_SEEN
+#define FILE_plugin-parse.c_SEEN
void _plugin_parse_comment (FILE *file)
{
@@ -133,3 +134,4 @@ struct plugin_command *_plugin_parse (struct plugin *plugin, FILE *file)
return command;
}
+#endif
diff --git a/c/plugin.c b/wrapper/plugin.c
index 7182626..c5d8f38 100644
--- a/c/plugin.c
+++ b/wrapper/plugin.c
@@ -17,6 +17,8 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifndef FILE_plugin.c_SEEN
+#define FILE_plugin.c_SEEN
#include <stdio.h>
#include <stdlib.h> /* EXIT_FAILURE */
@@ -29,7 +31,7 @@
#include <dirent.h>
#include <sys/stat.h>
-#include "rvs.h"
+/*#include "rvs.h"*/
#include "plugin.h"
/* finds a plugin with `name'. Start looking at `plugin' (linked list) */
@@ -122,3 +124,5 @@ load_plugins (char *libexecdir, char *plugin_conf)
return tree;
}
+#endif
+
diff --git a/c/plugin.h b/wrapper/plugin.h
index d5ede8f..5eff78e 100644
--- a/c/plugin.h
+++ b/wrapper/plugin.h
@@ -17,6 +17,8 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifndef FILE_plugin.h_SEEN
+#define FILE_plugin.h_SEEN
struct plugin
{
@@ -47,3 +49,5 @@ struct plugin_tree
struct plugin_command *depends;
};
+#endif
+
diff --git a/c/rvs.c b/wrapper/rvs.c
index 56162ac..56162ac 100644
--- a/c/rvs.c
+++ b/wrapper/rvs.c
diff --git a/c/rvs.h b/wrapper/rvs.h
index 5301b09..adef3b1 100644
--- a/c/rvs.h
+++ b/wrapper/rvs.h
@@ -17,6 +17,8 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifndef FILE_rvs.h_SEEN
+#define FILE_rvs.h_SEEN
#include <stdio.h>
#include <dirent.h>
@@ -89,3 +91,5 @@ void stradds(size_t *size, char **dest, char *str)
}
}
+#endif
+
diff --git a/c/test.c b/wrapper/test.c
index 3a9abc9..3a9abc9 100644
--- a/c/test.c
+++ b/wrapper/test.c