# Makefile.in -- generated automatically from ``SMakefile'' via smake(1)
# by rse (Ralf S. Engelschall) at Wed May  5 15:01:14 1999 DST.
# CAUTION! DO NOT MANUALLY EDIT THIS FILE DIRECTLY!
#
#        27 lines of source from SMakefile
#   -------
#   +   332 lines expanded from 3 include files
#   -     1 lines of 1 removed defines
#   -     3 lines of 1 removed targets
#   -     1 lines of removed .opt directivies
#   -     6 lines of removed .pri directivies
#   -    10 lines of removed blank lines
#   +    16 lines for this comment
#   -------
#   =   354 lines of target code for this file

#
#   SMakefile -- sample SMakefile
#

##
##  smk.stddef -- Standard Defines for GNU autoconf based Makefiles
##  Copyright (c) 1994-1999 Ralf S. Engelschall, All Rights Reserved. 
##

#
#   define some essential Make variables
#
@SET_MAKE@
top_srcdir      = @top_srcdir@
srcdir          = @srcdir@
VPATH           = @srcdir@

#   set $(SHELL) allways to the bourne shell
#   to be independ of the current user environment
SHELL           = /bin/sh

#
#   set the paths and flags for usually used tools
#
CPP             = @CPP@
CC              = @CC@
CFLAGS          = @CFLAGS@
CCINCL          = -I@srcdir@
ACDEFS          = -I@top_srcdir@/config @DEFS@
ANSI_CC         = @ANSI_CC@
AR              = @AR@
LEX             = @LEX@
LEXLIB          = @LEXLIB@
YACC            = @YACC@
INSTALL         = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA    = @INSTALL_DATA@

#
#   set target systems parameters
#
target          = @target@
arch            = @arch@
vendor          = @vendor@
os              = @os@

#
#   set paths to the installation location
#
prefix          = @prefix@
exec_prefix     = @exec_prefix@
bindir          = @bindir@
libdir          = @libdir@
datadir         = @datadir@
statdir         = @statdir@
includedir      = @includedir@
oldincludedir   = @oldincludedir@
mandir          = @mandir@
man1dir         = @man1dir@
man2dir         = @man2dir@
man3dir         = @man3dir@
man4dir         = @man4dir@
man5dir         = @man5dir@
man6dir         = @man6dir@
man7dir         = @man7dir@
man8dir         = @man8dir@
manext          = @manext@
man1ext         = @man1ext@
man2ext         = @man2ext@
man3ext         = @man3ext@
man4ext         = @man4ext@
man5ext         = @man5ext@
man6ext         = @man6ext@
man7ext         = @man7ext@
man8ext         = @man8ext@
pkgdir          = @pkgdir@
infodir         = @infodir@
xaddir          = @xaddir@
tmpdir          = @tmpdir@

#   Correct subdir movement calling facility
#   i.e. it is incorrect to write the following rules:
#   
#       target1: source1a source1b _target1
#               command1
#       target2: target1 source2a source2b _target2
#               command2
#
#   because if you run "make target2" this will step into subdirs for
#   target1 _AND_ later again for target2!
#
#   Correct behavior is: do target1, then do target2 and then move
#   to subdirs for target2, because inside the subdirs, target2
#   allready calls target1 locally!
#
#   To get this behavior and to be able to run into the subdirs at
#   the first OR the last action for a target you can now do:
#
#       target1: source1a source1b
#               command1
#               $(MoveToSubDirs)
#       target2: source2a source2b
#               @PreTargets=target1; $(RunPreTargets)
#               command2
#               $(MoveToSubDirs)
_GotoSubDir = yes
RunPreTargets = \
    if [ "x$$PreTargets" != x ]; then \
        $(MAKE) $(MFLAGS) _steppath="$(_steppath)" _GotoSubDir=no $$PreTargets; \
    fi
MoveToSubDirs = \
    if [ $(_GotoSubDir) = yes ]; then \
        $(MAKE) $(MFLAGS) _steppath="$(_steppath)" _$@; \
    fi

#
#   predefine some of the standard defines
#
SRCS = 
HDRS =
OBJS =
MISC = 

TARGETS = $(OBJS)

subdirs = src doc sample test

DISTFILES = $(SRCS) $(HDRS) $(MISC)

##
##  smk.stdtargets -- Standard Targets for GNU autoconf based Makefiles
##  Copyright (c) 1994-1999 Ralf S. Engelschall, All Rights Reserved. 
##

#   The enhanced .c -> .o extension target
#   It will optionally transform the ANSI sources into K&R style
#   before compilation to be able to compile under pre-ANSI compilers.
EXEC = echo "$$cmd"; eval "$$cmd"
.c.o:
	-@if test X$(ANSI_CC) = Xyes; then \
	    cmd="$(CC) $(CFLAGS) $(ACDEFS) $(INCL) -c -o $@ $<"; \
	    $(EXEC); \
	else \
	    cmd="$(CC) -E $(CFLAGS) $(ACDEFS) $(INCL) $< | $(top_srcdir)/etc/unproto/unproto >U_$<"; \
	    $(EXEC); \
	    cmd="$(CC) -c -o $@ U_$<"; \
	    $(EXEC); \
	    cmd="rm -f U_$<"; \
	    $(EXEC); \
	fi

#   This is the dummy target, i.e. the FIRST REAL target in the
#   makefile which will nothing do than call "all". We use
#   this trick to be able to later overwrite the "all" target
#   but to make sure that the first target is this running the
#   "all" target.
dummy: all

#   fix package after a fresh checkout from the repository 
#   i.e. recreate symbolic links and unpack binary files, etc.
fixdist:
	@$(MoveToSubDirs)

#   configure the fresh package, i.e. run GNU autoconf etc.
config:
	@PreTargets=fixdist; $(RunPreTargets)
	@$(MoveToSubDirs)

#   should run ``makedepend'' on all sources to get
#   dependencies into Makefile 
depend:
	@$(MoveToSubDirs)

#   should run ``cproto'' on all sources to create
#   prototypes for all sources.
proto:
	@$(MoveToSubDirs)

#   should run ``ctags'' on all sources to create
#   tags file for vi  
tags:
	@$(MoveToSubDirs)

#   should run ``etags'' on all sources to create
#   tags file for Emacs  
TAGS:
	@$(MoveToSubDirs)

#   the "all" target which is the default for
#   creation of all programs etc., except dokumentation files
all: $(TARGETS)
	@$(MoveToSubDirs)

#   the "alldocs" target which creates all documentation files
alldocs:
	@$(MoveToSubDirs)

#   check the compiled programs, etc. without prior installation
#   i.e. just a local check!
check:
	@$(MoveToSubDirs)

#   create all installation directories
installdirs:
	@$(MoveToSubDirs)

#   install all programs, except documentation files
install:
	@PreTargets=all; $(RunPreTargets)
	@$(MoveToSubDirs)

#   install all documentation files
installdocs:
	@PreTargets=alldoc; $(RunPreTargets)
	@$(MoveToSubDirs)

#   check the installed programs, etc.
installcheck:
	@$(MoveToSubDirs)

#   uninstall ALL, i.e. all programs, all ducumentation files
#   and all created installation directories
uninstall:
	@$(MoveToSubDirs)

#   clean out mostly files
mostlyclean:
	@$(MoveToSubDirs)

#   clean all things which can be recreated by the "all" target
clean:
	@PreTargets=mostlyclean; $(RunPreTargets)
	@$(MoveToSubDirs)

#   clean out all files which should not distributed
distclean:
	@PreTargets=clean; $(RunPreTargets)
	@$(MoveToSubDirs)
	-rm -f Makefile

#   clean out all files which should not saved to the repository 
commitclean:
	@PreTargets="unfixdist clean"; $(RunPreTargets)
	@$(MoveToSubDirs)
	-rm -f Makefile Makefile.in

#   clean out all which can be recreated
realclean:
	@PreTargets=distclean; $(RunPreTargets)
	@$(MoveToSubDirs)

#   remove all fixed things from the package
unfixdist:
	@$(MoveToSubDirs)

#   prepare local dir for distribution

#   make a log to the ChangeLog file
log:
	cd $(top_srcdir); \
	emacs -f add-change-log-entry ./ChangeLog; \
	rm -f ./ChangeLog~ #ChangeLog#

#   recreate myself, i.e. this Makefile inclusive reconfigure it via autoconf
myself:
	smkmf -I$(top_srcdir)/config/include -q
	-@cwd=`pwd`; cd $(top_srcdir); topdir=`pwd`; cd $$cwd; \
	mysrcdir=`echo $$cwd | sed -e "s|$${topdir}/*||"`; \
	if [ x$$mysrcdir = x ]; then \
	    mysrcfile=Makefile; \
	else \
	    mysrcfile=$$mysrcdir/Makefile; \
	fi; \
	CONFIG_FILES=$$mysrcfile; \
	export CONFIG_FILES; \
	CONFIG_HEADERS=; \
	export CONFIG_HEADERS; \
	echo "CONFIG_FILES=$$mysrcfile; CONFIG_HEADERS=; cd $(top_srcdir); $${CONFIG_SHELL-/bin/sh} ./config.status"; \
	cd $(top_srcdir); $${CONFIG_SHELL-/bin/sh} ./config.status;

dist: $(DISTFILES) _dist
	@_distname="foo-x.y"; \
	rm -rf $(tmpdir)/$$_distname; \
	mkdir $(tmpdir)/$$_distname; \
	cd $(top_srcdir); \
	find . -depth -xdev -print | cpio -o | (cd $(tmpdir)/$$_distname; cpio -idvm); \
	cd $(tmpdir); \
	rm -f $(srcdir)/$${_distname}.tar.gz; \
	tar -chf - $$_distname | gzip >$(srcdir)/$${_distname}.tar.gz; \
	rm -rf $(tmpdir)/$$_distname

##
##  smk.subdir -- Subdir Movement Facility
##  Copyright (c) 1994-1999 Ralf S. Engelschall, All Rights Reserved. 
##

_handlethrough =
_steppath = TOPLEVEL

$(subdirs)::
	@echo "===> $@ (default)"; \
	(cd ./$@; \
	$(MAKE) $(MFLAGS) _steppath="$@" \
	    $(_handlethrough) subdirs=$@ _default); \
	echo "<=== $@"

_fixdist _config _depend _proto _tags _TAGS \
_default _all _alldocs \
_check _installdirs _install _installdocs _installcheck \
_uninstall _mostlyclean _clean _commitclean _distclean _realclean \
_unfixdist _dist \
::
	-@_mktarget=`echo $@ | sed -e 's|^_||g'`; \
	if [ $$_mktarget = default ]; then \
	    _mktarget=; \
	fi; \
	_subdirs="$(subdirs)"; \
	if [ "x$$_subdirs" = xALL ]; then \
	    _subdirs='*'; \
	fi; \
	for _subdir in $$_subdirs; do \
	    if [ -d $$_subdir -a -f $$_subdir/Makefile ]; then \
	        if [ ! -d ./$$_subdir ]; then \
	            mkdir ./$$_subdir; \
	        fi; \
	        if [ x$(_steppath) = xTOPLEVEL ]; then \
        	    _steppath="$$_subdir"; \
        	else \
        	    _steppath="$(_steppath)/$$_subdir"; \
        	fi; \
	        echo "===> $$_steppath ($$_mktarget)"; \
	        (cd ./$$_subdir; \
	            $(MAKE) $(MFLAGS) _steppath="$$_steppath" \
	            $(_handlethrough) $$_mktarget); \
	        echo "<=== $$_steppath"; \
	    fi; \
	done

