Commits

Anonymous committed e6c0626

The watchproc process was created for OverChat by TowardEx, however, DJB daemontools supervise may be used in future.

  • Participants

Comments (0)

Files changed (4)

+# $Id: Makefile.am,v 0.1 2006/07/19 11:46:12 ddrp Exp $
+#
+# Copyright (C) 2001-2006 Daybo Logic.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+AUTOMAKE_OPTIONS=foreign
+
+CFLAGS= -g -Wall -W -Wcast-qual -Wcast-align -Waggregate-return \
+ -Wpointer-arith -Wshadow -Wmissing-prototypes -Winline \
+ -Wstrict-prototypes -Wredundant-decls -Wwrite-strings -Wformat=2 \
+ -Wformat-security -Wformat-nonliteral -Wundef -Wredundant-decls \
+ -Wbad-function-cast -Wnested-externs -Wmissing-declarations \
+ -Wunknown-pragmas
+ 
+noinst_PROGRAMS = watchproc
+
+watchproc_SOURCES = watchproc.c
+
+EXTRA_DIST = GNUmakefile \
+  Makefile.bor

File Makefile.bor

+#
+# Make for TowardEX WatchProc (under OverChat tree).
+# We need this built sometime before running the server(s)
+# in order to watch fro crashes.
+#
+# License for use of program is in watchproc.c
+#
+
+!include ../MasterMake.bor
+
+
+all : watchproc$(EXE)
+
+watchproc$(EXE) : watchproc$(O)
+	@echo Skipping watchproc build
+
+watchproc$(O) : watchproc$(C)
+	@echo Sorry, watchproc is not supported under this platform
+
+clean:
+	@echo Skipping clean on watchproc
+
+depend:
+	@echo Unsupported
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id: Makefile.am,v 0.1 2006/07/19 11:46:12 ddrp Exp $
+#
+# Copyright (C) 2001-2006 Daybo Logic.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+noinst_PROGRAMS = watchproc$(EXEEXT)
+subdir = watchproc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_watchproc_OBJECTS = watchproc.$(OBJEXT)
+watchproc_OBJECTS = $(am_watchproc_OBJECTS)
+watchproc_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(watchproc_SOURCES)
+DIST_SOURCES = $(watchproc_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLAKELIB = @BLAKELIB@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = -g -Wall -W -Wcast-qual -Wcast-align -Waggregate-return \
+ -Wpointer-arith -Wshadow -Wmissing-prototypes -Winline \
+ -Wstrict-prototypes -Wredundant-decls -Wwrite-strings -Wformat=2 \
+ -Wformat-security -Wformat-nonliteral -Wundef -Wredundant-decls \
+ -Wbad-function-cast -Wnested-externs -Wmissing-declarations \
+ -Wunknown-pragmas
+
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DAYBOCRYPTLIB = @DAYBOCRYPTLIB@
+DAYBOTHREADSLIB = @DAYBOTHREADSLIB@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLINILIB = @DLINILIB@
+DLSTDS_HEADERS = @DLSTDS_HEADERS@
+DPCRTLMMLIB = @DPCRTLMMLIB@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MYSQLLIB = @MYSQLLIB@
+MYSQL_HEADERS = @MYSQL_HEADERS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RTTBLIB = @RTTBLIB@
+SERVER_THREADS_PTH_FALSE = @SERVER_THREADS_PTH_FALSE@
+SERVER_THREADS_PTH_TRUE = @SERVER_THREADS_PTH_TRUE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+THREADLIB = @THREADLIB@
+VERSION = @VERSION@
+ZLIB = @ZLIB@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = foreign
+watchproc_SOURCES = watchproc.c
+EXTRA_DIST = GNUmakefile \
+  Makefile.bor
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  watchproc/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  watchproc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+watchproc$(EXEEXT): $(watchproc_OBJECTS) $(watchproc_DEPENDENCIES) 
+	@rm -f watchproc$(EXEEXT)
+	$(LINK) $(watchproc_LDFLAGS) $(watchproc_OBJECTS) $(watchproc_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watchproc.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-noinstPROGRAMS ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+/*
+ * Copyright 1997-2002 Haesu C. All rights reserved.
+ * Watchproc: A process monitor for Linux systems.
+ *
+ * Written by Haesu <haesu@towardex.com>. Special thanks to DDRP <ddrp@daybologic.com>
+ * for his assistance in debugging is_process_dead(); :-)
+ *
+ * Changes on Watchproc ver. 1.0.1:
+ *	HDC: Get rid of extern enum and use normal enum.. extern is for variables, not
+ *	     for definitions.
+ *	HDC: Deprecate ifdef_disable_logging.
+ *	HDC: Daemonize after argument checking is done.
+ *	HDC: Make -v for version work.
+ *
+ * To compile: gcc -o watchproc watchproc.c
+ * To compile with debug on: gcc -g -DDEBUG -o watchproc watchproc.c
+ * If you have humour: gcc -D_HAVE_HUMOR -o watchproc watchproc.c
+ *
+ * TowardEX Linux 1.0 (Build 1.0 Stable 8 DAKN)
+ * Copyright (c) 2001-2002 TowardEX Technologies
+ * All rights reserved.
+ *
+ *                            TowardEX Public License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is furnished
+ * to do so, subject to the following conditions:
+ *
+ *      a) Redistributions of the Software whether in binary form, or source
+ *         code, must retain the above copyright notice, this list of
+ *         conditions and the following disclaimer in the documentation and/or
+ *         other materials provided with the distribution..
+ *      b) The Software is not modified, copied, distributed, merged, or
+ *         published with intention of destroying another party's property, or
+ *         being used to violate any applicable law, regulation, treaty or
+ *         tariff.
+ *      c) Neither the name of the TowardEX Technologies nor the names of its
+ *         contributors may be used to endorse or promote products derived from
+ *         this Software without specific prior written permission.
+ *      d) The Software is not modified, copied, distributed, merged, published,
+ *         or utilized in any way to infringe any intellectual property rights
+ *         of others. This license (the "License") hereby warrants that any
+ *         use of the Software including but not limited to, modification, copy,
+ *         distribution, merge, publish, and derivation shall not violate any
+ *         proprietary right or the Digital Millenium Copyright Act of 1998 (the
+ *         "DMCA"). Furthermore, the License warrants that any use of the Software
+ *         shall not violate other applicable copyright regulations.
+ *      e) In addition to the above clause, the License is hereby terminated upon
+ *         all commercial organizations and institutions whom are in faith of
+ *         using any clause from the DMCA against the public, or in faith of using
+ *         any other regulations in effort to restrict the public freedom of speech
+ *         rights mandated by the First Amendment of the United States Constitution.
+ *         The License does not enforce, nor endorse any parties to violate the DMCA,
+ *         or proprietary rights of the others. As stated in the Clause D of the
+ *         License, any parties that violate the DMCA or other proprietary rights
+ *         shall not possess any right to use the Software.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <stdbool.h>
+
+static const char rcsid[] =
+  "$ld: /usr/src/watchproc.c,v 1.0.1.00 2002/10/02 19:59:45 hdc Exp $";
+/*  "$ld: /devel/process-monitor/main.c,v 1.00.0.3 2002/04/13 02:22:54 haesu Exp $"; */
+
+enum rturn_type {
+	RTURN_NULL=-1,
+	RTURN_OK=0,
+	RTURN_NOTFOUND=100,
+	RTURN_UNKNOWN_CAUSE=101
+};
+
+typedef struct return_data_struct {
+	int	err_code;
+} ret_data;
+
+static char	Options[] = "n:p:v";
+
+static char*	pidfile;
+static char*	execpath;
+static int	panic_cnt = 0;
+unsigned int	stfu = 30;  /* number of seconds to put watchproc to silence
+			     * between is_process_dead() checks
+			     */
+static const int i = 0;
+
+/* Function proto */
+int		log_facility (const char* ProcName, const char* PidFile, int Condition);
+int		is_process_dead(void);
+void		panic(void);
+char		finder(FILE* _fileptr, char* filepath);
+static bool	Daemonize(void);
+
+int
+main(int argc, char **argv){
+	int	ch;
+	int	ifdef_pidfile;
+	int	ifdef_execpath;
+	int	ret = EXIT_SUCCESS;
+	int	set_show_version;
+	int	broken;
+
+	broken = 0;
+	set_show_version = 0;
+	ifdef_pidfile = 0;
+	ifdef_execpath = 0;
+
+	if ( argc > 1 ){
+	  while ( (ch = getopt(argc,argv,Options)) != -1){
+		switch (ch) {
+		case 'p':
+			ifdef_pidfile = 1;
+			pidfile=malloc( strlen(optarg) + 1);
+			strcpy(pidfile, optarg);
+			break;
+		case 'n':
+			ifdef_execpath = 1;
+			execpath=malloc( strlen(optarg) + 1);
+			strcpy(execpath, optarg);
+			break;
+		case 'v':
+			set_show_version = 1;
+			break;
+		default:
+			broken = 1;
+			break;
+		}
+	  }
+	}
+
+	if ( set_show_version == 1) {
+		puts ("Watchproc 1.0.1");
+		exit(0);
+	}
+	if ( ifdef_pidfile == 0 ){
+		puts("===>  Bad argument: -p [path-to-pidfile] not defined.");
+		broken = 1;
+	}
+	if ( ifdef_execpath == 0 ){
+		puts("===>  Bad argument: -n [path-to-process-executable] not defined.");
+		broken = 1;
+	}
+
+	if ( broken == 1 ) panic();
+
+	/* Drop into daemon now. */
+	if ( !Daemonize() ) return ret;
+	/* start the logs */
+	log_facility(execpath,pidfile,0);
+
+	do {
+		if(is_process_dead() == 1){
+			#ifdef DEBUG
+			printf("Warning: is_process_dead() returned int 1. Calling system for execpath.\n");
+			#endif
+			system(execpath);
+			#ifdef DEBUG
+			printf("Warning: Condition 2 - Calling log_facility(execpath,pidfile,2);\n");
+			#endif
+			log_facility(execpath,pidfile,2);
+		}
+		sleep(stfu);
+	} while ( i == 0 );
+
+	return 0;
+}
+
+int
+log_facility(const char* ProcName, const char* PidFile, int Condition){
+	int	returncode;
+	returncode = 0;
+
+	setlogmask (LOG_UPTO (LOG_NOTICE));
+	openlog ("watchproc", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
+
+	switch (Condition) {
+	case 0:
+		/* 0: Started monitoring process. */
+		syslog (LOG_NOTICE, "Monitoring process %s, pidfile %s.", ProcName, PidFile);
+		break;
+	case 1:
+		/* 1: NOTICE: Monitored process died mysteriously!! */
+		syslog (LOG_NOTICE, "%s died, attempting restart..", ProcName);
+		break;
+	case 2:
+		/* 2: Notice: Restarted process */
+		syslog (LOG_NOTICE, "Restarted process %s.",ProcName);
+		break;
+	case 3:
+		/* 3: Warning: Someone intentionally killed the process. */
+		syslog (LOG_NOTICE, "%s got intentionally killed. pid file can't be found..",ProcName);
+		break;
+	case 4:
+		/* 4: Alert: Monitoring failed! io error */
+		syslog (LOG_NOTICE, "Monitoring failure - io error! Monitoring HALTED.");
+		break;
+	default:
+		syslog (LOG_NOTICE, "log_facility: Unknown condition.");
+		puts("log_facility: Unknown condition.");
+		returncode=-1;
+		break;
+	}
+
+	closelog();
+	return returncode;
+}
+
+int
+is_process_dead(){
+	char  pid[6];
+	const char* proc_path = "/proc/";
+	char* proc_pid = malloc(strlen(proc_path)+strlen(pid)+1); 
+	const char* proc_cmdline ="/cmdline";
+	char* full_path = malloc(strlen(proc_path)+strlen(pid)+strlen(proc_cmdline)+1);
+	char* newline;
+	FILE	*leadptr;
+	FILE	*pidfile_ptr;
+
+	if(finder(leadptr,pidfile) == 100){
+		log_facility(execpath,pidfile,3);
+		return 1;
+	} else {
+		/* open up pidfile and set pid */
+		if ((pidfile_ptr = fopen( pidfile,"rt")) == NULL){
+			/* uhh... Houston.. We have a problem. */
+			log_facility(execpath,pidfile,4);
+			perror("!! UNKNOWN I/O ERROR. I CRASHED ROCK HARD. !!");
+			fclose(pidfile_ptr);
+
+			exit(1);
+                } else { /* phew, OKay we are good to go! */
+			fgets(pid, 6, pidfile_ptr);
+			newline = strchr(pid, '\n');
+			if ( newline ) *newline = '\0';
+			fclose(pidfile_ptr);
+		}
+		#ifdef DEBUG
+		printf("\npid: %s\n", pid);
+		#endif
+
+		strcpy(proc_pid, proc_path);
+		strcat(proc_pid, pid); /* combine /proc and pid */
+		#ifdef DEBUG
+		printf("\nproc_pid: %s\n", proc_pid);
+		#endif
+
+
+		strcpy(full_path, proc_pid);
+		strcat(full_path, proc_cmdline); /* combine /proc/pid and cmdline */
+		#ifdef DEBUG
+		printf("\nfull_path: %s\n", full_path);
+		#endif
+
+		if(finder(leadptr,full_path) == 100){
+			#ifdef DEBUG
+			printf("finder returned 100 with input leadptr,full_path. calling logfacility.\n");
+			#endif
+			log_facility(execpath,pidfile,1);
+			return 1;
+		}
+		#ifdef DEBUG
+		printf("is_process_dead(): if(finder(leadptr,full_path) == 100) marks false, returning 0.\n");
+		#endif
+	}
+	return 0;
+}
+
+
+
+void
+panic(void){
+	/* panic only once. no need to repeat what was said to the user. */
+	if ( panic_cnt > 0 ) return;
+
+	/* user does not know the syntax. tell him...*/
+	#ifdef _HAVE_HUMOR
+	puts("You are a dumb ass.");
+	#endif
+	fputs("Usage: -v -n [path to the daemon to watch] -p [path to daemon pidfile]\n", stderr);
+	fputs("\nMake sure your paths to daemon and pidfile are correct. If not watchproc", stderr);
+	fputs("\nwon't do much..\n", stderr);
+	panic_cnt++;
+	exit(1);
+	return; 
+}
+
+
+char
+finder(FILE *fileptr, char * filepath){
+	enum rturn_type returncode=RTURN_NULL;
+	ret_data	*return_info;
+
+	return_info = (ret_data * ) malloc ( sizeof(ret_data));
+
+	if ((fileptr = fopen( filepath, "rt")) == NULL) /* File does not exist. */
+	{
+		returncode=RTURN_NOTFOUND;
+	} else {
+		fclose(fileptr);
+		returncode=RTURN_OK;
+	}
+
+	return (char)returncode;
+}
+
+static bool
+Daemonize(){
+	bool	ret;
+
+	putc('\n', stdout);
+	switch ( fork() ) {
+	case -1 : {
+		fputs("watchproc: unable to create a daemon. Abort", stderr);
+		ret = false;
+		break;
+		}
+	case 0 : { /* We are the daemon child (the living being!) */
+		ret = true; /* Carry on running */
+		break;
+		}
+	default : {
+		/* Child has been created.  Program should exit now */
+		ret = false;
+		}
+  	}
+
+	return ret;
+}