v14i011: dmake version 3.5 part 1/21

Dennis Vadura dvadura at watdragon.waterloo.edu
Fri Jul 27 09:41:42 AEST 1990


Posting-number: Volume 14, Issue 11
Submitted-by: dvadura at watdragon.waterloo.edu (Dennis Vadura)
Archive-name: dmake/part01

#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
# This is part 1 of a multipart archive                                    
# do not concatenate these parts, unpack them in order with /bin/sh        
#
#	Run the following text with /bin/sh to create:
#	  vextern.h
#	  version.h
#	  unix
#	  unix/sysvr3
#	  unix/sysvr3/time.h
#	  unix/sysvr3/stdlib.h
#	  unix/sysvr3/stdarg.h
#	  unix/sysvr3/startup.mk
#	  unix/sysvr3/make.sh
#	  unix/sysvr3/config.mk
#	  unix/sysvr3/config.h
#	  unix/sysintf.h
#	  unix/startup.h
#	  unix/runargv.c
#	  unix/ruletab.c
#	  unix/rmprq.c
#	  unix/explode.c
#	  unix/dirbrk.c
#	  unix/config.mk
#	  unix/bsd43
#	  unix/bsd43/uw
#	  unix/bsd43/uw/startup.mk
#	  unix/bsd43/uw/make.sh
#	  unix/bsd43/uw/config.mk
#	  unix/bsd43/utime.c
#	  unix/bsd43/tempnam.c
#	  unix/bsd43/string.h
#	  unix/bsd43/stdlib.h
#	  unix/bsd43/stdarg.h
#	  unix/bsd43/startup.mk
#	  unix/bsd43/setvbuf.c
#	  unix/bsd43/putenv.c
#	  unix/bsd43/make.sh
#	  unix/bsd43/dynix
#	  unix/bsd43/dynix/startup.mk
#	  unix/bsd43/dynix/make.sh
#	  unix/bsd43/dynix/ctype.h
#	  unix/bsd43/dynix/config.mk
#	  unix/bsd43/config.mk
#	  unix/bsd43/config.h
#	  unix/arlib.c
#	  unix/386ix
#	  unix/386ix/time.h
#	  unix/386ix/stdlib.h
#	  unix/386ix/stdarg.h
#	  unix/386ix/startup.mk
#	  unix/386ix/make.sh
#	  unix/386ix/config.mk
#	  unix/386ix/config.h
#	  unix/386ix/ar.h
#	  sysintf.c
#	  struct.h
#	  string.c
#	  stat.c
#	  rulparse.c
#	  quit.c
#	  percent.c
#	  path.c
#	  patchlvl.h
#	  parse.c
#	  msdos
#	  msdos/tccdos
#	  msdos/tccdos/utime.c
#	  msdos/tccdos/tempnam.c
#	  msdos/tccdos/tccobj.rsp
#	  msdos/tccdos/tcclib.rsp
#	  msdos/tccdos/tcc.rsp
#	  msdos/tccdos/startup.mk
#	  msdos/tccdos/make.bat
#	  msdos/tccdos/config.mk
#	  msdos/tccdos/config.h
#	  msdos/sysintf.h
#	  msdos/switchar.c
#	  msdos/stdarg.h
#	  msdos/startup.h
#	  msdos/runargv.c
#	  msdos/ruletab.c
#	  msdos/rmprq.c
#	  msdos/mscdos
#	  msdos/mscdos/tempnam.c
#	  msdos/mscdos/startup.mk
#	  msdos/mscdos/mscobj.rsp
#	  msdos/mscdos/msclib.rsp
#	  msdos/mscdos/make.bat
#	  msdos/mscdos/config.mk
#	  msdos/mscdos/config.h
#	  msdos/dirbrk.c
#	  msdos/config.mk
#	  msdos/arlib.c
#	  msdos/_chdir.c
#	  man
#	  man/dmake.tf
#	  man/dmake.p
#	  man/dmake.nc
#	  makefile
#	  makefile.mk
#	  make.c
#	  make.bat
#	  macparse.c
#	  infer.c
#	  imacs.c
#	  hash.c
#	  getinp.c
#	  extern.h
#	  expand.c
#	  dump.c
#	  dmake.h
#	  dmake.c
#	  dag.c
#	  common
#	  common/print.mk
#	  common/malloc.c
#	  common/macros.h
#	  common/itypes.h
#	  common/dbug.h
#	  common/dbug.c
#	  common/db.h
#	  common/alloc.h
#	  basename.c
#	  _updctl
#	  _todo
#	  _readme
#	  _readme.dos
#	  _install
#	  LICENSE
#
if test -r s2_seq_.tmp
then echo "Must unpack archives in sequence!"
     next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
     exit 1; fi
echo "x - extracting vextern.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > vextern.h &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/vextern.h,v 1.1 90/07/19 13:55:39 dvadura Exp $
X-- SYNOPSIS -- global variable declarations.
X-- 
X-- DESCRIPTION
X-- 	Leave _DEFINE_GLOBALS_ undefined and the following declarations
X--	will be defined as global variables, otherwise you get the
X--	external declarations to the same global variables.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	vextern.h,v $
X * Revision 1.1  90/07/19  13:55:39  dvadura
X * Initial Revision of Version 3.5
X * 
X*/
X#include <stdio.h>
X#include "macros.h"
X#include "struct.h"
X#include "dmake.h"
X
X/* These two are defined in dir/ruletab.c and dir/dirbrk.c, and are always
X * imported as externals by the other code.  Their defining modules do not
X * #include this file. */
Xextern	char*	DirBrkStr;	/* pointer to value of macro DIRBRKSTR    */
Xextern	char**	Rule_tab;	/* Builtin rules */
X
X#ifndef _DEFINE_GLOBALS_
X#define EXTERN	extern
X#else
X#define EXTERN
X#endif
X
XEXTERN	int	Line_number;	/* Current line number in make file parse */
XEXTERN	uint16	Glob_attr;	/* Global attrs to control global ops     */
XEXTERN	char*	Prep;		/* Value of macro PREP			  */
XEXTERN	char*	Makedir;	/* pointer to macro value for MAKEDIR     */
XEXTERN	CELL 	Start_dir;	/* cell for   macro value for .SETDIR	  */
XEXTERN	char*	Shell;		/* pointer to macro value for SHELL       */
XEXTERN	char*	Shell_flags;	/* pointer to macro value for SHELLFLAGS  */
XEXTERN	char*	GShell;		/* pointer to macro value for GROUPSHELL  */
XEXTERN	char*	GShell_flags;	/* pointer to macro value for GROUPFLAGS  */
XEXTERN	char*	Shell_metas;	/* pointer to macro value for SHELLMETAS  */
XEXTERN	char*	Grp_suff;	/* pointer to macro value for GROUPSUFFIX */
XEXTERN  char*   DirSepStr;	/* pointer to macro value for DIRSEPSTR   */
XEXTERN	char*	Pname;		/* dmake process invoke name              */
XEXTERN	char*	Pwd;		/* current working dir, value of PWD	  */
XEXTERN	char*	Augmake;	/* -A */
XEXTERN	int	Target;		/* TRUE if target found in makefile       */
XEXTERN	int	If_expand;	/* TRUE if calling Expand from getinp.c   */
XEXTERN  int	If_multi;	/* M_MULTI for expand of single MULTI macs*/
XEXTERN	int	Readenv;	/* TRUE if defining macro from environment*/
XEXTERN	int	Makemkf;	/* TRUE if making makefile(s)		  */
XEXTERN	int	Nest_level;	/* Nesting level for .IF .ELSE .END ...   */
XEXTERN	int	Def_targets;	/* TRUE if defining targets		  */
X
XEXTERN	LINKPTR Fringe_hd;	/* Pointer to head of the fringe list	  */
XEXTERN	LINKPTR Fringe_tl;	/* Pointer to tail of the fringe list	  */
X
XEXTERN  HOWPTR  Current_target; /* HOW cell of current target being made  */
XEXTERN  int	Wait_for_completion;
XEXTERN  int	Doing_bang;
X
X/* Command line option flags are defined here.  They correspond one-for one
X * with the flags defined in dmake.c */
X 
XEXTERN	int	Continue;	/* -k */
XEXTERN	int	Get_env;	/* -e or -E */
XEXTERN	int	Force;		/* -u */
XEXTERN	int	Listing;	/* -p */
XEXTERN	int	Rules;		/* -r */
XEXTERN	int	Trace;		/* -n */
XEXTERN	int	Touch;		/* -t */
XEXTERN	int	Check;		/* -q */
XEXTERN	int	Verbose;	/* -v */
XEXTERN	int	Microsoft;	/* -M */
XEXTERN	int	Transitive;	/* -T */
X
XEXTERN	HASHPTR	Macs[HASH_TABLE_SIZE];	/* hash table for macro defs    */
XEXTERN	HASHPTR	Defs[HASH_TABLE_SIZE];	/* hash table for other defs    */
X
XEXTERN	char	*Buffer;		/* a general purpose buffer     */
XEXTERN  int	Buffer_size;
XEXTERN  int	Max_proclmt;		/* limit of max # of conc procs */
XEXTERN	int	Max_proc;		/* max # of conc procs		*/
SHAR_EOF
chmod 0440 vextern.h || echo "restore of vextern.h fails"
echo "x - extracting version.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > version.h &&
X/* dmake version number.  */
X
X#define VERSION "3.50"
SHAR_EOF
chmod 0440 version.h || echo "restore of version.h fails"
echo mkdir - unix
mkdir unix
echo mkdir - unix/sysvr3
mkdir unix/sysvr3
echo "x - extracting unix/sysvr3/time.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/time.h &&
X/*
X** Berkeley get this wrong!
X*/
X#ifndef	TIME_h
X#define	TIME_h
X
Xtypedef	long	time_t;	/* this is the thing we use */
X
X#endif	TIME_h
X
SHAR_EOF
chmod 0640 unix/sysvr3/time.h || echo "restore of unix/sysvr3/time.h fails"
echo "x - extracting unix/sysvr3/stdlib.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/stdlib.h &&
X#ifndef _STDLIB_INCLUDED_
X#define _STDLIB_INCLUDED_
X
Xextern /*GOTO*/ _exit();
Xextern /*GOTO*/ exit();
Xextern /*GOTO*/ abort();
Xextern int system();
Xextern char *getenv();
Xextern char *calloc();
Xextern char *malloc();
Xextern char *realloc();
Xextern free();
Xextern int errno;
X
X#ifndef EIO
X#	include <errno.h>
X#endif
X
X#endif /* _STDLIB_INCLUDED_ */
SHAR_EOF
chmod 0640 unix/sysvr3/stdlib.h || echo "restore of unix/sysvr3/stdlib.h fails"
echo "x - extracting unix/sysvr3/stdarg.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/stdarg.h &&
X/*
X * stdarg.h
X *
X * defines ANSI style macros for accessing arguments of a function which takes
X * a variable number of arguments
X *
X */
X
X#if !defined(__STDARG)
X#define __STDARG
X
Xtypedef char *va_list;
X
X#define va_dcl int va_alist
X#define va_start(ap,v)  ap = (va_list)&va_alist
X#define va_arg(ap,t)    ((t*)(ap += sizeof(t)))[-1]
X#define va_end(ap)      ap = NULL
X#endif
SHAR_EOF
chmod 0640 unix/sysvr3/stdarg.h || echo "restore of unix/sysvr3/stdarg.h fails"
echo "x - extracting unix/sysvr3/startup.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/startup.mk &&
X# Generic UNIX DMAKE startup file.  Customize to suit your needs.
X# Should work for both SYSV, and BSD 4.3
X# See the documentation for a description of internally defined macros.
X#
X# Disable warnings for macros redefined here that were given
X# on the command line.
X__.SILENT := $(.SILENT)
X.SILENT   := yes
X
X# Configuration parameters for DMAKE startup.mk file
X# Set these to NON-NULL if you wish to turn the parameter on.
X_HAVE_RCS	:= yes		# yes => RCS  is installed.
X_HAVE_SCCS	:= yes		# yes => SCCS is installed.
X
X# Applicable suffix definitions
XA := .a		# Libraries
XE :=		# Executables
XF := .f		# Fortran
XO := .o		# Objects
XP := .p		# Pascal
XS := .s		# Assembler sources
XV := ,v		# RCS suffix
X
X# Recipe execution configurations
XSHELL		:= /bin/sh
XSHELLFLAGS	:= -ce
XGROUPSHELL	:= $(SHELL)
XGROUPFLAGS	:= 
XSHELLMETAS	:= |();&<>?*][$$:\\#`'"
XGROUPSUFFIX	:=
X
X# Standard C-language command names and flags
X   CPP	   := /lib/cpp		# C-preprocessor
X   CC      := cc		# C-compiler and flags
X   CFLAGS   =
X
X   AS      := as		# Assembler and flags
X   ASFLAGS  = 
X
X   LD       = $(CC)		# Loader and flags
X   LDFLAGS  =
X   LDLIBS   =
X
X# Definition of $(MAKE) macro for recursive makes.
X   MAKE = $(MAKECMD) $(MFLAGS)
X
X# Definition of Print command for this system.
X   PRINT = lpr
X
X# Language and Parser generation Tools and their flags
X   YACC	  := yacc		# standard yacc
X   YFLAGS  =
X   YTAB	  := y.tab		# yacc output files name stem.
X
X   LEX	  := lex		# standard lex
X   LFLAGS  =
X   LEXYY  := lex.yy		# lex output file
X
X# Other Compilers, Tools and their flags
X   PC	:= pc			# pascal compiler
X   RC	:= f77			# ratfor compiler
X   FC	:= f77			# fortran compiler
X
X   CO	   := co		# check out for RCS
X   COFLAGS := -q
X
X   AR     := ar			# archiver
X   ARFLAGS = ruv
X
X   RM	   := /bin/rm		# remove a file command
X   RMFLAGS  =
X
X# Implicit generation rules for making inferences.
X# We don't provide .yr or .ye rules here.  They're obsolete.
X# Rules for making *$O
X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
X   %$O : %$S ; $(AS) $<
X   %$O : %.cl ; class -c $<
X   %$O : %.e %.r %.F %$F
X	$(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
X# Executables
X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
X# lex and yacc rules
X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
X
X# This rule tells how to make *.out from it's immediate list of prerequisites
X# UNIX only.
X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
X# RCS support
X.IF $(_HAVE_RCS)
X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
X.END
X
X# SCCS support
X.IF $(_HAVE_SCCS)
X   % : s.% ; get $@
X   .NOINFER : s.%
X.END
X
X# Recipe to make archive files.
X%$A :
X[
X   $(AR) $(ARFLAGS) $@ $?
X   $(RM) $(RMFLAGS) $?
X   ranlib $@
X]
X
X# DMAKE uses this recipe to remove intermediate targets
X.REMOVE :; $(RM) -f $<
X
X# AUGMAKE extensions for SYSV compatibility
X at B = $(@:b)
X at D = $(@:d)
X at F = $(@:f)
X*B = $(*:b)
X*D = $(*:d)
X*F = $(*:f)
X<B = $(<:b)
X<D = $(<:d)
X<F = $(<:f)
X?B = $(?:b)
X?F = $(?:f)
X?D = $(?:d)
X
X# Turn warnings back to previous setting.
X.SILENT := $(__.SILENT)
X
X# Local startup file if any
X.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 unix/sysvr3/startup.mk || echo "restore of unix/sysvr3/startup.mk fails"
echo "x - extracting unix/sysvr3/make.sh (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/make.sh &&
Xmkdir objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O infer.c
Xmv infer.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O make.c
Xmv make.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O stat.c
Xmv stat.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O expand.c
Xmv expand.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O string.c
Xmv string.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O hash.c
Xmv hash.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O dag.c
Xmv dag.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O dmake.c
Xmv dmake.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O path.c
Xmv path.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O imacs.c
Xmv imacs.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O sysintf.c
Xmv sysintf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O parse.c
Xmv parse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O getinp.c
Xmv getinp.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O quit.c
Xmv quit.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O basename.c
Xmv basename.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O dump.c
Xmv dump.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O macparse.c
Xmv macparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O rulparse.c
Xmv rulparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O percent.c
Xmv percent.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O unix/arlib.c
Xmv arlib.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O unix/dirbrk.c
Xmv dirbrk.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O unix/explode.c
Xmv explode.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O unix/rmprq.c
Xmv rmprq.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O unix/ruletab.c
Xmv ruletab.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr3 -O unix/runargv.c
Xmv runargv.o objects
Xcc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/runargv.o 
SHAR_EOF
chmod 0640 unix/sysvr3/make.sh || echo "restore of unix/sysvr3/make.sh fails"
echo "x - extracting unix/sysvr3/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/config.mk &&
X# This is the SysV R3 UNIX configuration file for DMAKE
X#	It simply modifies the values of SRC, and checks to see if
X#	OSENVIRONMENT is defined.  If so it includes the appropriate
X#	config.mk file.
X#
X# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
X# directory.
X#
Xosrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
X
X# The following sources are required for SysV R3
XSRC +=  #zero for now. we do have some .h's though
X
X#.SOURCE.c : $(osrdir)
X.SOURCE.h : $(osrdir)
X
X# Local configuration modifications for CFLAGS, there's local SysV includes
X# too.
XCFLAGS += -I$(osrdir)
X
X# See if we modify anything in the lower levels.
X.IF $(OSENVIRONMENT) != $(NULL)
X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
X.END
SHAR_EOF
chmod 0640 unix/sysvr3/config.mk || echo "restore of unix/sysvr3/config.mk fails"
echo "x - extracting unix/sysvr3/config.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr3/config.h &&
X/* RCS      -- $Header$
X-- SYNOPSIS -- Configurarion include file.
X-- 
X-- DESCRIPTION
X-- 	There is one of these for each specific machine configuration.
X--	It can be used to further tweek the machine specific sources
X--	so that they compile.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log$
X*/
X
X/* define this for configurations that don't have the coreleft function
X * so that the code compiles.  To my knowledge coreleft exists only on
X * Turbo C, but it is needed here since the function is used in many debug
X * macros. */
X#define coreleft() 0L
X
X/* Define the getcwd function that is used in the code, since BSD does
X * not have getcwd, but call it getwd instead. */
Xextern char *getcwd ANSI((char *, int));
X
X/* Define setvbuf, SysV doesn't have one */
X#define setvbuf(fp, bp, type, len) setbuf( fp, NULL );
X
X/* NCR Tower's don't define size_t */
X#ifdef tower
Xtypedef long size_t;
X#endif
SHAR_EOF
chmod 0640 unix/sysvr3/config.h || echo "restore of unix/sysvr3/config.h fails"
echo "x - extracting unix/sysintf.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysintf.h &&
X/*
X** assorted bits of system interface, for common routines inside dmake.
X** System specific code can be found in the config.h files for each
X** of the system specifications.
X*/
X#include <sys/stat.h>
X#include <signal.h>
X
X#define STAT stat
X#define VOID_LCACHE(l,m) (void) void_lcache(l,m)
X
X/*
X** standard C items
X*/
X#include "macros.h"
X
X/*
X** DOS interface standard items
X*/
X#define	getswitchar()	'-'
X
X/*
X** make parameters
X*/
X#define	MAXARGV	600
X#define	MAX_PATH_LEN	1024
SHAR_EOF
chmod 0440 unix/sysintf.h || echo "restore of unix/sysintf.h fails"
echo "x - extracting unix/startup.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/startup.h &&
X/* This file contains the default value of the MAKESTARTUP variable.
X * You must set the quoted string below to the default path to the startup
X * variable, so that it gets compiled in.  LEAVE ROOTDIR at the front of
X * the path.  This allows the user to customize his environment for dmake
X * by setting up a new ROOTDIR environment variable. */
X
X"MAKESTARTUP := $(ROOTDIR)/usr/software/dmake/data/startup.mk",
SHAR_EOF
chmod 0440 unix/startup.h || echo "restore of unix/startup.h fails"
echo "x - extracting unix/runargv.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/runargv.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/runargv.c,v 1.1 90/07/20 16:54:53 dvadura Exp $
X-- SYNOPSIS -- invoke a sub process.
X-- 
X-- DESCRIPTION
X-- 	Use the standard methods of executing a sub process.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	runargv.c,v $
X * Revision 1.1  90/07/20  16:54:53  dvadura
X * Initial Revision of Version 3.5
X * 
X*/
X
X#include <signal.h>
X#include "extern.h"
X#include "sysintf.h"
X#include "alloc.h"
X
Xtypedef struct prp {
X   char *prp_cmd;
X   int   prp_group;
X   int   prp_ignore;
X   int   prp_last;
X   struct prp *prp_next;
X   char  *prp_dir;
X} RCP, *RCPPTR;
X
Xtypedef struct pr {
X   int		pr_valid;
X   int		pr_pid;
X   CELLPTR	pr_target;
X   HOWPTR	pr_how;
X   int		pr_ignore;
X   int		pr_last;
X   RCPPTR  	pr_recipe;
X   RCPPTR  	pr_recipe_end;
X} PR;
X
Xstatic PR  *_procs    = NIL(PR);
Xstatic int  _proc_cnt = 0;
Xstatic int  _abort_flg= FALSE;
Xstatic int  _use_i    = -1;
Xstatic int  _do_upd   = 0;
X
Xstatic  void	_add_child ANSI((int, CELLPTR, HOWPTR, int, int));
Xstatic  void	_attach_cmd ANSI((char *, int, int, CELLPTR, HOWPTR, int));
Xstatic  void    _finished_child ANSI((int, int));
Xstatic  int     _running ANSI((CELLPTR, HOWPTR));
X
Xint
Xrunargv(target, how, ignore, group, last, cmd)
XCELLPTR target;
XHOWPTR  how;
Xint     ignore;
Xint	group;
Xint	last;
Xchar	*cmd;
X{
X   extern  int  errno;
X   extern  char *sys_errlist[];
X   int          pid;
X   char         *argv[MAXARGV];
X
X   if( _running(target, how) /*&& Max_proc != 1*/ ) {
X      /* The command will be executed when the previous recipe
X       * line completes. */
X      _attach_cmd( cmd, group, ignore, target, how, last );
X      return(1);
X   }
X
X   Pack_argv( argv, MAXARGV, group, cmd );
X
X   while( _proc_cnt == Max_proc )
X      if( Wait_for_child(FALSE, -1) == -1 )  Fatal( "Lost a child" );
X
X   switch( pid=fork() ){
X      int   wid;
X      int   status;
X
X   case -1: /* fork failed */
X      Error("%s: %s", argv[0], sys_errlist[errno]);
X      Handle_result(-1, ignore, _abort_flg, target);
X      return(-1);
X
X   case 0:  /* child */
X      execvp(argv[0], argv);
X      Continue = TRUE;   /* survive error message */
X      Error("%s: %s", argv[0], sys_errlist[errno]);
X      kill(getpid(), SIGTERM);
X      /*NOTREACHED*/
X
X   default: /* parent */
X      _add_child(pid, target, how, ignore, last);
X   }
X
X   return(1);
X}
X
X
Xint
XWait_for_child( abort_flg, pid )
Xint abort_flg;
Xint pid;
X{
X   int wid;
X   int status;
X   int waitchild;
X
X   waitchild = (pid == -1)? FALSE : Wait_for_completion;
X
X   do {
X      if( (wid = wait(&status)) == -1 ) return(-1);
X
X      _abort_flg = abort_flg;
X      _finished_child(wid, status);
X      _abort_flg = FALSE;
X   }
X   while( waitchild && pid != wid );
X
X   return(0);
X}
X
X
Xvoid
XClean_up_processes()
X{
X   register int i;
X
X   if( _procs != NIL(PR) ) {
X      for( i=0; i<Max_proc; i++ )
X	 if( _procs[i].pr_valid )
X	    kill(_procs[i].pr_pid, SIGTERM);
X
X      while( Wait_for_child(TRUE, -1) != -1 );
X   }
X}
X
X
Xstatic void
X_add_child( pid, target, how, ignore, last )
Xint	pid;
XCELLPTR target;
XHOWPTR  how;
Xint	ignore;
Xint     last;
X{
X   register int i;
X   register PR *pp;
X
X   if( _procs == NIL(PR) ) {
X      TALLOC( _procs, Max_proc, PR );
X   }
X
X   if( (i = _use_i) == -1 )
X      for( i=0; i<Max_proc; i++ )
X	 if( !_procs[i].pr_valid )
X	    break;
X
X   pp = _procs+i;
X
X   pp->pr_valid  = 1;
X   pp->pr_pid    = pid;
X   pp->pr_target = target;
X   pp->pr_how    = how;
X   pp->pr_ignore = ignore;
X   pp->pr_last   = last;
X
X   Current_target = NIL(HOW);
X
X   _proc_cnt++;
X
X   if( Wait_for_completion ) Wait_for_child( FALSE, pid );
X}
X
X
Xstatic void
X_finished_child(pid, status)
Xint	pid;
Xint	status;
X{
X   register int i;
X   register PR *pp;
X
X   for( i=0; i<Max_proc; i++ )
X      if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
X	 break;
X
X   _procs[i].pr_valid = 0;
X   _proc_cnt--;
X
X   if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
X      RCPPTR rp = _procs[i].pr_recipe;
X      char   *dir;
X
X      Current_target = _procs[i].pr_how;
X      Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
X      Current_target = NIL(HOW);
X
X      _procs[i].pr_recipe = rp->prp_next;
X
X      _use_i = i;
X      dir = _strdup(Get_current_dir());
X      Set_dir( rp->prp_dir );
X      runargv( _procs[i].pr_target, _procs[i].pr_how, rp->prp_ignore,
X      	       rp->prp_group, rp->prp_last, rp->prp_cmd );
X      Set_dir(dir);
X      FREE(dir);
X      FREE(rp->prp_dir);
X      _use_i = -1;
X
X      FREE( rp->prp_cmd );
X      FREE( rp );
X
X      if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
X   }
X   else {
X      Unlink_temp_files( _procs[i].pr_how );
X      Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
X
X      if( _procs[i].pr_last && !Doing_bang )
X	 Update_time_stamp( _procs[i].pr_target, _procs[i].pr_how );
X   }
X}
X
X
Xstatic int
X_running( cp, how )
XCELLPTR cp;
XHOWPTR  how;
X{
X   register int i;
X
X   if( !_procs ) return(FALSE);
X
X   for( i=0; i<Max_proc; i++ )
X      if( _procs[i].pr_valid &&
X	  _procs[i].pr_how == how &&
X	  _procs[i].pr_target == cp  )
X	 break;
X	 
X   return( i != Max_proc );
X}
X
X
Xstatic void
X_attach_cmd( cmd, group, ignore, cp, how, last )
Xchar    *cmd;
Xint	group;
Xint     ignore;
XCELLPTR cp;
XHOWPTR  how;
Xint     last;
X{
X   register int i;
X   RCPPTR rp;
X
X   for( i=0; i<Max_proc; i++ )
X      if( _procs[i].pr_valid &&
X	  _procs[i].pr_how == how &&
X	  _procs[i].pr_target == cp  )
X	 break;
X
X   TALLOC( rp, 1, RCP );
X   rp->prp_cmd   = _strdup(cmd);
X   rp->prp_group = group;
X   rp->prp_ignore= ignore;
X   rp->prp_last  = last;
X   rp->prp_dir   = _strdup(Get_current_dir());
X
X   if( _procs[i].pr_recipe == NIL(RCP) )
X      _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
X   else {
X      _procs[i].pr_recipe_end->prp_next = rp;
X      _procs[i].pr_recipe_end = rp;
X   }
X}
SHAR_EOF
chmod 0440 unix/runargv.c || echo "restore of unix/runargv.c fails"
echo "x - extracting unix/ruletab.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/ruletab.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/ruletab.c,v 1.1 90/07/19 14:04:42 dvadura Exp $
X-- SYNOPSIS -- Default initial configuration of dmake.
X-- 
X-- DESCRIPTION
X-- 	Define here the initial set of rules that are defined before
X--	dmake performs any processing.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	ruletab.c,v $
X * Revision 1.1  90/07/19  14:04:42  dvadura
X * Initial Revision of Version 3.5
X * 
X*/
X
X/* These are control macros for dmake that MUST be defined at some point
X * if they are NOT dmake will not work!  These are default definitions.  They
X * may be overridden inside the .STARTUP makefile, they are here
X * strictly so that dmake can parse the STARTUP makefile */
X
Xstatic char *_rules[] = {
X	"MAXPROCESSLIMIT := 10",
X	"MAXLINELENGTH := 8190",
X	".IMPORT .IGNORE: ROOTDIR",
X	".MAKEFILES : makefile.mk Makefile makefile",
X	".SOURCE    : .NULL",
X#include "startup.h"
X	0 };
X
Xchar **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
SHAR_EOF
chmod 0440 unix/ruletab.c || echo "restore of unix/ruletab.c fails"
echo "x - extracting unix/rmprq.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/rmprq.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/rmprq.c,v 1.1 90/07/20 16:58:12 dvadura Exp $
X-- SYNOPSIS -- remove prerequisites code.
X-- 
X-- DESCRIPTION
X--	This code is different for DOS and for UNIX and parallel make
X--	architectures since the parallel case requires the rm's to be
X--	run in parallel, whereas DOS guarantees to run them sequentially.
X-- 
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	rmprq.c,v $
X * Revision 1.1  90/07/20  16:58:12  dvadura
X * Initial Revision of Version 3.5
X * 
X*/
X
X#include "extern.h"
X#include "alloc.h"
X
Xvoid
XRemove_prq( tcp )
XCELLPTR tcp;
X{
X   static  LINKPTR rlp = NIL(LINK);
X   static  flag = 0;
X   static  HASHPTR m_at, m_q, m_b, m_g, m_l, m_bb, m_up;
X   char    *m_at_s, *m_g_s, *m_q_s, *m_b_s, *m_l_s, *m_bb_s, *m_up_s;
X   LINKPTR tlp;
X
X   tcp->ce_flag         &= ~(F_MADE|F_VISITED);
X   tcp->CE_HOW->hw_flag &= ~(F_MADE|F_VISITED);
X   tcp->ce_time          = 0L;
X
X   for( tlp=rlp; tlp !=NIL(LINK); tlp=tlp->cl_next )
X      if( (tlp->cl_prq->ce_flag & (F_VISITED|F_MADE)) != F_VISITED )
X	 break;
X
X   if( tlp == NIL(LINK) ) {
X      TALLOC(tlp, 1, LINK);
X      TALLOC(tlp->cl_prq, 1, CELL);
X      tlp->cl_next = rlp;
X      rlp = tlp;
X   }
X
X   *tlp->cl_prq = *tcp;
X
X   /* We save the dynamic macro values here, as it is possible that the
X    * .REMOVE recipe is getting executed for a target while some other target
X    * is in the middle of executing it's list of recipe lines, in this case
X    * the values of $@ etc, must be preserved so that when we return to
X    * complete the other recipe we must make certain that the values of it's
X    * dynamic macros are unmodified. */
X
X   if( !flag ) {
X      /* Do the getting of the macros only once. */
X      flag = 1;
X      m_at = Get_name("@", Macs, TRUE, NIL(CELL));
X      m_g  = Get_name(">", Macs, TRUE, NIL(CELL));
X      m_q  = Get_name("?", Macs, TRUE, NIL(CELL));
X      m_b  = Get_name("<", Macs, TRUE, NIL(CELL));
X      m_l  = Get_name("&", Macs, TRUE, NIL(CELL));
X      m_bb = Get_name("*", Macs, TRUE, NIL(CELL));
X      m_up = Get_name("^", Macs, TRUE, NIL(CELL));
X   }
X
X   m_at_s = m_at->ht_value; m_at->ht_value = NIL(char);
X   m_g_s  = m_g->ht_value;  m_g->ht_value  = NIL(char);
X   m_q_s  = m_q->ht_value;  m_q->ht_value  = NIL(char);
X   m_b_s  = m_b->ht_value;  m_b->ht_value  = NIL(char);
X   m_l_s  = m_l->ht_value;  m_l->ht_value  = NIL(char);
X   m_bb_s = m_bb->ht_value; m_bb->ht_value = NIL(char);
X   m_up_s = m_up->ht_value; m_up->ht_value = NIL(char);
X
X   Make( tlp->cl_prq, tlp->cl_prq->CE_HOW, NIL(CELL) );
X
X   m_at->ht_value = m_at_s;
X   m_g->ht_value  = m_g_s;
X   m_q->ht_value  = m_q_s;
X   m_b->ht_value  = m_b_s;
X   m_l->ht_value  = m_l_s;
X   m_bb->ht_value = m_bb_s;
X   m_up->ht_value = m_up_s;
X}
SHAR_EOF
chmod 0440 unix/rmprq.c || echo "restore of unix/rmprq.c fails"
echo "x - extracting unix/explode.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/explode.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/explode.c,v 1.1 90/07/19 14:04:39 dvadura Exp $
X-- SYNOPSIS -- Routines to explode dag if .SETDIR targets present.
X-- 
X-- DESCRIPTION
X--	These routines are called by parallel dmake implementations to
X--	explode the dmake DAG at .SETDIR targets so that parallel makes
X--	can traverse common portions of the DAG in parallel.
X-- 
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	explode.c,v $
X * Revision 1.1  90/07/19  14:04:39  dvadura
X * Initial Revision of Version 3.5
X * 
X*/
X
X#include "extern.h"
X#include "alloc.h"
X#include "db.h"
X
XCELLPTR
XExplode_cell( cp, dir )
XCELLPTR cp;
XCELLPTR dir;
X{
X   int explode = FALSE;
X   CELLPTR root;
X   CELLPTR tcp;
X   CELLPTR ocp;
X   HOWPTR  fhow = NIL(HOW);
X
X
X   if( cp == NIL(CELL) ) return(cp);
X
X   ocp = cp;
X   if( (root = cp->ce_name->CP_ROOT) != dir ) {
X      if( cp->ce_name->CP_ROOT != NIL(CELL) ) {
X	 HASHPTR name;
X
X	 tcp  = Def_cell(cp->CE_NAME, dir);
X	 name = tcp->ce_name;
X	 *tcp = *cp;
X	 tcp->ce_name = name;
X
X	 cp = tcp;
X	 explode = TRUE;
X      }
X   }
X   else if( root && root == dir )
X      return( cp );
X
X   /* The code here is required, as it takes care of the .UPDATEALL common
X    * targets. */
X   tcp = cp;
X   do {
X      tcp->ce_name->CP_ROOT = dir;
X
X      if( tcp->CE_HOW != fhow ) {
X	 tcp->CE_HOW = Explode_how( tcp->CE_HOW, cp->ce_dir?cp:dir, explode );
X	 if( tcp == cp ) fhow = tcp->CE_HOW;
X      }
X
X      if( explode && tcp->ce_all )
X         if( tcp->ce_all != ocp ) {
X	    CELLPTR ttcp = Def_cell( tcp->ce_all->CE_NAME, dir );
X	    HASHPTR name = ttcp->ce_name;
X
X	    *ttcp = *tcp->ce_all;
X	    ttcp->ce_name = name;
X	    tcp->ce_all   = ttcp;
X	    ttcp->CE_HOW  = fhow;
X	 }
X	 else
X	    tcp->ce_all = cp;
X
X      tcp = tcp->ce_all;
X   }
X   while( tcp != NIL(CELL) && tcp != cp );
X
X   return( cp );
X}
X
X
XHOWPTR
XExplode_how( how, dir, copy )
XHOWPTR  how;
XCELLPTR dir;
Xint     copy;
X{
X   if( how == NIL(HOW) ) return( how );
X
X   if( copy ) {
X      HOWPTR thow;
X
X      TALLOC( thow, 1, HOW );
X      *thow = *how;
X      how = thow;
X   }
X
X   how->hw_next = Explode_how( how->hw_next, dir, copy );
X   how->hw_prq  = Explode_prq( how->hw_prq, dir, copy );
X
X   return( how );
X}
X
X
XLINKPTR
XExplode_prq( prq, dir, copy )
XLINKPTR prq;
XCELLPTR dir;
Xint     copy;
X{
X   if( prq == NIL(LINK) ) return(prq);
X
X   if( copy ) {
X      LINKPTR tprq;
X
X      TALLOC( tprq, 1, LINK );
X      *tprq = *prq;
X      prq = tprq;
X   }
X
X   prq->cl_next = Explode_prq( prq->cl_next, dir, copy );
X   prq->cl_prq  = Explode_cell( prq->cl_prq, dir );
X
X   return( prq );
X}
SHAR_EOF
chmod 0440 unix/explode.c || echo "restore of unix/explode.c fails"
echo "x - extracting unix/dirbrk.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/dirbrk.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/dirbrk.c,v 1.1 90/07/19 14:04:37 dvadura Exp $
X-- SYNOPSIS -- define the directory separator string.
X-- 
X-- DESCRIPTION
X-- 	Define this string for any character that may appear in a path name
X--	and can be used as a directory separator.  Also provide a function
X--	to indicate if a given path begins at the root of the file system.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	dirbrk.c,v $
X * Revision 1.1  90/07/19  14:04:37  dvadura
X * Initial Revision of Version 3.5
X * 
X*/
X
X#include "extern.h"
X
X/* Unix only uses / */
Xchar*	DirBrkStr = "/";
X
X/*
X** Return TRUE if the name is the full specification of a path name to a file
X** starting at the root of the file system, otherwise return FALSE
X*/
Xint
XIf_root_path(name)
Xchar *name;
X{
X   return( strchr(DirBrkStr, *name) != NIL(char) );
X}
SHAR_EOF
chmod 0440 unix/dirbrk.c || echo "restore of unix/dirbrk.c fails"
echo "x - extracting unix/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/config.mk &&
X# This is an OS specific configuration file
X#	It assumes that OBJDIR, TARGET and DEBUG are previously defined.
X#	It defines	CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
X#			PRINTER, PRINTFLAGS
X#	It augments	SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
X#
XPRINTER		= hw
XPRINTFLAGS	= -P$(PRINTER)
XSTARTUPFILE	= $(OS)/startup.mk
XCPPFLAGS 	= $(CFLAGS)
XLDOBJS		= $(CSTARTUP) $(OBJDIR)/{$(<:f)}
XLDARGS		= $(LDFLAGS) -o $@ $(LDOBJS) $(LDLIBS)
X
X# Debug flags
XDB_CFLAGS	= -g -DDBUG
XDB_LDFLAGS	= -g
XDB_LDLIBS	=
X
X# NO Debug flags
XNDB_CFLAGS	= -O
XNDB_LDFLAGS	=
XNDB_LDLIBS	=
X
X# Local configuration modifications for CFLAGS.
XCFLAGS         += -I$(OS)
X
X# Sources that must be defined for each different version
XOSSRC := arlib.c dirbrk.c explode.c rmprq.c ruletab.c runargv.c
XSRC  += $(OSSRC)
X.SETDIR=$(OS) : $(OSSRC)
X
X# Set source dirs so that we can find files named in this
X# config file.
X.SOURCE.h : $(OS)
X
X# See if we modify anything in the lower levels.
X.IF $(OSRELEASE) != $(NULL)
X   .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
SHAR_EOF
echo "End of part 1"
echo "File unix/config.mk is continued in part 2"
echo "2" > s2_seq_.tmp
exit 0



More information about the Comp.sources.misc mailing list