dvadura@watdragon.waterloo.edu (Dennis Vadura) (06/30/91)
Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu> Posting-number: Volume 20, Issue 83 Archive-name: dmake/patch02h Patch-To: dmake: Volume 19, Issue 22-58 #!/bin/sh # this is dp2.07 (part 7 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" != 7; 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' && Xin the command line). It then sets the macro CMNDARGS to be the remainder Xof the line. X.B dmake Xthen expands the macro COMMAND which by default is set to X.RS X.sp XCOMMAND = $(CMNDNAME) $(CMNDARGS) X.sp X.RE XThe result of this final expansion is the command that will be executed. XThe reason for this expansion is to allow for a different interface to Xthe argument passing facilities (esp. under DOS) than that provided by X.B dmake\fR.\fP XYou can for example define COMMAND to be X.RS X.sp XCOMMAND = $(CMNDNAME) @$(mktmp $(CMNDARGS)) X.sp X.RE Xwhich dumps the arguments into a temporary file and runs the command X.RS X.sp X$(CMNDNAME) @/tmp/ASAD23043 X.sp X.RE Xwhich has a much shorter argument list. It is now up to the command to Xuse the supplied argument as the source for all other arguments. XAs an optimization, if COMMAND is not defined X.B dmake Xdoes not perform the above expansion. On systems, such as UNIX, that Xhandle long command lines this provides a slight saving in processing the Xmakefiles. X.SH "MAKING LIBRARIES" XLibraries are easy to maintain using \fBdmake\fP. A library is a file Xcontaining a collection of object files. XThus to make a library you simply specify it as a target with the .LIBRARY Xattribute set and specify its list of prerequisites. The prerequisites should Xbe the object members that are to go into the library. When X.B dmake Xmakes the library target it uses the .LIBRARY attribute to pass to the Xprerequisites the .LIBMEMBER attribute and the name of the library. This Xenables the file binding mechanism to look for the member in the library if an Xappropriate object file cannot be found. A small example best illustrates Xthis. X.RS X.nf X.sp Xmylib.a .LIBRARY : mem1.o mem2.o mem3.o X\trules for making library... X\t# remember to remove .o's when lib is made X.sp X# equivalent to: '%.o : %.c ; ...' X\&.c.o :; rules for making .o from .c say X.sp X.fi X.RE X.B dmake Xwill use the .c.o rule for making the library members if appropriate .c files Xcan be found using the search rules. NOTE: this is not specific in any way Xto C programs, they are simply used as an example. X.PP X.B dmake Xtries to handle the old library construct format in a sensible way. XThe construct X.I lib(member.o) Xis separated and the \fIlib\fP portion is declared Xas a library target. XThe new target is defined Xwith the .LIBRARY attribute set and the \fImember.o\fP portion of the Xconstruct is Xdeclared as a prerequisite of the lib target. XIf the construct \fIlib(member.o)\fP Xappears as a prerequisite of a target in the Xmakefile, that target has the new name of the lib assigned as its Xprerequisite. Thus the following example: X.RS X.sp X.nf Xa.out : ml.a(a.o) ml.a(b.o); $(CC) \-o $@ $< XX X\&.c.o :; $(CC) \-c $(CFLAGS) \-o $@ $< X%.a: X\tar rv $@ $< X\tranlib $@ X\trm \-rf $< X.sp X.fi X.RE Xconstructs the following dependency Xgraph. X.RS X.sp X.nf Xa.out : ml.a; $(CC) \-o $@ $< Xml.a .LIBRARY : a.o b.o XX X%.o : %.c ; $(CC) -c $(CFLAGS) \-o $@ $< X%.a : X\tar rv $@ $< X\tranlib $@ X\trm -rf $< X.sp X.fi X.RE Xand making a.out then works as expected. X.PP XThe same thing happens for any target of the form \fIlib((entry))\fP. XThese targets have an Xadditional feature in that the \fIentry\fP target has the .SYMBOL attribute Xset automatically. X.PP XNOTE: If the notion of entry points is supported by the archive and by X\fBdmake\fP (currently not the case) then X.B dmake Xwill search the archive for the entry point and return not only the Xmodification time of the member which defines the entry but also the name of Xthe member file. This name will then replace \fIentry\fP and will be used for Xmaking the member file. Once bound to an archive member the .SYMBOL Xattribute is removed from the target. XThis feature is presently disabled as there is little standardization Xamong archive formats, and we have yet to find a makefile utilizing this Xfeature (possibly due to the fact that it is unimplemented in most versions Xof UNIX Make). X.PP XFinally, when X.B dmake Xlooks for a library member it must first locate the library file. XIt does so by first looking for the library relative to the current directory Xand if it is not found it then looks relative to the current value of X$(TMD). This allows commonly used libraries to be kept near the root of Xa source tree and to be easily found by X.B dmake\fR.\fP X.SH "KEEP STATE" X.B dmake Xsupports the keeping of state information for targets that it makes whenever Xthe macro .KEEP_STATE is assigned a value. The value of the macro should be Xthe name of a state file that will contain the state information. If state Xkeeping is enabled then each target that does not poses the .NOSTATE Xattribute will have a record written into the state file indicating the Xtarget's name, the current directory, the command used to update the target, Xand which, if any, :: rule is being used. When you make this target again Xif any of this information does not match the previous settings and the Xtarget is not out dated it will still be re\-made. The assumption is that one Xof the conditions above has changed and that we wish to remake the target. XFor example, Xstate keeping is used in the maintenance of X.B dmake Xto test compile different versions of the source using different compilers. XChanging the compiler causes the compilation flags to be modified and hence Xall sources to be recompiled. X.PP XThe state file is an ascii file and is portable, however it is Xnot in human readable form as the entries represent hash keys of the above Xinformation. X.PP XThe Sun Microsystem's Make construct X.RS X.sp X\&.KEEP_STATE : X.sp X.RE Xis recognized and is mapped to \fB.KEEP_STATE:=_state.mk\fP. XThe X.B dmake Xversion of state keeping does not include scanning C source files for Xdependencies like Sun Make. This is specific to C programs and it was Xfelt that it does not belong in make. X.B dmake Xinstead provides the tool, \fBcdepend\fP, to scan C source files and to produce Xdepedency information. Users are free to modify cdepend to produce other Xdependency files. (NOTE: X.B cdepend Xdoes not come with the distribution at this time, but will be available in Xa patch in the near future) X.SH "MULTI PROCESSING" XIf the architecture supports it then \fBdmake\fP is capable of making a target's Xprerequisites in parallel. \fBdmake\fP will make as much in parallel as it Xcan and use a number of child processes up to the maximum specified by XMAXPROCESS or by the value supplied to the \-P command line flag. XA parallel make is enabled by setting the value of MAXPROCESS (either directly Xor via \-P option) to a value which is > 1. X\fBdmake\fP guarantees that all dependencies as specified in the makefile are Xhonored. A target will not be made until all of its prerequisites have been Xmade. XIf a parallel make is being performed then the following restrictions on Xparallelism are enforced. X.RS X.IP 1. XIndividual recipe lines in a non-group recipe are performed sequentially in Xthe order in which they are specified within the makefile and in parallel with Xthe recipes of other targets. X.IP 2. XIf a target contains multiple recipe definitions (cf. :: rules) then these are Xperformed sequentially in the order in which the :: rules are specified within Xthe makefile and in parallel with the recipes of other targets. X.IP 3. XIf a target rule contains the `!' modifier, then the recipe is performed Xsequentially for the list of outdated prerequisites and in parallel with the recipes of other targets. X.IP 4. XIf a target has the .SEQUENTIAL attribute set then all of its prerequisites Xare made sequentially relative to one another (as if MAXPROCESS=1), but in Xparallel with other targets in the makefile. X.RE X.PP XNote: If you specify a parallel make then Xthe order of target update and the order in which the associated recipes are Xinvoked will not correspond to that displayed by the \-n flag. X.SH "CONDITIONALS" X.B dmake Xsupports a makefile construct called a \fIconditional\fR. It allows Xthe user Xto conditionally select portions of makefile text for input processing Xand to discard other portions. This becomes useful for Xwriting makefiles that are intended to function for more than one target Xhost and environment. The conditional expression is specified as follows: X.sp X.RS X.nf X\&.IF \fIexpression\fR XX ... if text ... X\&.ELIF \fIexpression\fR XX ... if text ... X\&.ELSE XX ... else text ... X\&.END X.RE X.fi X.sp XThe .ELSE and .ELIF portions are optional, and the conditionals may be Xnested (ie. the text may contain another conditional). X\&.IF, .ELSE, and .END Xmay appear anywhere in the makefile, but a single conditional expression Xmay not span multiple makefiles. X.PP X\fIexpression\fR can be one of the following three forms: X.sp X\t<text> | <text> == <text> | <text> != <text> X.sp Xwhere \fItext\fR is either text or a macro expression. In any case, Xbefore the comparison is made, the expression is expanded. The text Xportions are then selected and compared. White space at the start and Xend of the text portion is discarded before the comparison. This means Xthat a macro that evaluates to nothing but white space is considered a XNULL value for the purpose of the comparison. XIn the first case the expression evaluates TRUE if the text is not NULL Xotherwise it evaluates FALSE. The remaining two cases both evaluate the Xexpression on the basis of a string comparison. XIf a macro expression needs to be equated to a NULL string then compare it to Xthe value of the macro $(NULL). XYou can use the $(shell ...) macro to construct more complex test expressions. X.SH "EXAMPLES" X.RS X.nf X.sp X# A simple example showing how to use make X# Xprgm : a.o b.o XX cc a.o b.o \-o prgm Xa.o : a.c g.h XX cc a.c \-o $@ Xb.o : b.c g.h XX cc b.c \-o $@ X.fi X.RE X.sp XIn the previous Xexample prgm is remade only if a.o and/or b.o is out of date with Xrespect to prgm. XThese dependencies can be stated more concisely Xby using the inference rules defined in the standard startup file. XThe default rule for making .o's from .c's looks something like this: X.sp X\&\t%.o : %.c; cc \-c $(CFLAGS) \-o $@ $< X.sp XSince there exists a rule (defined in the startup file) Xfor making .o's from .c's X\fBdmake\fR will use that rule Xfor manufacturing a .o from a .c and we can specify our dependencies Xmore concisely. X.sp X.RS X.nf Xprgm : a.o b.o XX cc \-o prgm $< Xa.o b.o : g.h X.fi X.RE X.sp XA more general way to say the above using the new macro expansions Xwould be: X.sp X.RS X.nf XSRC = a b XOBJ = {$(SRC)}.o X.sp Xprgm : $(OBJ) XX cc \-o $@ $< X.sp X$(OBJ) : g.h X.fi X.RE X.sp XIf we want to keep the objects in a separate directory, called Xobjdir, then we would write Xsomething like this. X.sp X.RS X.nf XSRC = a b XOBJ = {$(SRC)}.o X.sp Xprgm : $(OBJ) XX cc $< \-o $@ X.sp X$(OBJ) : g.h X\&%.o : %.c XX $(CC) \-c $(CFLAGS) \-o $(@:f) $< XX mv $(@:f) objdir XX X\&.SOURCE.o : objdir # tell make to look here for .o's X.fi X.RE X.sp XAn example of building library members would go something like this: X(NOTE: The same rules as above will be used to produce .o's from .c's) X.sp X.RS X.nf XSRC\t= a b XLIB\t= lib XLIBm\t= { $(SRC) }.o X.sp Xprgm: $(LIB) XX cc \-o $@ $(LIB) X.sp X$(LIB) .LIBRARY : $(LIBm) XX ar rv $@ $< XX rm $< X.fi X.RE X.sp XFinally, suppose that each of the source files in the previous example had Xthe `:' character in their target name. Then we would write the above example Xas: X.sp X.RS X.nf XSRC\t= f:a f:b XLIB\t= lib XLIBm\t= "{ $(SRC) }.o" # put quotes around each token X.sp Xprgm: $(LIB) XX cc \-o $@ $(LIB) X.sp X$(LIB) .LIBRARY : $(LIBm) XX ar rv $@ $< XX rm $< X.fi X.RE X.SH "COMPATIBILITY" XThere are two notable differences between X.B \fBdmake\fR Xand the standard version of BSD UNIX 4.2/4.3 Make. X.RS X.IP 1. .3i XBSD UNIX 4.2/4.3 Make supports wild card filename expansion for Xprerequisite names. Thus if a directory contains a.h, b.h and c.h, then a Xline like X.sp X\ttarget: *.h X.sp Xwill cause UNIX make to expand the *.h into "a.h b.h c.h". \fBdmake\fR Xdoes not support this type of filename expansion. X.IP 2. .3i XUnlike UNIX make, touching a library member causes \fBdmake\fR Xto search the library for the member name and to update the library time stamp. XThis is only implemented in the UNIX version. XMSDOS and other versions may not have librarians that keep file time stamps, Xas a result \fBdmake\fR touches the library file itself, and prints a warning. X.RE X.PP X\fBdmake\fP is not compatible with GNU Make. In particular it does not Xunderstand GNU Make's macro expansions that query the file system. X.PP X.B dmake Xis fully compatible with SYSV AUGMAKE, and supports the following AUGMAKE Xfeatures: X.RS X.IP 1. .3i XThe word \fBinclude\fP appearing at the start of a line can be used instead of Xthe ".INCLUDE :" construct understood by \fBdmake\fP. X.IP 2. .3i XThe macro modifier expression $(macro:str=sub) is understood and is equivalent Xto the expression $(macro:s/str/sub), with the restriction that str must match Xthe following regular expression: X.sp X\tstr[ |\et][ |\et]* X.sp X(ie. str only matches at the end of a token where str is a suffix and is Xterminated by a space, a tab, or end of line) X.IP 3. XThe macro % is defined to be $@ (ie. $% expands to the same value as $@). X.IP 4. XThe AUGMAKE notion of libraries is handled correctly. X.IP 5. XWhen defining special targets for the inference rules and the AUGMAKE special Xtarget handling is enabled then the special target X\&.X is equivalent to the %-rule "% : %.X". X.IP 6. XDirectories are always made if you specify \fB\-A\fP. This is consistent Xwith other UNIX versions of Make. X.IP 7. XMakefiles that utilize virtual targets to force making of other targets work Xas expected if AUGMAKE special target handling is enabled. For example: X.sp X.nf X\tFRC: X\tmyprog.o : myprog.c $(FRC) ; ... X.fi X.sp XWorks as expected if you issue the command X.sp X\t'\fBdmake\fP \-A FRC=FRC' X.sp Xbut fails with a 'don't know how to make FRC' Xerror message if you do not specify AUGMAKE special target handling via Xthe \-A flag (or by setting AUGMAKE:=yes internally). X.RE X.SH "LIMITS" XIn some environments the length of an argument string is restricted. X(e.g. MSDOS command line arguments cannot be longer than 128 bytes if you are Xusing the standard command.com command interpreter as your shell, X.B dmake Xtext diversions may help in these situations.) X.SH "PORTABILITY" XTo write makefiles that can be moved from one environment to another requires Xsome forethought. In particular you must define as macros all those things Xthat may be different in the new environment. X.B dmake Xhas two facilities that help to support writing portable makefiles, recursive Xmacros and conditional expressions. The recursive macros, allow one to define Xenvironment configurations that allow different environments for similar types Xof operating systems. For example the same make script can be used for SYSV and XBSD but with different macro definitions. X.PP XTo write a makefile that is portable between UNIX and MSDOS requires both Xfeatures since in almost all cases you will need to define new recipes for Xmaking targets. The recipes will probably be quite different since the Xcapabilities of the tools on each machine are different. Different Xmacros will be needed to help handle the smaller differences in the two Xenvironments. X.SH FILES XMakefile, makefile, startup.mk (use dmake \-V to tell you where the startup Xfile is) X.SH "SEE ALSO" Xsh(1), csh(1), touch(1), f77(1), pc(1), cc(1) X.br XS.I. Feldman \fIMake - A Program for Maintaining Computer Programs\fP X.SH "AUTHOR" XDennis Vadura, CS Dept. University of Waterloo. dvadura@watdragon.uwaterloo.ca X.br XMany thanks to Carl Seger for his helpful suggestions, Xand to Trevor John Thompson for his many excellent ideas and Xinformative bug reports. X.SH BUGS XSome system commands return non-zero status inappropriately. XUse X.B \-i X(`\-' within the makefile) to overcome the difficulty. X.PP XSome systems do not have easily accessible Xtime stamps for library members (MSDOS, AMIGA, etc) Xfor these \fBdmake\fR uses the time stamp of the library instead and prints Xa warning the first time it does so. This is almost always ok, except when Xmultiple makefiles update a single library file. In these instances it is Xpossible to miss an update if one is not careful. X.PP XThis man page is way too long. XSHAR_EOF Xchmod 0440 man/dmake.tf || Xecho 'restore of man/dmake.tf failed' XWc_c="`wc -c < 'man/dmake.tf'`" Xtest 98450 -eq "$Wc_c" || X echo 'man/dmake.tf: original size 98450, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/config.h ============== Xif test ! -d 'msdos'; then X echo 'x - creating directory msdos' X mkdir 'msdos' Xfi Xif test ! -d 'msdos/ztcdos'; then X echo 'x - creating directory msdos/ztcdos' X mkdir 'msdos/ztcdos' Xfi Xif test -f 'msdos/ztcdos/config.h' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/config.h (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/config.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/config.h' && X/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/ztcdos/RCS/config.h,v 1.1 91/06/24 11:42:19 dvadura Exp $ 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:42:19 dvadura XX * dmake release Version 3.7 XX * XX * Revision 1.2 91/05/14 07:35:52 dvadura XX * Somehow I lost the CONST declaration. XX * XX * Revision 1.1 91/05/06 15:25:49 dvadura XX * dmake Release Version 3.7 XX * X*/ XX X/* in sysintf.c: SIGQUIT is used, this is not defined in ZTC */ X#ifndef SIGQUIT X# define SIGQUIT SIGTERM X#endif XX X/* in sysintf.c: tzset is not supported by ZTC */ X#define tzset() XX X/* ZTC uses it's own swapping spawn. */ X#define spawnvpe(a,b,c,d) spawnvp(a,b,c) XX X#ifndef CONST X# define CONST const X#endif XX X#ifndef MSDOS X# define MSDOS 1 X#endif XX Xextern unsigned _psp; XSHAR_EOF Xchmod 0440 msdos/ztcdos/config.h || Xecho 'restore of msdos/ztcdos/config.h failed' XWc_c="`wc -c < 'msdos/ztcdos/config.h'`" Xtest 1976 -eq "$Wc_c" || X echo 'msdos/ztcdos/config.h: original size 1976, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/config.mk ============== Xif test -f 'msdos/ztcdos/config.mk' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/config.mk (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/config.mk (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/config.mk' && X# This is the ZTC DOS 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 XTMPDIR := X.EXPORT : TMPDIR XX X# Definition of macros for library, and C startup code. X# Swapping for DOS versions is enabled by default. ZTC will automatically X# perform swapping to XMS, EMS or disk by including _swapl.obj at link time. X# To be most effective, _swapl.obj should be the first file linked so we X# assign it to CSTARTUP if needed. X.IF $(SWAP) == y XX CSTARTUP = _swapl.obj X.END XX X# The following sources are required for ZTC X# The tempnam supplied with ZTC doesn't handle a NULL dir. XOSR_SRC = tempnam.c environ.c X.SETDIR=$(osrdir) : $(OSR_SRC) XX XSRC += $(OSR_SRC) X.SOURCE.h : $(osrdir) XX X# Local configuration modifications for CFLAGS X# If you have a 286, you can use -2 or appropriate to get better code, X# in that case uncomment the line below. (You can also simply set X# it in the CL environment variable.) X#CFLAGS += -2 XASFLAGS += -t -mx $(S_$(MODEL)) XX X# Redefine this, it isn't needed! XLDTAIL = ; XX X# Debugging libraries XDB_LDFLAGS += -g XDB_LDLIBS += XX X# NO Debug ZTC flags: X# XX XCFLAGS += -I$(osrdir) $(C_$(MODEL)) XCFLAGS += -DM_I86=1 -DMSDOS XCFLAGS += -b # use large compiler X#CFLAGS += -w # no warnings XCFLAGS += -mi # integer only XCFLAGS += -p # no auto-prototyping XNDB_CFLAGS += -o XDB_CFLAGS += -g XX X# Redefine rule for making our objects, we don't need mv X%$O : %.c ;% $(CC) -c $(CFLAGS) -o$@ $< 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 XX XC_s = XC_m = -mM XC_c = -mC XC_l = -mL XX XS_s = -Dmsmall XS_m = -Dmmedium XS_c = -Dmcompact XS_l = -Dmlarge XSHAR_EOF Xchmod 0640 msdos/ztcdos/config.mk || Xecho 'restore of msdos/ztcdos/config.mk failed' XWc_c="`wc -c < 'msdos/ztcdos/config.mk'`" Xtest 1990 -eq "$Wc_c" || X echo 'msdos/ztcdos/config.mk: original size 1990, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/environ.c ============== Xif test -f 'msdos/ztcdos/environ.c' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/environ.c (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/environ.c (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/environ.c' && X/*LINTLIBRARY*/ X#include <stdio.h> X#include <string.h> X#include <stdlib.h> X#include "alloc.h" XX X/* ZTC++ doesn't have environ, so we have to create one. */ XX Xextern char *_envptr; Xchar **environ = { NULL }; XX Xvoid Xmake_env() X{ XX int i; XX char *cp; XX XX for (i = 0, cp = _envptr; *cp; i++, cp += strlen(cp)+1) XX ; XX XX TALLOC(environ, i+1, char*); XX XX for (i = 0, cp = _envptr; *cp; i++, cp += strlen(cp)+1) XX environ[i] = cp; XX XX return; X} XX Xvoid Xfree_env() X{ XX FREE(environ); XX XX return; X} XSHAR_EOF Xchmod 0440 msdos/ztcdos/environ.c || Xecho 'restore of msdos/ztcdos/environ.c failed' XWc_c="`wc -c < 'msdos/ztcdos/environ.c'`" Xtest 473 -eq "$Wc_c" || X echo 'msdos/ztcdos/environ.c: original size 473, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/lib.rsp ============== Xif test -f 'msdos/ztcdos/lib.rsp' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/lib.rsp (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/lib.rsp (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/lib.rsp' && XX XSHAR_EOF Xchmod 0640 msdos/ztcdos/lib.rsp || Xecho 'restore of msdos/ztcdos/lib.rsp failed' XWc_c="`wc -c < 'msdos/ztcdos/lib.rsp'`" Xtest 1 -eq "$Wc_c" || X echo 'msdos/ztcdos/lib.rsp: original size 1, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/libswp.rsp ============== Xif test -f 'msdos/ztcdos/libswp.rsp' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/libswp.rsp (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/libswp.rsp (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/libswp.rsp' && XX XSHAR_EOF Xchmod 0640 msdos/ztcdos/libswp.rsp || Xecho 'restore of msdos/ztcdos/libswp.rsp failed' XWc_c="`wc -c < 'msdos/ztcdos/libswp.rsp'`" Xtest 1 -eq "$Wc_c" || X echo 'msdos/ztcdos/libswp.rsp: original size 1, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/mk.bat ============== Xif test -f 'msdos/ztcdos/mk.bat' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/mk.bat (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/mk.bat (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/mk.bat' && Xmd objects Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\infer.obj infer.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\make.obj make.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\stat.obj stat.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\expand.obj expand.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmstring.obj dmstring.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\hash.obj hash.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dag.obj dag.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmake.obj dmake.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\path.obj path.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\imacs.obj imacs.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\sysintf.obj sysintf.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\parse.obj parse.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\getinp.obj getinp.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\quit.obj quit.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\state.obj state.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\basename.obj basename.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmdump.obj dmdump.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\macparse.obj macparse.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rulparse.obj rulparse.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\percent.obj percent.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\function.obj function.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\ruletab.obj msdos\ruletab.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dirbrk.obj msdos\dirbrk.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\runargv.obj msdos\runargv.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\arlib.obj msdos\arlib.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\_chdir.obj msdos\_chdir.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\switchar.obj msdos\switchar.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rmprq.obj msdos\rmprq.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tee.obj msdos\tee.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tempnam.obj msdos\ztcdos\tempnam.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\environ.obj msdos\ztcdos\environ.c Xcopy msdos\ztcdos\startup.mk startup.mk Xblink @msdos\ztcdos\obj.rsp,dmake.exe,NUL.MAP; XSHAR_EOF Xchmod 0640 msdos/ztcdos/mk.bat || Xecho 'restore of msdos/ztcdos/mk.bat failed' XWc_c="`wc -c < 'msdos/ztcdos/mk.bat'`" Xtest 3232 -eq "$Wc_c" || X echo 'msdos/ztcdos/mk.bat: original size 3232, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/mkswp.bat ============== Xif test -f 'msdos/ztcdos/mkswp.bat' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/mkswp.bat (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/mkswp.bat (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/mkswp.bat' && Xmd objects Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\infer.obj infer.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\make.obj make.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\stat.obj stat.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\expand.obj expand.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmstring.obj dmstring.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\hash.obj hash.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dag.obj dag.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmake.obj dmake.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\path.obj path.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\imacs.obj imacs.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\sysintf.obj sysintf.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\parse.obj parse.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\getinp.obj getinp.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\quit.obj quit.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\state.obj state.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\basename.obj basename.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmdump.obj dmdump.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\macparse.obj macparse.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rulparse.obj rulparse.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\percent.obj percent.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\function.obj function.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\ruletab.obj msdos\ruletab.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dirbrk.obj msdos\dirbrk.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\runargv.obj msdos\runargv.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\arlib.obj msdos\arlib.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\_chdir.obj msdos\_chdir.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\switchar.obj msdos\switchar.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rmprq.obj msdos\rmprq.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tee.obj msdos\tee.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tempnam.obj msdos\ztcdos\tempnam.c Xztc -c -I. -Imsdos -Imsdos\ztcdos -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\environ.obj msdos\ztcdos\environ.c Xcopy msdos\ztcdos\startup.mk startup.mk Xblink @msdos\ztcdos\objswp.rsp,dmake.exe,NUL.MAP; XSHAR_EOF Xchmod 0640 msdos/ztcdos/mkswp.bat || Xecho 'restore of msdos/ztcdos/mkswp.bat failed' XWc_c="`wc -c < 'msdos/ztcdos/mkswp.bat'`" Xtest 3235 -eq "$Wc_c" || X echo 'msdos/ztcdos/mkswp.bat: original size 3235, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/obj.rsp ============== Xif test -f 'msdos/ztcdos/obj.rsp' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/obj.rsp (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/obj.rsp (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/obj.rsp' && Xobjects\infer.obj+ Xobjects\make.obj+ Xobjects\stat.obj+ Xobjects\expand.obj+ Xobjects\dmstring.obj+ Xobjects\hash.obj+ Xobjects\dag.obj+ Xobjects\dmake.obj+ Xobjects\path.obj+ Xobjects\imacs.obj+ Xobjects\sysintf.obj+ Xobjects\parse.obj+ Xobjects\getinp.obj+ Xobjects\quit.obj+ Xobjects\state.obj+ Xobjects\basename.obj+ Xobjects\dmdump.obj+ Xobjects\macparse.obj+ Xobjects\rulparse.obj+ Xobjects\percent.obj+ Xobjects\function.obj+ Xobjects\ruletab.obj+ Xobjects\dirbrk.obj+ Xobjects\runargv.obj+ Xobjects\arlib.obj+ Xobjects\_chdir.obj+ Xobjects\switchar.obj+ Xobjects\rmprq.obj+ Xobjects\tee.obj+ Xobjects\tempnam.obj+ Xobjects\environ.obj XSHAR_EOF Xchmod 0640 msdos/ztcdos/obj.rsp || Xecho 'restore of msdos/ztcdos/obj.rsp failed' XWc_c="`wc -c < 'msdos/ztcdos/obj.rsp'`" Xtest 614 -eq "$Wc_c" || X echo 'msdos/ztcdos/obj.rsp: original size 614, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/objswp.rsp ============== Xif test -f 'msdos/ztcdos/objswp.rsp' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/objswp.rsp (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/objswp.rsp (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/objswp.rsp' && X_swapl.obj+ Xobjects\infer.obj+ Xobjects\make.obj+ Xobjects\stat.obj+ Xobjects\expand.obj+ Xobjects\dmstring.obj+ Xobjects\hash.obj+ Xobjects\dag.obj+ Xobjects\dmake.obj+ Xobjects\path.obj+ Xobjects\imacs.obj+ Xobjects\sysintf.obj+ Xobjects\parse.obj+ Xobjects\getinp.obj+ Xobjects\quit.obj+ Xobjects\state.obj+ Xobjects\basename.obj+ Xobjects\dmdump.obj+ Xobjects\macparse.obj+ Xobjects\rulparse.obj+ Xobjects\percent.obj+ Xobjects\function.obj+ Xobjects\ruletab.obj+ Xobjects\dirbrk.obj+ Xobjects\runargv.obj+ Xobjects\arlib.obj+ Xobjects\_chdir.obj+ Xobjects\switchar.obj+ Xobjects\rmprq.obj+ Xobjects\tee.obj+ Xobjects\tempnam.obj+ Xobjects\environ.obj XSHAR_EOF Xchmod 0640 msdos/ztcdos/objswp.rsp || Xecho 'restore of msdos/ztcdos/objswp.rsp failed' XWc_c="`wc -c < 'msdos/ztcdos/objswp.rsp'`" Xtest 626 -eq "$Wc_c" || X echo 'msdos/ztcdos/objswp.rsp: original size 626, current size' "$Wc_c" Xfi X# ============= msdos/ztcdos/public.h ============== Xif test -f 'msdos/ztcdos/public.h' -a X"$1" != X"-c"; then X echo 'x - skipping msdos/ztcdos/public.h (File already exists)' Xelse Xecho 'x - extracting msdos/ztcdos/public.h (Text)' Xsed 's/^X//' << 'SHAR_EOF' > 'msdos/ztcdos/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(()); SHAR_EOF true || echo 'restore of dm37p2 failed' fi echo 'End of part 7' echo 'File dm37p2 is continued in part 8' echo 8 > _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.