dvadura@watdragon.waterloo.edu (Dennis Vadura) (06/30/91)
Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu> Posting-number: Volume 20, Issue 84 Archive-name: dmake/patch02i Patch-To: dmake: Volume 19, Issue 22-58 #!/bin/sh # this is dp2.08 (part 8 of a multipart archive) # do not concatenate these parts, unpack them in order with /bin/sh # file dm37p2 continued # if test ! -r _shar_seq_.tmp; then echo 'Please unpack part 1 first!' exit 1 fi (read Scheck if test "$Scheck" != 8; 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 echo 'x - still skipping dm37p2' else echo 'x - continuing file dm37p2' sed 's/^X//' << 'SHAR_EOF' >> 'dm37p2' && Xint Usage ANSI((int)); Xint Version ANSI(()); Xchar * Get_suffix ANSI((char *)); Xchar * Build_path ANSI((char *, char *)); Xvoid Make_rules ANSI(()); Xvoid Create_macro_vars ANSI(()); Xtime_t Do_stat ANSI((char *, char *, char **)); Xint Do_touch ANSI((char *, char *, char **)); Xvoid Void_lib_cache ANSI((char *, char *)); Xtime_t Do_time ANSI(()); Xint Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); Xchar ** Pack_argv ANSI((int, int, char *)); Xchar * Read_env_string ANSI((char *)); Xint Write_env_string ANSI((char *, char *)); Xvoid ReadEnvironment ANSI(()); Xvoid Catch_signals ANSI((void (*)())); Xvoid Clear_signals ANSI(()); Xvoid Prolog ANSI((int, char* [])); Xvoid Epilog ANSI((int)); Xchar * Get_current_dir ANSI(()); Xint Set_dir ANSI((char*)); Xchar Get_switch_char ANSI(()); XFILE* Get_temp ANSI((char **, char *, int)); XFILE * Start_temp ANSI((char *, CELLPTR, char **)); Xvoid Open_temp_error ANSI((char *, char *)); Xvoid Link_temp ANSI((CELLPTR, FILE *, char *)); Xvoid Close_temp ANSI((CELLPTR, FILE *)); Xvoid Unlink_temp_files ANSI((CELLPTR)); Xvoid Handle_result ANSI((int, int, int, CELLPTR)); Xvoid Update_time_stamp ANSI((CELLPTR)); Xvoid Parse ANSI((FILE *)); Xint Get_line ANSI((char *, FILE *)); Xchar * Do_comment ANSI((char *, char **, int)); Xchar * Get_token ANSI((TKSTRPTR, char *, int)); Xvoid Quit ANSI(()); Xvoid Read_state ANSI(()); Xvoid Write_state ANSI(()); Xint Check_state ANSI((CELLPTR, STRINGPTR *, int)); Xchar* basename ANSI((char *)); Xvoid Dump ANSI(()); Xvoid Dump_recipe ANSI((STRINGPTR)); Xint Parse_macro ANSI((char *, int)); Xint Macro_op ANSI((char *)); Xint Parse_rule_def ANSI((int *)); Xint Rule_op ANSI((char *)); Xvoid Add_recipe_to_list ANSI((char *, int, int)); Xvoid Bind_rules_to_targets ANSI((int)); Xint Set_group_attributes ANSI((char *)); XDFALINKPTR Match_dfa ANSI((char *)); Xvoid Check_circle_dfa ANSI(()); Xvoid Add_nfa ANSI((char *)); Xchar * Exec_function ANSI((char *)); Xint If_root_path ANSI((char *)); Xint runargv ANSI((CELLPTR, int, int, int, int, char *)); Xvoid Clean_up_processes ANSI(()); Xint Wait_for_child ANSI((int, int)); Xtime_t seek_arch ANSI((char*, char*)); Xint touch_arch ANSI((char*, char*)); Xint _chdir ANSI((char *)); Xvoid Remove_prq ANSI((CELLPTR)); Xvoid Hook_std_writes ANSI((char *)); XX X#endif XSHAR_EOF Xchmod 0640 msdos/ztcdos/public.h || Xecho 'restore of msdos/ztcdos/public.h failed' XWc_c="`wc -c < 'msdos/ztcdos/public.h'`" Xtest 5417 -eq "$Wc_c" || X echo 'msdos/ztcdos/public.h: original size 5417, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/startup.mk ============== Xif test -f 'msdos/ztcdos/startup.mk' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/startup.mk (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/startup.mk (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/startup.mk' && X# MSDOS DMAKE startup file. Customize to suit your needs. X# Assumes MKS toolkit for the tool commands, and Zortech C. Change as req'd. 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 XX 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 => SCCS is installed. XX X# Applicable suffix definitions XA := .lib # Libraries XE := .exe # Executables XF := .for # Fortran XO := .obj # Objects XP := .pas # Pascal XS := .asm # Assembler sources XV := # RCS suffix XX X# See if these are defined XTMPDIR := $(ROOTDIR)/tmp X.IMPORT .IGNORE : TMPDIR SHELL COMSPEC XX X# Recipe execution configurations X# First set SHELL, If it is not defined, use COMSPEC, otherwise X# it is assumed to be MKS Korn SHELL. X.IF $(SHELL) == $(NULL) X.IF $(COMSPEC) == $(NULL) XX SHELL := $(ROOTDIR)/bin/sh$E X.ELSE XX SHELL := $(COMSPEC) X.END X.END XGROUPSHELL := $(SHELL) XX X# Now set remaining arguments depending on which SHELL we X# are going to use. COMSPEC (assumed to be command.com) or X# MKS Korn Shell. X.IF $(SHELL)==$(COMSPEC) XX SHELLFLAGS := $(SWITCHAR)c XX GROUPFLAGS := $(SHELLFLAGS) XX SHELLMETAS := *"?<> XX GROUPSUFFIX := .bat XX DIRSEPSTR := \\ XX DIVFILE = $(TMPFILE:s,/,\) X.ELSE XX SHELLFLAGS := -c XX GROUPFLAGS := XX SHELLMETAS := *"?<>|()&][$$\#`' XX GROUPSUFFIX := .ksh XX .MKSARGS := yes XX DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) XX DIVSEP_shell_yes := \\\ XX DIVSEP_shell_no := \\ X.END XX X# Standard C-language command names and flags XX CC := ztc # C-compiler and flags XX CFLAGS += XX XX AS := masm # Assembler and flags XX ASFLAGS += XX XX LD = blink # Loader and flags XX LDFLAGS += XX LDLIBS = XX X# Definition of $(MAKE) macro for recursive makes. XX MAKE = $(MAKECMD) $(MFLAGS) XX X# Language and Parser generation Tools and their flags XX YACC := yacc # standard yacc XX YFLAGS += XX YTAB := ytab # yacc output files name stem. XX XX LEX := lex # standard lex XX LFLAGS += XX LEXYY := lex_yy # lex output file XX X# Other Compilers, Tools and their flags XX PC := any_pc # pascal compiler XX RC := anyf77 # ratfor compiler XX FC := anyf77 # fortran compiler XX XX CO := co # check out for RCS XX COFLAGS += -q XX XX AR := ar # archiver XX ARFLAGS+= ruv XX XX RM := rm # remove a file command XX RMFLAGS += XX 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 XX %$O : %.c ; $(CC) $(CFLAGS) -c $< XX %$O : %.cpp ; $(CC) $(CFLAGS) -c $< XX %$O : %$P ; $(PC) $(PFLAGS) -c $< XX %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); XX %$O : %.cl ; class -c $< XX %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< XX X# Executables XX %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS) XX X# lex and yacc rules XX %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ XX %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ XX X# RCS support X.IF $(_HAVE_RCS) XX % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@ XX .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V X.END XX X# SCCS support X.IF $(_HAVE_SCCS) XX % : s.% ; get $@ XX .NOINFER : s.% X.END XX X# Recipe to make archive files. X%$A : X[ XX $(AR) $(ARFLAGS) $@ $? XX $(RM) $(RMFLAGS) $? X] XX X# DMAKE uses this recipe to remove intermediate targets X.REMOVE :; $(RM) -f $< XX X# AUGMAKE extensions for SYSV compatibility X@B = $(@:b) X@D = $(@:d) X@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) XX X# Turn warnings back to previous setting. X.SILENT := $(__.SILENT) XX X# Local init file if any, gets parsed before user makefile X.INCLUDE .IGNORE: "_startup.mk" XSHAR_EOF Xchmod 0640 msdos/ztcdos/startup.mk || Xecho 'restore of msdos/ztcdos/startup.mk failed' XWc_c="`wc -c < 'msdos/ztcdos/startup.mk'`" Xtest 3861 -eq "$Wc_c" || X echo 'msdos/ztcdos/startup.mk: original size 3861, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/tempnam.c ============== Xif test -f 'msdos/ztcdos/tempnam.c' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/tempnam.c (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/tempnam.c (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/tempnam.c' && X/*LINTLIBRARY*/ X#include <stdio.h> X#include <string.h> X#include <stdlib.h> X#include <dos.h> XX X#if defined(max) X# undef max X#endif X#define max(A,B) (((A)<(B))?(B):(A)) XX Xextern char *mktemp(); Xextern int access(); Xint _access(); XX X/* Zortech C stdio.h doesn't define P_tmpdir, so let's do it here */ X/* Under DOS leave the default tmpdir pointing here! */ Xstatic char *P_tmpdir = ""; XX Xchar * Xtempnam(dir, prefix) Xconst char *dir; /* use this directory please (if non-NULL) */ Xconst char *prefix; /* use this (if non-NULL) as filename prefix */ X{ XX static int count = 0; XX register char *p, *q, *tmpdir; XX int tl=0, dl=0, pl; XX char buf[30]; XX XX pl = strlen(P_tmpdir); XX XX if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); XX if( dir != NULL ) dl = strlen(dir); XX XX if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL ) XX return(NULL); XX XX *p = '\0'; XX XX if( (tl == 0) || (_access( strcpy(p, tmpdir), 0) != 0) ) XX if( (dl == 0) || (_access( strcpy(p, dir), 0) != 0) ) XX if( _access( strcpy(p, P_tmpdir), 0) != 0 ) XX if( !prefix ) XX prefix = "tp"; XX XX if(prefix) XX { XX *(p+strlen(p)+2) = '\0'; XX (void)strncat(p, prefix, 2); XX } XX XX sprintf( buf, "%08x", _psp ); XX buf[6]='\0'; XX (void)strcat(p, buf ); XX sprintf( buf, "%04d", count++ ); XX q=p+strlen(p)-6; XX *q++ = buf[0]; *q++ = buf[1]; XX *q++ = buf[2]; *q++ = buf[3]; XX XX if( (q = strrchr(p,'.')) != NULL ) *q = '\0'; XX XX return(p); X} XX XX XX X_access( name, flag ) Xchar *name; Xint flag; X{ XX char *p; XX int r; XX XX if( name == NULL || !*name ) return(1); /* NULL dir means current dir */ XX r = access( name, flag ); XX p = name+strlen(name)-1; XX if(*p != '/' && *p != '\\') strcat( p, "/" ); XX XX return( r ); X} XSHAR_EOF Xchmod 0440 msdos/ztcdos/tempnam.c || Xecho 'restore of msdos/ztcdos/tempnam.c failed' XWc_c="`wc -c < 'msdos/ztcdos/tempnam.c'`" Xtest 1738 -eq "$Wc_c" || X echo 'msdos/ztcdos/tempnam.c: original size 1738, current size' "$Wc_c" Xfi X# ============= unix/coherent/config.h ============== Xif test ! -d 'unix'; then X echo 'x - creating directory unix' X mkdir 'unix' Xfi Xif test ! -d 'unix/coherent'; then X echo 'x - creating directory unix/coherent' X mkdir 'unix/coherent' Xfi Xif test -f 'unix/coherent/config.h' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/config.h (File already exists)' Xelse Xecho 'x - extracting unix/coherent/config.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/config.h' && X/* X-- COHERENT config.h 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@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: config.h,v $ XX * Revision 1.1 91/06/24 11:09:20 dvadura XX * dmake release Version 3.7 XX * XX * Revision 1.1 91/05/06 15:28:20 dvadura XX * dmake Release Version 3.7 XX * X*/ XX X/* define this for configurations that don't have the coreleft function XX * so that the code compiles. To my knowledge coreleft exists only on XX * Turbo C, but it is needed here since the function is used in many debug XX * macros. */ X#define coreleft() 0L XX Xextern char *getcwd (); XX X/* Define setvbuf, SysV doesn't have one */ X#define setvbuf(fp, bp, type, len) setbuf( fp, NULL ); X#define tzset settz XX X/* We don't care about CONST */ X#define CONST X#define void int Xtypedef paddr_t off_t; XX X/* options. . . */ X#define ASCARCH 0 XSHAR_EOF Xchmod 0444 unix/coherent/config.h || Xecho 'restore of unix/coherent/config.h failed' XWc_c="`wc -c < 'unix/coherent/config.h'`" Xtest 1940 -eq "$Wc_c" || X echo 'unix/coherent/config.h: original size 1940, current size' "$Wc_c" Xfi X# ============= unix/coherent/config.mk ============== Xif test -f 'unix/coherent/config.mk' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/config.mk (File already exists)' Xelse Xecho 'x - extracting unix/coherent/config.mk (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/config.mk' && X# This is the COHERENT 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) XX X# The following are required sources XOSDSRC := vfprintf.c getcwd.c X.IF $(OSDSRC) XX SRC += $(OSDSRC) XX .SETDIR=$(osrdir) : $(OSDSRC) X.END XX X.SOURCE.h : $(osrdir) XX X# Local configuration modifications for CFLAGS, there's local SysV includes X# too. XCFLAGS += -I$(osrdir) XX X# See if we modify anything in the lower levels. X.IF $(OSENVIRONMENT) != $(NULL) XX .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk X.END XSHAR_EOF Xchmod 0644 unix/coherent/config.mk || Xecho 'restore of unix/coherent/config.mk failed' XWc_c="`wc -c < 'unix/coherent/config.mk'`" Xtest 765 -eq "$Wc_c" || X echo 'unix/coherent/config.mk: original size 765, current size' "$Wc_c" Xfi X# ============= unix/coherent/getcwd.c ============== Xif test -f 'unix/coherent/getcwd.c' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/getcwd.c (File already exists)' Xelse Xecho 'x - extracting unix/coherent/getcwd.c (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/getcwd.c' && X#if __STDC__ Xchar *getcwd(char *buffer, int length) X#else Xchar *getcwd (buffer, length) Xchar *buffer; Xint length; X#endif X{ XX extern char *getwd(); XX XX char *dir; XX dir = getwd(); XX if (dir) XX { XX strncpy(buffer,dir,length); XX return buffer; XX } XX else XX { XX *buffer = 0; XX return (char *) 0; XX } X} XX XSHAR_EOF Xchmod 0444 unix/coherent/getcwd.c || Xecho 'restore of unix/coherent/getcwd.c failed' XWc_c="`wc -c < 'unix/coherent/getcwd.c'`" Xtest 306 -eq "$Wc_c" || X echo 'unix/coherent/getcwd.c: original size 306, current size' "$Wc_c" Xfi X# ============= unix/coherent/make.sh ============== Xif test -f 'unix/coherent/make.sh' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/make.sh (File already exists)' Xelse Xecho 'x - extracting unix/coherent/make.sh (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/make.sh' && Xmkdir objects Xcc -c -I. -Iunix -Iunix/coherent -O infer.c Xmv infer.o objects Xcc -c -I. -Iunix -Iunix/coherent -O make.c Xmv make.o objects Xcc -c -I. -Iunix -Iunix/coherent -O stat.c Xmv stat.o objects Xcc -c -I. -Iunix -Iunix/coherent -O expand.c Xmv expand.o objects Xcc -c -I. -Iunix -Iunix/coherent -O dmstring.c Xmv dmstring.o objects Xcc -c -I. -Iunix -Iunix/coherent -O hash.c Xmv hash.o objects Xcc -c -I. -Iunix -Iunix/coherent -O dag.c Xmv dag.o objects Xcc -c -I. -Iunix -Iunix/coherent -O dmake.c Xmv dmake.o objects Xcc -c -I. -Iunix -Iunix/coherent -O path.c Xmv path.o objects Xcc -c -I. -Iunix -Iunix/coherent -O imacs.c Xmv imacs.o objects Xcc -c -I. -Iunix -Iunix/coherent -O sysintf.c Xmv sysintf.o objects Xcc -c -I. -Iunix -Iunix/coherent -O parse.c Xmv parse.o objects Xcc -c -I. -Iunix -Iunix/coherent -O getinp.c Xmv getinp.o objects Xcc -c -I. -Iunix -Iunix/coherent -O quit.c Xmv quit.o objects Xcc -c -I. -Iunix -Iunix/coherent -O state.c Xmv state.o objects Xcc -c -I. -Iunix -Iunix/coherent -O basename.c Xmv basename.o objects Xcc -c -I. -Iunix -Iunix/coherent -O dmdump.c Xmv dmdump.o objects Xcc -c -I. -Iunix -Iunix/coherent -O macparse.c Xmv macparse.o objects Xcc -c -I. -Iunix -Iunix/coherent -O rulparse.c Xmv rulparse.o objects Xcc -c -I. -Iunix -Iunix/coherent -O percent.c Xmv percent.o objects Xcc -c -I. -Iunix -Iunix/coherent -O function.c Xmv function.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/arlib.c Xmv arlib.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/dirbrk.c Xmv dirbrk.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/rmprq.c Xmv rmprq.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/ruletab.c Xmv ruletab.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/runargv.c Xmv runargv.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/coherent/vfprintf.c Xmv vfprintf.o objects Xcc -c -I. -Iunix -Iunix/coherent -O unix/coherent/getcwd.c Xmv getcwd.o objects Xcc -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/vfprintf.o objects/getcwd.o Xcp unix/coherent/startup.mk startup.mk XSHAR_EOF Xchmod 0644 unix/coherent/make.sh || Xecho 'restore of unix/coherent/make.sh failed' XWc_c="`wc -c < 'unix/coherent/make.sh'`" Xtest 2405 -eq "$Wc_c" || X echo 'unix/coherent/make.sh: original size 2405, current size' "$Wc_c" Xfi X# ============= unix/coherent/public.h ============== Xif test -f 'unix/coherent/public.h' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/public.h (File already exists)' Xelse Xecho 'x - extracting unix/coherent/public.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/public.h' && X/* RCS -- $Header$ X-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT X-- X-- SYNOPSIS -- Local functions exported to be visible by others. X-- X-- DESCRIPTION X-- This file is generated by 'genpub'. Function declarations X-- that appear in this file are extracted by 'genpub' from X-- source files. Any function in the source file whose definition X-- appears like: X-- X-- PUBLIC return_type X-- function( arg_list ); X-- type_expr1 arg1; X-- ... X-- X-- has its definition extracted and a line of the form: X-- X-- return_type function ANSI((type_expr1,type_expr2,...)); X-- X-- entered into the output file. X-- X-- AUTHOR X-- Dennis Vadura, dvadura@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*/ XX X#ifndef _DMAKE_PUBLIC_h X#define _DMAKE_PUBLIC_h XX Xvoid Infer_recipe ANSI((CELLPTR, CELLPTR)); Xint Make_targets ANSI(()); Xint Exec_commands ANSI((CELLPTR)); Xvoid Pop_dir ANSI((int)); Xvoid Append_line ANSI((char *, int, FILE *, char *, int, int)); Xvoid Stat_target ANSI((CELLPTR, int)); Xchar * Expand ANSI((char *)); Xchar * Apply_edit ANSI((char *, char *, char *, int, int)); Xvoid Map_esc ANSI((char *)); Xchar* Apply_modifiers ANSI((int, char *)); Xchar* Tokenize ANSI((char *, char *)); Xchar * _strjoin ANSI((char *, char *, int, int)); Xchar * _stradd ANSI((char *, char *, int)); Xchar * _strapp ANSI((char *, char *)); Xchar * _strdup ANSI((char *)); Xchar * _strpbrk ANSI((char *, char *)); Xchar * _strspn ANSI((char *, char *)); Xchar * _strstr ANSI((char *, char *)); Xchar * _substr ANSI((char *, char *)); Xuint16 Hash ANSI((char *, uint32 *)); XHASHPTR Get_name ANSI((char *, HASHPTR *, int)); XHASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); XHASHPTR Def_macro ANSI((char *, char *, int)); XCELLPTR Def_cell ANSI((char *)); XLINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); Xvoid Clear_prerequisites ANSI((CELLPTR)); Xint Test_circle ANSI((CELLPTR, int)); XSTRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); Xt_attr Rcp_attribute ANSI((char *)); Xint main ANSI((int, char **)); XFILE * Openfile ANSI((char *, int, int)); XFILE * Closefile ANSI(()); XFILE * Search_file ANSI((char *, char **)); Xchar * Filename ANSI(()); Xvoid No_ram ANSI(()); Xint Usage ANSI((int)); Xint Version ANSI(()); Xchar * Get_suffix ANSI((char *)); Xchar * Build_path ANSI((char *, char *)); Xvoid Make_rules ANSI(()); Xvoid Create_macro_vars ANSI(()); Xtime_t Do_stat ANSI((char *, char *, char **)); Xint Do_touch ANSI((char *, char *, char **)); Xvoid Void_lib_cache ANSI((char *, char *)); Xtime_t Do_time ANSI(()); Xint Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int)); Xchar ** Pack_argv ANSI((int, int, char *)); Xchar * Read_env_string ANSI((char *)); Xint Write_env_string ANSI((char *, char *)); Xvoid ReadEnvironment ANSI(()); Xvoid Catch_signals ANSI((void (*)())); Xvoid Clear_signals ANSI(()); Xvoid Prolog ANSI((int, char* [])); Xvoid Epilog ANSI((int)); Xchar * Get_current_dir ANSI(()); Xint Set_dir ANSI((char*)); Xchar Get_switch_char ANSI(()); XFILE* Get_temp ANSI((char **, char *, int)); XFILE * Start_temp ANSI((char *, CELLPTR, char **)); Xvoid Open_temp_error ANSI((char *, char *)); Xvoid Link_temp ANSI((CELLPTR, FILE *, char *)); Xvoid Close_temp ANSI((CELLPTR, FILE *)); Xvoid Unlink_temp_files ANSI((CELLPTR)); Xvoid Handle_result ANSI((int, int, int, CELLPTR)); Xvoid Update_time_stamp ANSI((CELLPTR)); Xvoid Parse ANSI((FILE *)); Xint Get_line ANSI((char *, FILE *)); Xchar * Do_comment ANSI((char *, char **, int)); Xchar * Get_token ANSI((TKSTRPTR, char *, int)); Xvoid Quit ANSI(()); Xvoid Read_state ANSI(()); Xvoid Write_state ANSI(()); Xint Check_state ANSI((CELLPTR, STRINGPTR *, int)); Xchar* basename ANSI((char *)); Xvoid Dump ANSI(()); Xvoid Dump_recipe ANSI((STRINGPTR)); Xint Parse_macro ANSI((char *, int)); Xint Macro_op ANSI((char *)); Xint Parse_rule_def ANSI((int *)); Xint Rule_op ANSI((char *)); Xvoid Add_recipe_to_list ANSI((char *, int, int)); Xvoid Bind_rules_to_targets ANSI((int)); Xint Set_group_attributes ANSI((char *)); XDFALINKPTR Match_dfa ANSI((char *)); Xvoid Check_circle_dfa ANSI(()); Xvoid Add_nfa ANSI((char *)); Xchar * Exec_function ANSI((char *)); Xtime_t seek_arch ANSI((char *, char *)); Xint If_root_path ANSI((char *)); Xvoid Remove_prq ANSI((CELLPTR)); Xint runargv ANSI((CELLPTR, int, int, int, int, char *)); Xint Wait_for_child ANSI((int, int)); Xvoid Clean_up_processes ANSI(()); XX X#endif XSHAR_EOF Xchmod 0640 unix/coherent/public.h || Xecho 'restore of unix/coherent/public.h failed' XWc_c="`wc -c < 'unix/coherent/public.h'`" Xtest 5318 -eq "$Wc_c" || X echo 'unix/coherent/public.h: original size 5318, current size' "$Wc_c" Xfi X# ============= unix/coherent/startup.mk ============== Xif test -f 'unix/coherent/startup.mk' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/startup.mk (File already exists)' Xelse Xecho 'x - extracting unix/coherent/startup.mk (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/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 XX 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. XX 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 XX X# Recipe execution configurations XSHELL := /bin/sh XSHELLFLAGS := -ce XGROUPSHELL := $(SHELL) XGROUPFLAGS := XSHELLMETAS := |();&<>?*][$$:\\#`'" XGROUPSUFFIX := XDIVFILE = $(TMPFILE) XX X# Standard C-language command names and flags XX CPP := /lib/cpp # C-preprocessor XX CC := cc # C-compiler and flags XX CFLAGS += XX XX AS := as # Assembler and flags XX ASFLAGS += XX XX LD = $(CC) # Loader and flags XX LDFLAGS += XX LDLIBS = XX X# Definition of $(MAKE) macro for recursive makes. XX MAKE = $(MAKECMD) $(MFLAGS) XX X# Definition of Print command for this system. XX PRINT = lpr XX X# Language and Parser generation Tools and their flags XX YACC := yacc # standard yacc XX YFLAGS += XX YTAB := y.tab # yacc output files name stem. XX XX LEX := lex # standard lex XX LFLAGS += XX LEXYY := lex.yy # lex output file XX X# Other Compilers, Tools and their flags XX PC := pc # pascal compiler XX RC := f77 # ratfor compiler XX FC := f77 # fortran compiler XX XX CO := co # check out for RCS XX COFLAGS += -q XX XX AR := ar # archiver XX ARFLAGS+= ruv XX XX RM := /bin/rm # remove a file command XX RMFLAGS += XX 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 XX %$O : %.c ; $(CC) $(CFLAGS) -c $< XX %$O : %$P ; $(PC) $(PFLAGS) -c $< XX %$O : %$S ; $(AS) $(ASFLAGS) $< XX %$O : %.cl ; class -c $< XX %$O : %.e %.r %.F %$F XX $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< XX X# Executables XX %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES) XX X# lex and yacc rules XX %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ XX %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ XX X# This rule tells how to make *.out from it's immediate list of prerequisites X# UNIX only. XX %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) XX X# RCS support X.IF $(_HAVE_RCS) XX % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ XX .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V X.END XX X# SCCS support X.IF $(_HAVE_SCCS) XX % : s.% ; get $@ XX .NOINFER : s.% X.END XX X# Recipe to make archive files. X%$A : X[ XX $(AR) $(ARFLAGS) $@ $? XX $(RM) $(RMFLAGS) $? XX ranlib $@ X] XX X# DMAKE uses this recipe to remove intermediate targets X.REMOVE :; $(RM) -f $< XX X# AUGMAKE extensions for SYSV compatibility X@B = $(@:b) X@D = $(@:d) X@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) XX X# Turn warnings back to previous setting. X.SILENT := $(__.SILENT) XX X# Local startup file if any X.INCLUDE .IGNORE: "_startup.mk" XSHAR_EOF Xchmod 0644 unix/coherent/startup.mk || Xecho 'restore of unix/coherent/startup.mk failed' XWc_c="`wc -c < 'unix/coherent/startup.mk'`" Xtest 3221 -eq "$Wc_c" || X echo 'unix/coherent/startup.mk: original size 3221, current size' "$Wc_c" Xfi X# ============= unix/coherent/stdarg.h ============== Xif test -f 'unix/coherent/stdarg.h' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/stdarg.h (File already exists)' Xelse Xecho 'x - extracting unix/coherent/stdarg.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/stdarg.h' && X/* XX * stdarg.h XX * XX * defines ANSI style macros for accessing arguments of a function which takes XX * a variable number of arguments XX * XX */ XX X#if !defined(__STDARG_H__) X#define __STDARG_H__ XX X#if !defined(_VA_LIST_) && !defined(_VA_LIST) X#define _VA_LIST_ X#define _VA_LIST Xtypedef char *va_list; X#endif XX 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 XSHAR_EOF Xchmod 0444 unix/coherent/stdarg.h || Xecho 'restore of unix/coherent/stdarg.h failed' XWc_c="`wc -c < 'unix/coherent/stdarg.h'`" Xtest 469 -eq "$Wc_c" || X echo 'unix/coherent/stdarg.h: original size 469, current size' "$Wc_c" Xfi X# ============= unix/coherent/stdlib.h ============== Xif test -f 'unix/coherent/stdlib.h' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/stdlib.h (File already exists)' Xelse Xecho 'x - extracting unix/coherent/stdlib.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/stdlib.h' && X#ifndef _STDLIB_INCLUDED_ X#define _STDLIB_INCLUDED_ XX 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; XX X#ifndef EIO X# include <errno.h> X#endif XX X#endif /* _STDLIB_INCLUDED_ */ XSHAR_EOF Xchmod 0444 unix/coherent/stdlib.h || Xecho 'restore of unix/coherent/stdlib.h failed' XWc_c="`wc -c < 'unix/coherent/stdlib.h'`" Xtest 346 -eq "$Wc_c" || X echo 'unix/coherent/stdlib.h: original size 346, current size' "$Wc_c" Xfi X# ============= unix/coherent/time.h ============== Xif test -f 'unix/coherent/time.h' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/time.h (File already exists)' Xelse Xecho 'x - extracting unix/coherent/time.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/time.h' && X/* X** Berkeley get this wrong! X*/ X#ifndef TIME_h X#define TIME_h XX Xtypedef long time_t; /* this is the thing we use */ XX X#endif TIME_h XX XSHAR_EOF Xchmod 0444 unix/coherent/time.h || Xecho 'restore of unix/coherent/time.h failed' XWc_c="`wc -c < 'unix/coherent/time.h'`" Xtest 133 -eq "$Wc_c" || X echo 'unix/coherent/time.h: original size 133, current size' "$Wc_c" Xfi X# ============= unix/coherent/vfprintf.c ============== Xif test -f 'unix/coherent/vfprintf.c' -a X"$1" != X"-c"; then X echo 'x - skipping unix/coherent/vfprintf.c (File already exists)' Xelse Xecho 'x - extracting unix/coherent/vfprintf.c (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/coherent/vfprintf.c' && X/* Portable vfprintf and vprintf by Robert A. Larson <blarson@skat.usc.edu> */ XX X/* Copyright 1989 Robert A. Larson. XX * Distribution in any form is allowed as long as the author XX * retains credit, changes are noted by their author and the XX * copyright message remains intact. This program comes as-is XX * with no warentee of fitness for any purpouse. XX * XX * Thanks to Doug Gwen, Chris Torek, and others who helped clarify XX * the ansi printf specs. XX * XX * Please send any bug fixes and improvments to blarson@skat.usc.edu . XX * The use of goto is NOT a bug. XX */ XX X/* Feb 9, 1989 blarson First usenet release */ XX X/* This code implements the vfprintf function, without relying on XX * the existance of _doprint or other system specific code. XX * XX * Define NOVOID if void * is not a supported type. XX * XX * Two compile options are available for efficency: XX * INTSPRINTF should be defined if sprintf is int and returns XX * the number of chacters formated. XX * LONGINT should be defined if sizeof(long) == sizeof(int) XX * XX * They only make the code smaller and faster, they need not be XX * defined. XX * XX * UNSIGNEDSPECIAL should be defined if unsigned is treated differently XX * than int in argument passing. If this is definded, and LONGINT is not, XX * the compiler must support the type unsingned long. XX * XX * Most quirks and bugs of the available fprintf fuction are duplicated, XX * however * in the width and precision fields will work correctly XX * even if fprintf does not support this. The %n format and the return XX * count will only work if fprintf returns the number of characters XX * formatted. XX * XX * Bad format strings, or those with very long width and precision XX * fields (including expanded * fields) will cause undesired results. XX */ XX X#ifdef OSK /* os9/68k can take advantage of both */ X#define INTSPRINTF X#define LONGINT X#endif X#define NOVOID 1 XX X/* This must be a typedef not a #define! */ X#ifdef NOVOID Xtypedef char *pointer; X#else Xtypedef void *pointer; X#endif XX X#include <stdio.h> XX X#ifdef INTSPRINTF X#define Sprintf(string,format,arg) (sprintf((string),(format),(arg))) X#else X#define Sprintf(string,format,arg) (\ XX sprintf((string),(format),(arg)),\ XX strlen(string)\ X) X#endif XX X#include <stdarg.h> XX Xtypedef int *intp; XX Xint vfprintf(dest, format, args) XFILE *dest; Xregister char *format; Xva_list args; X{ XX register char c; XX register char *tp; XX register int count = 0; XX char tempfmt[64]; X#ifndef LONGINT XX int longflag; X#endif XX XX tempfmt[0] = '%'; XX while(c = *format++) { XX if(c=='%') { XX tp = &tempfmt[1]; X#ifndef LONGINT XX longflag = 0; X#endif Xcontinue_format: XX switch(c = *format++) { XX case 's': XX *tp++ = c; XX *tp = '\0'; XX count += fprintf(dest, tempfmt, va_arg(args, char *)); XX break; XX case 'u': XX case 'x': XX case 'o': XX case 'X': X#ifdef UNSIGNEDSPECIAL XX *tp++ = c; XX *tp = '\0'; X#ifndef LONGINT XX if(longflag) XX count += fprintf(dest, tempfmt, va_arg(args, unsigned long)); XX else X#endif XX count += fprintf(dest, tempfmt, va_arg(args, unsigned)); XX break; X#endif XX case 'd': XX case 'c': XX case 'i': XX *tp++ = c; XX *tp = '\0'; X#ifndef LONGINT XX if(longflag) XX count += fprintf(dest, tempfmt, va_arg(args, long)); XX else X#endif XX count += fprintf(dest, tempfmt, va_arg(args, int)); XX break; XX case 'f': XX case 'e': XX case 'E': XX case 'g': XX case 'G': XX *tp++ = c; XX *tp = '\0'; XX count += fprintf(dest, tempfmt, va_arg(args, double)); XX break; XX case 'p': XX *tp++ = c; XX *tp = '\0'; XX count += fprintf(dest, tempfmt, va_arg(args, pointer)); XX break; XX case '-': XX case '+': XX case '0': XX case '1': XX case '2': XX case '3': XX case '4': XX case '5': XX case '6': XX case '7': XX case '8': XX case '9': XX case '.': XX case ' ': XX case '#': XX case 'h': XX *tp++ = c; XX goto continue_format; XX case 'l': X#ifndef LONGINT XX longflag = 1; XX *tp++ = c; X#endif XX goto continue_format; XX case '*': XX tp += Sprintf(tp, "%d", va_arg(args, int)); XX goto continue_format; XX case 'n': XX *va_arg(args, intp) = count; XX break; XX case '%': XX default: XX putc(c, dest); XX count++; XX break; XX } XX } else { XX putc(c, dest); XX count++; XX } XX } XX return count; X} XX Xvprintf(format, args) Xchar *format; Xva_list args; X{ XX return vfprintf(stdout, format, args); X} XSHAR_EOF Xchmod 0444 unix/coherent/vfprintf.c || Xecho 'restore of unix/coherent/vfprintf.c failed' XWc_c="`wc -c < 'unix/coherent/vfprintf.c'`" Xtest 4312 -eq "$Wc_c" || X echo 'unix/coherent/vfprintf.c: original size 4312, current size' "$Wc_c" Xfi X# ============= unix/sysvr3/pwd/config.mk ============== Xif test ! -d 'unix/sysvr3'; then X echo 'x - creating directory unix/sysvr3' X mkdir 'unix/sysvr3' Xfi Xif test ! -d 'unix/sysvr3/pwd'; then X echo 'x - creating directory unix/sysvr3/pwd' X mkdir 'unix/sysvr3/pwd' Xfi Xif test -f 'unix/sysvr3/pwd/config.mk' -a X"$1" != X"-c"; then X echo 'x - skipping unix/sysvr3/pwd/config.mk (File already exists)' Xelse Xecho 'x - extracting unix/sysvr3/pwd/config.mk (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/sysvr3/pwd/config.mk' && X# This is the Sys VR3 PWD configuration file. It configures SysvR3 unix X# versions of dmake to use a provided version of getcwd rather than the X# standard library version that uses popen to capture the output of pwd. X# XX Xosredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT) XX X# The following are required sources XOSRESRC := getcwd.c XX X.IF $(OSRESRC) XX SRC += $(OSRESRC) XX .SETDIR=$(osredir) : $(OSRESRC) X.END XX X.SOURCE.h : $(osredir) XX X# Local configuration modifications for CFLAGS, there's local SysV includes X# too. XCFLAGS += -I$(osredir) XSHAR_EOF Xchmod 0640 unix/sysvr3/pwd/config.mk || Xecho 'restore of unix/sysvr3/pwd/config.mk failed' XWc_c="`wc -c < 'unix/sysvr3/pwd/config.mk'`" Xtest 559 -eq "$Wc_c" || X echo 'unix/sysvr3/pwd/config.mk: original size 559, current size' "$Wc_c" Xfi X# ============= unix/sysvr3/pwd/getcwd.c ============== Xif test -f 'unix/sysvr3/pwd/getcwd.c' -a X"$1" != X"-c"; then X echo 'x - skipping unix/sysvr3/pwd/getcwd.c (File already exists)' Xelse Xecho 'x - extracting unix/sysvr3/pwd/getcwd.c (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'unix/sysvr3/pwd/getcwd.c' && X/* XX getcwd -- get pathname of current working directory XX XX public-domain implementation XX XX last edit: 03-Nov-1990 Gwyn@BRL.MIL XX XX complies with the following standards: XX IEEE Std 1003.1-1988 XX SVID Issue 3 XX X/Open Portability Guide Issue 2 (when "XPG2" is defined) XX X/Open Portability Guide Issue 3 XX XX This implementation of getcwd() can be used to replace the UNIX XX System V library routine (which uses popen() to capture the output of XX the "pwd" command). Once that is done, "pwd" can be reimplemented as XX just puts(getcwd((char*)0,0)), assuming "XPG2" is defined below. XX XX This implementation depends on every directory having entries for XX "." and "..". It also depends on the internals of the <dirent.h> XX data structures to some degree. SHAR_EOF true || echo 'restore of dm37p2 failed' fi echo 'End of part 8' echo 'File dm37p2 is continued in part 9' echo 9 > _shar_seq_.tmp exit 0 exit 0 # Just in case... -- Kent Landfield INTERNET: kent@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@uunet.uu.net.