v19i055: dmake - dmake version 3.7, Part34/37

Dennis Vadura dvadura at watdragon.waterloo.edu
Tue May 14 00:54:13 AEST 1991


Submitted-by: Dennis Vadura <dvadura at watdragon.waterloo.edu>
Posting-number: Volume 19, Issue 55
Archive-name: dmake/part34
Supersedes: dmake-3.6: Volume 15, Issue 52-77

---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is dmake.shar.34 (part 34 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file dmake/unix/bsd43/uw/public.h continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 34; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test -f _shar_wnt_.tmp; then
sed 's/^X//' << 'SHAR_EOF' >> 'dmake/unix/bsd43/uw/public.h' &&
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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 this program;  if not, write to the Free Software
--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--
-- LOG
--     $Log:	public.h,v $
X * Revision 1.1  91/05/06  15:29:14  dvadura
X * dmake Release Version 3.7
X * 
*/
X
#ifndef _DMAKE_PUBLIC_h
#define _DMAKE_PUBLIC_h
X
void Infer_recipe ANSI((CELLPTR, CELLPTR));
int Make_targets ANSI(());
int Exec_commands ANSI((CELLPTR));
void Pop_dir ANSI((int));
void Append_line ANSI((char *, int, FILE *, char *, int, int));
void Stat_target ANSI((CELLPTR, int));
char * Expand ANSI((char *));
char * Apply_edit ANSI((char *, char *, char *, int, int));
void Map_esc ANSI((char *));
char* Apply_modifiers ANSI((int, char *));
char* Tokenize ANSI((char *, char *));
char * _strjoin ANSI((char *, char *, int, int));
char * _stradd ANSI((char *, char *, int));
char * _strapp ANSI((char *, char *));
char * _strdup ANSI((char *));
char * _strpbrk ANSI((char *, char *));
char * _strspn ANSI((char *, char *));
char * _strstr ANSI((char *, char *));
char * _substr ANSI((char *, char *));
uint16 Hash ANSI((char *, uint32 *));
HASHPTR Get_name ANSI((char *, HASHPTR *, int));
HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
HASHPTR Def_macro ANSI((char *, char *, int));
CELLPTR Def_cell ANSI((char *));
LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
void Clear_prerequisites ANSI((CELLPTR));
int Test_circle ANSI((CELLPTR, int));
STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
t_attr Rcp_attribute ANSI((char *));
int main ANSI((int, char **));
FILE * Openfile ANSI((char *, int, int));
FILE * Closefile ANSI(());
FILE * Search_file ANSI((char *, char **));
char * Filename ANSI(());
void No_ram ANSI(());
int Usage ANSI((int));
int Version ANSI(());
char * Get_suffix ANSI((char *));
char * Build_path ANSI((char *, char *));
void Make_rules ANSI(());
void Create_macro_vars ANSI(());
time_t Do_stat ANSI((char *, char *, char **));
int Do_touch ANSI((char *, char *, char **));
void Void_lib_cache ANSI((char *, char *));
time_t Do_time ANSI(());
int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
char ** Pack_argv ANSI((int, int, char *));
char * Read_env_string ANSI((char *));
int Write_env_string ANSI((char *, char *));
void ReadEnvironment ANSI(());
void Catch_signals ANSI((void (*)()));
void Clear_signals ANSI(());
void Prolog ANSI((int, char* []));
void Epilog ANSI((int));
char * Get_current_dir ANSI(());
int Set_dir ANSI((char*));
char Get_switch_char ANSI(());
FILE* Get_temp ANSI((char **, char *, int));
FILE * Start_temp ANSI((char *, CELLPTR, char **));
void Open_temp_error ANSI((char *, char *));
void Link_temp ANSI((CELLPTR, FILE *, char *));
void Close_temp ANSI((CELLPTR, FILE *));
void Unlink_temp_files ANSI((CELLPTR));
void Handle_result ANSI((int, int, int, CELLPTR));
void Update_time_stamp ANSI((CELLPTR));
void Parse ANSI((FILE *));
int Get_line ANSI((char *, FILE *));
char * Do_comment ANSI((char *, char **, int));
char * Get_token ANSI((TKSTRPTR, char *, int));
void Quit ANSI(());
void Read_state ANSI(());
void Write_state ANSI(());
int Check_state ANSI((CELLPTR, STRINGPTR *, int));
char* basename ANSI((char *));
void Dump ANSI(());
void Dump_recipe ANSI((STRINGPTR));
int Parse_macro ANSI((char *, int));
int Macro_op ANSI((char *));
int Parse_rule_def ANSI((int *));
int Rule_op ANSI((char *));
void Add_recipe_to_list ANSI((char *, int, int));
void Bind_rules_to_targets ANSI((int));
int Set_group_attributes ANSI((char *));
DFALINKPTR Match_dfa ANSI((char *));
void Check_circle_dfa ANSI(());
void Add_nfa ANSI((char *));
char * Exec_function ANSI((char *));
time_t seek_arch ANSI((char *, char *));
int If_root_path ANSI((char *));
void Remove_prq ANSI((CELLPTR));
int runargv ANSI((CELLPTR, int, int, int, int, char *));
int Wait_for_child ANSI((int, int));
void Clean_up_processes ANSI(());
X
#endif
SHAR_EOF
chmod 0640 dmake/unix/bsd43/uw/public.h ||
echo 'restore of dmake/unix/bsd43/uw/public.h failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/uw/public.h'`"
test 5524 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/uw/public.h: original size 5524, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/uw/startup.mk ==============
if test -f 'dmake/unix/bsd43/uw/startup.mk' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/uw/startup.mk (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/uw/startup.mk' &&
# Generic UNIX DMAKE startup file.  Customize to suit your needs.
# Should work for both SYSV, and BSD 4.3
# See the documentation for a description of internally defined macros.
#
# Disable warnings for macros redefined here that were given
# on the command line.
__.SILENT := $(.SILENT)
.SILENT   := yes
X
# Configuration parameters for DMAKE startup.mk file
# Set these to NON-NULL if you wish to turn the parameter on.
_HAVE_RCS	:= yes		# yes => RCS  is installed.
_HAVE_SCCS	:= yes		# yes => SCCS is installed.
X
# Applicable suffix definitions
A := .a		# Libraries
E :=		# Executables
F := .f		# Fortran
O := .o		# Objects
P := .p		# Pascal
S := .s		# Assembler sources
V := ,v		# RCS suffix
X
# Recipe execution configurations
SHELL		:= /bin/sh
SHELLFLAGS	:= -ce
GROUPSHELL	:= $(SHELL)
GROUPFLAGS	:= 
SHELLMETAS	:= |();&<>?*][$$:\\#`'"
GROUPSUFFIX	:=
DIVFILE		 = $(TMPFILE)
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
# Definition of $(MAKE) macro for recursive makes.
X   MAKE = $(MAKECMD) $(MFLAGS)
X
# Definition of Print command for this system.
X   PRINT = lpr
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
# 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
# Implicit generation rules for making inferences.
# We don't provide .yr or .ye rules here.  They're obsolete.
# Rules for making *$O
X   %$O : %.c ; $(CC) -o $@ $(CFLAGS) -c $<
X   %$O : %$P ; $(PC) -o $@ $(PFLAGS) -c $<
X   %$O : %$S ; $(AS) -o $@ $(ASFLAGS) $<
X   %$O : %.cl ; class -c $<
X   %$O : %.e %.r %.F %$F
X	$(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
# Executables
X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
# lex and yacc rules
X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
X
# This rule tells how to make *.out from it's immediate list of prerequisites
# UNIX only.
X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
# RCS support
.IF $(_HAVE_RCS)
X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
.END
X
# SCCS support
.IF $(_HAVE_SCCS)
X   % : s.% ; get $@
X   .NOINFER : s.%
.END
X
# Recipe to make archive files.
%$A :
[
X   $(AR) $(ARFLAGS) $@ $?
X   $(RM) $(RMFLAGS) $?
X   ranlib $@
]
X
# DMAKE uses this recipe to remove intermediate targets
.REMOVE :; $(RM) -f $<
X
# AUGMAKE extensions for SYSV compatibility
@B = $(@:b)
@D = $(@:d)
@F = $(@:f)
*B = $(*:b)
*D = $(*:d)
*F = $(*:f)
<B = $(<:b)
<D = $(<:d)
<F = $(<:f)
?B = $(?:b)
?F = $(?:f)
?D = $(?:d)
X
# Turn warnings back to previous setting.
.SILENT := $(__.SILENT)
X
# Local startup file if any
.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 dmake/unix/bsd43/uw/startup.mk ||
echo 'restore of dmake/unix/bsd43/uw/startup.mk failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/uw/startup.mk'`"
test 3239 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/uw/startup.mk: original size 3239, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/config.mk ==============
if test ! -d 'dmake/unix/bsd43/vf'; then
    mkdir 'dmake/unix/bsd43/vf'
fi
if test -f 'dmake/unix/bsd43/vf/config.mk' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/config.mk (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/config.mk' &&
# This config file adds vfprintf.c and memcpy.c for those systems that
# do not have it.
#
X
osredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
CFLAGS += -I$(osredir)
X
# The following sources are required for BSD4.3
OSDESRC := memcpy.c vfprintf.c
SRC    += $(OSDESRC)
.SETDIR=$(osredir) : $(OSDESRC)
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/config.mk ||
echo 'restore of dmake/unix/bsd43/vf/config.mk failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/config.mk'`"
test 317 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/config.mk: original size 317, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/ctype.h ==============
if test -f 'dmake/unix/bsd43/vf/ctype.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/ctype.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/ctype.h' &&
/*	ctype.h	4.2	85/09/04	*/
X
#define	_U	01
#define	_L	02
#define	_N	04
#define	_S	010
#define _P	020
#define _C	040
#define _X	0100
#define	_B	0200
X
extern	char	_ctype_[];
X
#define	isalpha(c)	((_ctype_+1)[c]&(_U|_L))
#define	isupper(c)	((_ctype_+1)[c]&_U)
#define	islower(c)	((_ctype_+1)[c]&_L)
#define	isdigit(c)	((_ctype_+1)[c]&_N)
#define	isxdigit(c)	((_ctype_+1)[c]&(_N|_X))
#define	isspace(c)	((_ctype_+1)[c]&_S)
#define ispunct(c)	((_ctype_+1)[c]&_P)
#define isalnum(c)	((_ctype_+1)[c]&(_U|_L|_N))
#define isprint(c)	((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
#define isgraph(c)	((_ctype_+1)[c]&(_P|_U|_L|_N))
#define iscntrl(c)	((_ctype_+1)[c]&_C)
#define isascii(c)	((unsigned)(c)<=0177)
#define toupper(c)	((c)-'a'+'A')
#define tolower(c)	((c)-'A'+'a')
#define toascii(c)	((c)&0177)
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/ctype.h ||
echo 'restore of dmake/unix/bsd43/vf/ctype.h failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/ctype.h'`"
test 782 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/ctype.h: original size 782, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/make.sh ==============
if test -f 'dmake/unix/bsd43/vf/make.sh' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/make.sh (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/make.sh' &&
mkdir objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O infer.c
mv infer.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O make.c
mv make.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O stat.c
mv stat.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O expand.c
mv expand.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmstring.c
mv dmstring.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O hash.c
mv hash.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dag.c
mv dag.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmake.c
mv dmake.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O path.c
mv path.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O imacs.c
mv imacs.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O sysintf.c
mv sysintf.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O parse.c
mv parse.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O getinp.c
mv getinp.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O quit.c
mv quit.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O state.c
mv state.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O basename.c
mv basename.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmdump.c
mv dmdump.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O macparse.c
mv macparse.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O rulparse.c
mv rulparse.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O percent.c
mv percent.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O function.c
mv function.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/arlib.c
mv arlib.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dirbrk.c
mv dirbrk.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/rmprq.c
mv rmprq.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/ruletab.c
mv ruletab.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/runargv.c
mv runargv.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/putenv.c
mv putenv.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/tempnam.c
mv tempnam.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/utime.c
mv utime.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/setvbuf.c
mv setvbuf.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/memcpy.c
mv memcpy.o objects
cc -c -I. -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/vfprintf.c
mv vfprintf.o objects
cc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/dmstring.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/state.o objects/basename.o objects/dmdump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o objects/dirbrk.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/se





tvbuf.o objects/memcpy.o objects/vfprintf.o 
cp unix/bsd43/vf/startup.mk startup.mk
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/make.sh ||
echo 'restore of dmake/unix/bsd43/vf/make.sh failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/make.sh'`"
test 3196 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/make.sh: original size 3196, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/memcpy.c ==============
if test -f 'dmake/unix/bsd43/vf/memcpy.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/memcpy.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/memcpy.c' &&
char *
memcpy(t, f, n)
register char *t, *f;
register n;
{
X   register char *p = t;
X
X   while( --n >= 0 ) *t++ = *f++;
X
X   return (p);
}
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/memcpy.c ||
echo 'restore of dmake/unix/bsd43/vf/memcpy.c failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/memcpy.c'`"
test 137 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/memcpy.c: original size 137, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/public.h ==============
if test -f 'dmake/unix/bsd43/vf/public.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/public.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/public.h' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/bsd43/vf/RCS/public.h,v 1.1 91/05/06 15:29:31 dvadura Exp Locker: dvadura $
-- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
--
-- SYNOPSIS -- Local functions exported to be visible by others.
--
-- DESCRIPTION
--      This file is generated by 'genpub'.  Function declarations
--      that appear in this file are extracted by 'genpub' from
--      source files.  Any function in the source file whose definition
--      appears like:
--
--          PUBLIC return_type
--          function( arg_list );
--          type_expr1 arg1;
--          ...
--
--      has its definition extracted and a line of the form:
--
--          return_type function ANSI((type_expr1,type_expr2,...));
--
--      entered into the output file.
--
-- AUTHOR
--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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 this program;  if not, write to the Free Software
--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--
-- LOG
--     $Log:	public.h,v $
X * Revision 1.1  91/05/06  15:29:31  dvadura
X * dmake Release Version 3.7
X * 
*/
X
#ifndef _DMAKE_PUBLIC_h
#define _DMAKE_PUBLIC_h
X
void Infer_recipe ANSI((CELLPTR, CELLPTR));
int Make_targets ANSI(());
int Exec_commands ANSI((CELLPTR));
void Pop_dir ANSI((int));
void Append_line ANSI((char *, int, FILE *, char *, int, int));
void Stat_target ANSI((CELLPTR, int));
char * Expand ANSI((char *));
char * Apply_edit ANSI((char *, char *, char *, int, int));
void Map_esc ANSI((char *));
char* Apply_modifiers ANSI((int, char *));
char* Tokenize ANSI((char *, char *));
char * _strjoin ANSI((char *, char *, int, int));
char * _stradd ANSI((char *, char *, int));
char * _strapp ANSI((char *, char *));
char * _strdup ANSI((char *));
char * _strpbrk ANSI((char *, char *));
char * _strspn ANSI((char *, char *));
char * _strstr ANSI((char *, char *));
char * _substr ANSI((char *, char *));
uint16 Hash ANSI((char *, uint32 *));
HASHPTR Get_name ANSI((char *, HASHPTR *, int));
HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
HASHPTR Def_macro ANSI((char *, char *, int));
CELLPTR Def_cell ANSI((char *));
LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
void Clear_prerequisites ANSI((CELLPTR));
int Test_circle ANSI((CELLPTR, int));
STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
t_attr Rcp_attribute ANSI((char *));
int main ANSI((int, char **));
FILE * Openfile ANSI((char *, int, int));
FILE * Closefile ANSI(());
FILE * Search_file ANSI((char *, char **));
char * Filename ANSI(());
void No_ram ANSI(());
int Usage ANSI((int));
int Version ANSI(());
char * Get_suffix ANSI((char *));
char * Build_path ANSI((char *, char *));
void Make_rules ANSI(());
void Create_macro_vars ANSI(());
time_t Do_stat ANSI((char *, char *, char **));
int Do_touch ANSI((char *, char *, char **));
void Void_lib_cache ANSI((char *, char *));
time_t Do_time ANSI(());
int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
char ** Pack_argv ANSI((int, int, char *));
char * Read_env_string ANSI((char *));
int Write_env_string ANSI((char *, char *));
void ReadEnvironment ANSI(());
void Catch_signals ANSI((void (*)()));
void Clear_signals ANSI(());
void Prolog ANSI((int, char* []));
void Epilog ANSI((int));
char * Get_current_dir ANSI(());
int Set_dir ANSI((char*));
char Get_switch_char ANSI(());
FILE* Get_temp ANSI((char **, char *, int));
FILE * Start_temp ANSI((char *, CELLPTR, char **));
void Open_temp_error ANSI((char *, char *));
void Link_temp ANSI((CELLPTR, FILE *, char *));
void Close_temp ANSI((CELLPTR, FILE *));
void Unlink_temp_files ANSI((CELLPTR));
void Handle_result ANSI((int, int, int, CELLPTR));
void Update_time_stamp ANSI((CELLPTR));
void Parse ANSI((FILE *));
int Get_line ANSI((char *, FILE *));
char * Do_comment ANSI((char *, char **, int));
char * Get_token ANSI((TKSTRPTR, char *, int));
void Quit ANSI(());
void Read_state ANSI(());
void Write_state ANSI(());
int Check_state ANSI((CELLPTR, STRINGPTR *, int));
char* basename ANSI((char *));
void Dump ANSI(());
void Dump_recipe ANSI((STRINGPTR));
int Parse_macro ANSI((char *, int));
int Macro_op ANSI((char *));
int Parse_rule_def ANSI((int *));
int Rule_op ANSI((char *));
void Add_recipe_to_list ANSI((char *, int, int));
void Bind_rules_to_targets ANSI((int));
int Set_group_attributes ANSI((char *));
DFALINKPTR Match_dfa ANSI((char *));
void Check_circle_dfa ANSI(());
void Add_nfa ANSI((char *));
char * Exec_function ANSI((char *));
time_t seek_arch ANSI((char *, char *));
int If_root_path ANSI((char *));
void Remove_prq ANSI((CELLPTR));
int runargv ANSI((CELLPTR, int, int, int, int, char *));
int Wait_for_child ANSI((int, int));
void Clean_up_processes ANSI(());
X
#endif
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/public.h ||
echo 'restore of dmake/unix/bsd43/vf/public.h failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/public.h'`"
test 5524 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/public.h: original size 5524, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/startup.mk ==============
if test -f 'dmake/unix/bsd43/vf/startup.mk' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/startup.mk (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/startup.mk' &&
# Generic UNIX DMAKE startup file.  Customize to suit your needs.
# Should work for both SYSV, and BSD 4.3
# See the documentation for a description of internally defined macros.
#
# Disable warnings for macros redefined here that were given
# on the command line.
__.SILENT := $(.SILENT)
.SILENT   := yes
X
# Configuration parameters for DMAKE startup.mk file
# Set these to NON-NULL if you wish to turn the parameter on.
_HAVE_RCS	:= yes		# yes => RCS  is installed.
_HAVE_SCCS	:= yes		# yes => SCCS is installed.
X
# Applicable suffix definitions
A := .a		# Libraries
E :=		# Executables
F := .f		# Fortran
O := .o		# Objects
P := .p		# Pascal
S := .s		# Assembler sources
V := ,v		# RCS suffix
X
# Recipe execution configurations
SHELL		:= /bin/sh
SHELLFLAGS	:= -ce
GROUPSHELL	:= $(SHELL)
GROUPFLAGS	:= 
SHELLMETAS	:= |();&<>?*][$$:\\#`'"
GROUPSUFFIX	:=
DIVFILE		 = $(TMPFILE)
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
# Definition of $(MAKE) macro for recursive makes.
X   MAKE = $(MAKECMD) $(MFLAGS)
X
# Definition of Print command for this system.
X   PRINT = lpr
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
# 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
# Implicit generation rules for making inferences.
# We don't provide .yr or .ye rules here.  They're obsolete.
# Rules for making *$O
X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
X   %$O : %$S ; $(AS) $(ASFLAGS) $<
X   %$O : %.cl ; class -c $<
X   %$O : %.e %.r %.F %$F
X	$(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
# Executables
X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
# lex and yacc rules
X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
X
# This rule tells how to make *.out from it's immediate list of prerequisites
# UNIX only.
X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
# RCS support
.IF $(_HAVE_RCS)
X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
.END
X
# SCCS support
.IF $(_HAVE_SCCS)
X   % : s.% ; get $@
X   .NOINFER : s.%
.END
X
# Recipe to make archive files.
%$A :
[
X   $(AR) $(ARFLAGS) $@ $?
X   $(RM) $(RMFLAGS) $?
X   ranlib $@
]
X
# DMAKE uses this recipe to remove intermediate targets
.REMOVE :; $(RM) -f $<
X
# AUGMAKE extensions for SYSV compatibility
@B = $(@:b)
@D = $(@:d)
@F = $(@:f)
*B = $(*:b)
*D = $(*:d)
*F = $(*:f)
<B = $(<:b)
<D = $(<:d)
<F = $(<:f)
?B = $(?:b)
?F = $(?:f)
?D = $(?:d)
X
# Turn warnings back to previous setting.
.SILENT := $(__.SILENT)
X
# Local startup file if any
.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/startup.mk ||
echo 'restore of dmake/unix/bsd43/vf/startup.mk failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/startup.mk'`"
test 3221 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/startup.mk: original size 3221, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/bsd43/vf/vfprintf.c ==============
if test -f 'dmake/unix/bsd43/vf/vfprintf.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/bsd43/vf/vfprintf.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/bsd43/vf/vfprintf.c' &&
/*
X * Copyright (c) 1988 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley.  The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)vfprintf.c	5.2 (Berkeley) 6/27/88";
#endif /* LIBC_SCCS and not lint */
X
#include <stdio.h>
#include <varargs.h>
X
int
vfprintf(iop, fmt, ap)
X	FILE *iop;
X	char *fmt;
X	va_list ap;
{
X	int len;
X	char localbuf[BUFSIZ];
X
X	if (iop->_flag & _IONBF) {
X		iop->_flag &= ~_IONBF;
X		iop->_ptr = iop->_base = localbuf;
X		len = _doprnt(fmt, ap, iop);
X		(void) fflush(iop);
X		iop->_flag |= _IONBF;
X		iop->_base = NULL;
X		iop->_bufsiz = 0;
X		iop->_cnt = 0;
X	} else
X		len = _doprnt(fmt, ap, iop);
X
X	return (ferror(iop) ? EOF : len);
}
X
SHAR_EOF
chmod 0640 dmake/unix/bsd43/vf/vfprintf.c ||
echo 'restore of dmake/unix/bsd43/vf/vfprintf.c failed'
Wc_c="`wc -c < 'dmake/unix/bsd43/vf/vfprintf.c'`"
test 1409 -eq "$Wc_c" ||
	echo 'dmake/unix/bsd43/vf/vfprintf.c: original size 1409, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/config.mk ==============
if test -f 'dmake/unix/config.mk' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/config.mk (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/config.mk' &&
# This is an OS specific configuration file
#	It assumes that OBJDIR, TARGET and DEBUG are previously defined.
#	It defines	CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
#			PRINTER, PRINTFLAGS
#	It augments	SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
#
PRINTER		= hw
PRINTFLAGS	= -P$(PRINTER)
STARTUPFILE	= $(OS)/startup.mk
CPPFLAGS 	= $(CFLAGS)
LDOBJS		= $(CSTARTUP) $(OBJDIR)/{$(<:f)}
LDARGS		= $(LDFLAGS) -o $@ $(LDOBJS) $(LDLIBS)
X
# Debug flags
DB_CFLAGS	= -g -DDBUG
DB_LDFLAGS	= -g
DB_LDLIBS	=
X
# NO Debug flags
NDB_CFLAGS	= -O
NDB_LDFLAGS	=
NDB_LDLIBS	=
X
# Local configuration modifications for CFLAGS.
CFLAGS         += -I$(OS)
X
# Sources that must be defined for each different version
OSSRC := arlib.c dirbrk.c rmprq.c ruletab.c runargv.c
SRC  += $(OSSRC)
.SETDIR=$(OS) : $(OSSRC)
X
# Set source dirs so that we can find files named in this
# config file.
.SOURCE.h : $(OS)
X
# See if we modify anything in the lower levels.
.IF $(OSRELEASE) != $(NULL)
X   .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
.END
SHAR_EOF
chmod 0640 dmake/unix/config.mk ||
echo 'restore of dmake/unix/config.mk failed'
Wc_c="`wc -c < 'dmake/unix/config.mk'`"
test 1031 -eq "$Wc_c" ||
	echo 'dmake/unix/config.mk: original size 1031, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/dirbrk.c ==============
if test -f 'dmake/unix/dirbrk.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/dirbrk.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/dirbrk.c' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/dirbrk.c,v 1.1 91/05/06 15:27:27 dvadura Exp $
-- SYNOPSIS -- define the directory separator string.
-- 
-- DESCRIPTION
-- 	Define this string for any character that may appear in a path name
--	and can be used as a directory separator.  Also provide a function
--	to indicate if a given path begins at the root of the file system.
--
-- AUTHOR
--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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 this program;  if not, write to the Free Software
--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--
-- LOG
--     $Log:	dirbrk.c,v $
X * Revision 1.1  91/05/06  15:27:27  dvadura
X * dmake Release Version 3.7
X * 
*/
X
#include "extern.h"
X
/* Unix only uses / */
char*	DirBrkStr = "/";
X
/*
** Return TRUE if the name is the full specification of a path name to a file
** starting at the root of the file system, otherwise return FALSE
*/
PUBLIC int
If_root_path(name)
char *name;
{
X   return( strchr(DirBrkStr, *name) != NIL(char) );
}
SHAR_EOF
chmod 0640 dmake/unix/dirbrk.c ||
echo 'restore of dmake/unix/dirbrk.c failed'
Wc_c="`wc -c < 'dmake/unix/dirbrk.c'`"
test 1812 -eq "$Wc_c" ||
	echo 'dmake/unix/dirbrk.c: original size 1812, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/explode.c ==============
if test -f 'dmake/unix/explode.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/explode.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/explode.c' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/explode.c,v 1.1 91/05/06 15:27:28 dvadura Exp $
-- SYNOPSIS -- Routines to explode dag if .SETDIR targets present.
-- 
-- DESCRIPTION
--	These routines are called by parallel dmake implementations to
--	explode the dmake DAG at .SETDIR targets so that parallel makes
--	can traverse common portions of the DAG in parallel.
-- 
-- AUTHOR
--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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 this program;  if not, write to the Free Software
--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--
-- LOG
--     $Log:	explode.c,v $
X * Revision 1.1  91/05/06  15:27:28  dvadura
X * dmake Release Version 3.7
X * 
*/
X
#include "extern.h"
#include "alloc.h"
#include "db.h"
X
CELLPTR
Explode_cell( cp, dir )
CELLPTR cp;
CELLPTR dir;
{
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
HOWPTR
Explode_how( how, dir, copy )
HOWPTR  how;
CELLPTR dir;
int     copy;
{
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
LINKPTR
Explode_prq( prq, dir, copy )
LINKPTR prq;
CELLPTR dir;
int     copy;
{
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 );
}
SHAR_EOF
chmod 0640 dmake/unix/explode.c ||
echo 'restore of dmake/unix/explode.c failed'
Wc_c="`wc -c < 'dmake/unix/explode.c'`"
test 3504 -eq "$Wc_c" ||
	echo 'dmake/unix/explode.c: original size 3504, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/rmprq.c ==============
if test -f 'dmake/unix/rmprq.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/rmprq.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/rmprq.c' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/rmprq.c,v 1.1 91/05/06 15:27:28 dvadura Exp $
-- SYNOPSIS -- remove prerequisites code.
-- 
-- DESCRIPTION
--	This code is different for DOS and for UNIX and parallel make
--	architectures since the parallel case requires the rm's to be
--	run in parallel, whereas DOS guarantees to run them sequentially.
-- 
-- AUTHOR
--      Dennis Vadura, dvadura at watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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 this program;  if not, write to the Free Software
--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--
-- LOG
--     $Log:	rmprq.c,v $
X * Revision 1.1  91/05/06  15:27:28  dvadura
X * dmake Release Version 3.7
X * 
*/
X
#include "extern.h"
X
PUBLIC void
Remove_prq( tcp )
CELLPTR tcp;
{
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_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);
X      m_g  = Get_name(">", Macs, TRUE);
X      m_q  = Get_name("?", Macs, TRUE);
X      m_b  = Get_name("<", Macs, TRUE);
X      m_l  = Get_name("&", Macs, TRUE);
X      m_bb = Get_name("*", Macs, TRUE);
X      m_up = Get_name("^", Macs, TRUE);
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, NIL(CELL) );
X   if( tlp->cl_prq->ce_dir ){
X      FREE(tlp->cl_prq->ce_dir);
X      tlp->cl_prq->ce_dir=NIL(char);
X   }
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;
}
SHAR_EOF
chmod 0640 dmake/unix/rmprq.c ||
echo 'restore of dmake/unix/rmprq.c failed'
Wc_c="`wc -c < 'dmake/unix/rmprq.c'`"
test 3634 -eq "$Wc_c" ||
	echo 'dmake/unix/rmprq.c: original size 3634, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/unix/ruletab.c ==============
if test -f 'dmake/unix/ruletab.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/unix/ruletab.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/unix/ruletab.c' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/ruletab.c,v 1.1 91/05/06 15:27:29 dvadura Exp $
SHAR_EOF
true || echo 'restore of dmake/unix/ruletab.c failed'
fi
echo 'End of part 34, continue with part 35'
echo 35 > _shar_seq_.tmp
exit 0

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent at sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent at uunet.uu.net.



More information about the Comp.sources.misc mailing list