Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!sparky!kent From: dvadura@watdragon.waterloo.edu (Dennis Vadura) Newsgroups: comp.sources.misc Subject: v19i033: dmake - dmake version 3.7, Part12/37 Message-ID: <1991May10.185918.22778@sparky.IMD.Sterling.COM> Date: 10 May 91 18:59:18 GMT Sender: kent@sparky.IMD.Sterling.COM (Kent Landfield) Organization: Sterling Software, IMD Lines: 1092 Approved: kent@sparky.imd.sterling.com X-Md4-Signature: 21a4a681155ca3b5c57f9879e10b2fc4 Submitted-by: Dennis Vadura Posting-number: Volume 19, Issue 33 Archive-name: dmake/part12 Supersedes: dmake-3.6: Volume 15, Issue 52-77 ---- Cut Here and feed the following to sh ---- #!/bin/sh # this is dmake.shar.12 (part 12 of a multipart archive) # do not concatenate these parts, unpack them in order with /bin/sh # file dmake/makefile.mk continued # if test ! -r _shar_seq_.tmp; then echo 'Please unpack part 1 first!' exit 1 fi (read Scheck if test "$Scheck" != 12; 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/makefile.mk' && # OSRELEASE - optionally gives the particular release of the OS above. # OSENVIRONMENT - optionally gives the environment under which the above # OS is in use. # # For valid values for the above macros consult the readme/* files or type # 'make' by itself to get a summary of what is available. X # First target in the makefile, do this so that targets declared in the # included files are never marked as being the first *default* target. first : all ; X #Enable keeping of state for future compiles .KEEP_STATE := _state.mk X # Pull in the configuration macros, from the environment. OS is required, # OSRELEASE, and OSENVIRONMENT are optional. .IF $(OS) == $(NULL) X .IMPORT : OS .END .IMPORT .IGNORE : OSRELEASE OSENVIRONMENT TMPDIR X # Define $(PUBLIC) _osenv := $(OSENVIRONMENT)$(DIRSEPSTR) _osre := $(OSRELEASE)$(DIRSEPSTR)$(!null,$(OSENVIRONMENT) $(_osenv)) ENVDIR = $(OS)$(DIRSEPSTR)$(!null,$(OSRELEASE) $(_osre)) PUBLIC = $(ENVDIR)public.h STARTUP := startup.mk X # Define the source files SRC =\ X infer.c make.c stat.c expand.c dmstring.c hash.c dag.c dmake.c\ X path.c imacs.c sysintf.c parse.c getinp.c quit.c state.c\ X basename.c dmdump.c macparse.c rulparse.c percent.c function.c X # Common Include files. HDR = dmake.h extern.h struct.h vextern.h patchlvl.h version.h X # Define the TARGET we are making, and where the OBJECT files go. OBJDIR := objects TARGET = dmake$E CFLAGS += -I. X # Meta rule for making .o's from .c's (give our own so we can move object # to objects directory in a portable, compiler independent way) # Define it before the .INCLUDE so that different OS combinations can redefine # it. %$O : %.c X %$(CC) -c $(CFLAGS) $< X mv $(@:f) $(OBJDIR) X # Pull in the proper configuration files, based on the value of OS. .INCLUDE : $(OS)/config.mk .INCLUDE : dbug/dbug.mk X # Set the .SOURCE targets so that we look for things in the right place. .SOURCE.c :^ .NULL .SOURCE.h :^ .NULL .SOURCE$O :^ $(OBJDIR) .PRECIOUS : $(HDR) X # Must come after the above INCLUDE so that it gets ALL objects. OBJECTS := {$(ASRC:b) $(SRC:b)}$O X # The main target, make sure the objects directory exists first. # LDARGS is defined in config.mk file of each OS/OSRELEASE combination. all : $(TARGET) $(STARTUP); $(TARGET) : $(OBJDIR) $(TARGET) : $(OBJECTS);$(LD) $(LDARGS) $(STARTUP) : $(ENVDIR)$(STARTUP); +$(eq,$(SHELL),$(COMSPEC) copy cp) $< $@ X # how to make public.h public .PHONY : $(PUBLIC); $(PUBLIC) .SHELL .NOSTATE: $(SRC); genpub -n DMAKE $< >$@ X # Other obvious targets... $(OBJDIR):;+-$(eq,$(SHELL),$(COMSPEC) md mkdir) $@ X # remaining dependencies should be automatically generated sysintf$O : $(OS)/sysintf.h ruletab$O : $(OS)/startup.h #khc 01NOV90 - dependency was missing $(OBJECTS) : $(HDR) X clean:;+- $(RM) -rf dmake$E dbdmake$E objects* $(STARTUP) X # Rules for making the manual pages. man .SETDIR=man : dmake.nc ; dmake.nc : dmake.p ; scriptfix < $< > $@ dmake.p : dmake.tf; typeset -man -Tdumb $< > $@ X #-------------------------------------------------------------------------- # Make the various archives for shipping the thing around. # archives : zoo tar shar; X zoo .PHONY : dmake.zoo ; shar .PHONY : dmake.shar; tar .PHONY : dmake.tar; X dmake.zoo : dir-copy [ X find dmake -type f -print | zoo aI $@ X $(RM) -rf src-list dmake ] X dmake.shar : dir-copy [ X find dmake -type f -print >src-list X xshar -vc -o$@ -L40 `cat src-list` X $(RM) -rf src-list dmake ] X dmake.tar : dir-copy [ X tar cf $@ dmake X $(RM) -rf src-list dmake ] X dir-copy .PHONY : src-list [ X echo 'tmp.tar .SILENT :$$(ALLSRC) ;tar -cf tmp.tar $$(ALLSRC)' >> $< X $(MAKECMD) -f $< tmp.tar X mkdir dmake X cd dmake X tar xf ../tmp.tar; chmod -R u+rw . X cd .. X /bin/rm -f tmp.tar ] X src-list : clean man X echo 'ALLSRC = \' >$@ X find . -type f -print |\ X sed -e 's/RCS\///' -e 's/,v//' -e 's/$$/\\/' -e 's/^\.\// /'|\ X sort -u |\ X grep -v tst | grep -v $@ | grep -v LICENSE | grep -v '*state*\.mk' |\ X grep -v '\.zoo' | grep -v '\.tar'| grep -v '\.shar' >> $@ X echo ' LICENSE' >> $@ X #-------------------------------------------------------------------------- # This section can be used to make the necessary script files so that dmake # can be bootstrapped. # # dmake scripts -- makes all the script files at once. # SH_n = $(@:s/swp-/-/:s,-,/,:s/scripts/${SCRIPTFILE}/) MS_n = MAKESTARTUP=$(@:s/swp-/-/:s,-,/,:s/scripts/startup.mk/) SH = $(SH_n:s/c40d/cd/:s/c50d/cd/:s/c51d/cd/:s/c60d/cd/) MS = $(MS_n:s/c40d/cd/:s/c50d/cd/:s/c51d/cd/:s/c60d/cd/) FIX-SH = $(SH:s,fix/,,) X scripts: unix-scripts atari-tos-scripts msdos-scripts os2-scripts X # To add a new environment for UNIX, simply create the appropriate entry # in the style below for the macro which contains the OS, OSRELEASE and # OSENVIRONMENT flags. Then add the entry as a recipe line for the target # unix-scripts. # unix-bsd43-scripts-flags = OS=unix OSRELEASE=bsd43 OSENVIRONMENT= unix-sysvr4-scripts-flags = OS=unix OSRELEASE=sysvr4 OSENVIRONMENT= unix-sysvr3-scripts-flags = OS=unix OSRELEASE=sysvr3 OSENVIRONMENT= unix-sysvr1-scripts-flags = OS=unix OSRELEASE=sysvr1 OSENVIRONMENT= unix-386ix-scripts-flags = OS=unix OSRELEASE=386ix OSENVIRONMENT= unix-bsd43-uw-scripts-flags= OS=unix OSRELEASE=bsd43 OSENVIRONMENT=uw unix-bsd43-vf-scripts-flags= OS=unix OSRELEASE=bsd43 OSENVIRONMENT=vf tos--scripts-flags = OS=tos OSRELEASE= OSENVIRONMENT= X unix-scripts .SWAP : clean X $(MAKE) SCRIPTFILE=make.sh unix-bsd43-scripts X $(MAKE) SCRIPTFILE=make.sh unix-bsd43-uw-scripts X $(MAKE) SCRIPTFILE=make.sh unix-bsd43-vf-scripts X $(MAKE) SCRIPTFILE=make.sh unix-sysvr4-scripts X $(MAKE) SCRIPTFILE=make.sh unix-sysvr3-scripts X $(MAKE) SCRIPTFILE=make.sh unix-sysvr1-scripts X $(MAKE) SCRIPTFILE=make.sh unix-386ix-scripts X unix-%-scripts .SWAP : X $(MAKECMD) -s $($@-flags) .KEEP_STATE:= public X $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH) X tos-%-scripts .SWAP : X $(MAKECMD) -s $($@-flags) .KEEP_STATE:= public X $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH) X atari-tos-scripts .SWAP : clean X $(MAKE) SCRIPTFILE=make.sh tos--scripts X # We make the standard dos scripts here, but we have to go and fix up the # mkXX.bat file since it contains names of temporary files for the response # files required by the linker. We need to also construct the response file # contents. These two functions are performed by the fix-msdos-%-scripts # meta-target. # # To add a new DOS environment just do what is described for adding a new # unix environment, and then make certain that the fix-msdos-%-scripts target # performs the correct function for the new environment. msdos-cf = OS=msdos OSENVIRONMENT= msdos-tccdos-scripts-flags = $(msdos-cf) OSRELEASE=tccdos SWAP=n msdos-tccdosswp-scripts-flags = $(msdos-cf) OSRELEASE=tccdos msdos-bccdos-scripts-flags = $(msdos-cf) OSRELEASE=bccdos SWAP=n msdos-bccdosswp-scripts-flags = $(msdos-cf) OSRELEASE=bccdos msdos-msc40dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=4.0 msdos-msc40dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=4.0 msdos-msc50dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.0 msdos-msc50dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=5.0 msdos-msc51dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.1 msdos-msc51dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=5.1 msdos-msc60dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=6.0 msdos-msc60dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=6.0 X msdos-scripts: clean msdos-tcc-scripts msdos-bcc-scripts msdos-msc-scripts; X msdos-tcc-scripts .SWAP : X $(MAKE) SCRIPTFILE=mk.bat msdos-tccdos-scripts X $(MAKE) SCRIPTFILE=mkswp.bat msdos-tccdosswp-scripts X msdos-bcc-scripts .SWAP : X $(MAKE) SCRIPTFILE=mk.bat msdos-bccdos-scripts X $(MAKE) SCRIPTFILE=mkswp.bat msdos-bccdosswp-scripts X msdos-msc-scripts .SWAP :! 40 50 51 60 X $(MAKE) SCRIPTFILE=mk$?.bat msdos-msc$?dos-scripts X $(MAKE) SCRIPTFILE=mk$?swp.bat msdos-msc$?dosswp-scripts X msdos-%-scripts .SWAP .SILENT: X $(MAKE) -s $($@-flags) .KEEP_STATE:= public X $(MAKE) -ns SHELL=command.com COMSPEC=command.com .KEEP_STATE:= $(MS) $($@-flags) >$(SH) X $(MAKE) -s $(MAKEMACROS) $(MS) $($@-flags) fix-msdos-$*-scripts X X # We make the standard OS/2 scripts here, but we have to go and fix up the # mkXX.bat file since it contains names of temporary files for the response # files required by the linker. We need to also construct the response file # contents. These two functions are performed by the fix-msdos-%-scripts # meta-target. # # To add a new OS/2 environment just do what is described for adding a new # unix environment, and then make certain that the fix-msdos-%-scripts target # performs the correct function for the new environment. os2-cf = OS=os2 OSENVIRONMENT= os2-msc40dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=4.0 os2-msc50dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.0 os2-msc51dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.1 os2-msc60dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=6.0 X os2-scripts: clean os2-msc-scripts; X os2-msc-scripts .SWAP :! 40 50 51 60 X $(MAKE) SCRIPTFILE=mk$?.cmd os2-msc$?dos-scripts X os2-%-scripts .SWAP : X $(MAKE) -s $($@-flags) .KEEP_STATE:= public X $(MAKE) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH) X $(MAKE) -s $(MAKEMACROS) $(MS) $($@-flags) fix-os2-$*-scripts X # Signify NULL targets for the various MSC compiler versions. 40 50 51 60:; X # Go over the created script file and make sure all the '/' that are in # filenames are '\', and make sure the final link command line looks # reasonable. MAPOBJ = obj$(SWAP:s/y/swp/:s/n//).rsp MAPLIB = lib$(SWAP:s/y/swp/:s/n//).rsp OBJRSP = $(SH:s,fix/,,:s,${SCRIPTFILE},${MAPOBJ},) LIBRSP = $(SH:s,fix/,,:s,${SCRIPTFILE},${MAPLIB},) DOSOBJ = $(CSTARTUP) $(OBJDIR)/{$(OBJECTS)} fix-%-scripts: X tail -r $(FIX-SH) >tmp-sh-r X tail +2 tmp-sh-r | sed -e 's,/,\\,g' >tmp-out X tail -r tmp-out >$(FIX-SH) X head -1 tmp-sh-r |\ X sed -e 's,\\tmp\\mkA..[0-9]*,$(OBJRSP),'\ X -e 's,\\tmp\\mkB..[0-9]*,$(LIBRSP),' |\ X sed -e 's,$(OS)/,$(OS)\\,g'\ X -e 's,$(OS)/$(OSRELEASE)/,$(OS)\\$(OSRELEASE)\\,g'\ X -e 's,$(OS)\\$(OSRELEASE)/,$(OS)\\$(OSRELEASE)\\,g'\ X -e 's,$(OS)/$(OSRELEASE)\\,$(OS)\\$(OSRELEASE)\\,g' >>$(FIX-SH) X rm -f tmp-sh-r tmp-out X mv <+$(DOSOBJ:s,/,\\,:t"+\n")\n+> $(OBJRSP) X mv <+$(LDLIBS:s,/,\\,:t"+\n")\n+> $(LIBRSP) SHAR_EOF chmod 0640 dmake/makefile.mk || echo 'restore of dmake/makefile.mk failed' Wc_c="`wc -c < 'dmake/makefile.mk'`" test 10539 -eq "$Wc_c" || echo 'dmake/makefile.mk: original size 10539, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi # ============= dmake/makefile ============== if test -f 'dmake/makefile' -a X"$1" != X"-c"; then echo 'x - skipping dmake/makefile (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp sed 's/^X//' << 'SHAR_EOF' > 'dmake/makefile' && # Default makefile for the various versions of dmake that we # have available. This is a bootstrap version and uses /bin/sh to # execute a script which compiles dmake. # # Note the DOS commands actually invoke command.com to run the .bat file # to make the script. X all: X @echo "INDEX: You must issue one of:" X @echo " make bsd43 - Generic BSD 4.3 System" X @echo " make bsd43uw - Generic BSD 4.3 at U of Waterloo" X @echo " make bsd43vf - Generic BSD 4.3 that needs vfprintf" X @echo " make sysvr4 - Generic SysV R4 UNIX System" X @echo " make sysvr3 - Generic SysV R3 UNIX System" X @echo " make sysvr1 - Generic SysV R1 UNIX System" X @echo " make dynix - Sequent DYNIX System" X @echo " make ultrix - Ultrix 3.0 System" X @echo " make mips - Any MIPS System" X @echo " make 386ix - 386/ix (SysV R3) System" X @echo " make xenix - 386 Xenix System" X @echo " make aix - IBM RS6000/AIX System" X @echo " make os2msc40 - OS/2 using MSC 4.0 compiler" X @echo " make os2msc50 - OS/2 using MSC 5.0 compiler" X @echo " make os2msc51 - OS/2 using MSC 5.1 compiler" X @echo " make os2msc60 - OS/2 using MSC 6.0 compiler" X @echo " make tos - Atari-ST TOS using GCC as compiler" X @echo " make tcc - DOS with Turbo C 2.0" X @echo " make bcc - DOS with Borland C++ 2.0" X @echo " make tccswp - swapping DOS version with Turbo C 2.0" X @echo " make bccswp - swapping DOS version with Borland C++ 2.0" X @echo " make msc40 - DOS with MSC 4.0" X @echo " make msc50 - DOS with MSC 5.0" X @echo " make msc51 - DOS with MSC 5.1" X @echo " make msc60 - DOS with MSC 6.0" X @echo " make msc40swp - swapping DOS version with MSC 4.0" X @echo " make msc50swp - swapping DOS version with MSC 5.0" X @echo " make msc51swp - swapping DOS version with MSC 5.1" X @echo " make msc60swp - swapping DOS version with MSC 6.0" X bsd43uw :; /bin/sh -x < unix/bsd43/uw/make.sh bsd43vf dynix mips :; /bin/sh -x < unix/bsd43/vf/make.sh sysvr1 sysvr3 sysvr4 bsd43 386ix :; /bin/sh -x < unix/$@/make.sh ultrix xenix aix: sysvr3; tos :; sh -x tos/make.sh X # Various OS/2 targets. OS2_VER = os2msc40 os2msc50 os2msc51 os2msc60 $(OS2_VER) :; make.cmd $(@:s/os2//) X # DOS with some form of make and sh # Note if you do not have a 'make and/or sh' program under MSDOS then # typing 'make' in the dmake distribution directory will invoke the make.bat # batch file which will issue the appropriate instructions. DOS_VER = tcc msc40 msc50 msc51 msc60 \ X tccswp msc40swp msc50swp msc51swp msc60swp \ X bcc \ X bccswp $(DOS_VER) :; make.bat $@ SHAR_EOF chmod 0640 dmake/makefile || echo 'restore of dmake/makefile failed' Wc_c="`wc -c < 'dmake/makefile'`" test 2763 -eq "$Wc_c" || echo 'dmake/makefile: original size 2763, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi # ============= dmake/man/dmake.nc ============== if test ! -d 'dmake/man'; then mkdir 'dmake/man' fi if test -f 'dmake/man/dmake.nc' -a X"$1" != X"-c"; then echo 'x - skipping dmake/man/dmake.nc (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp sed 's/^X//' << 'SHAR_EOF' > 'dmake/man/dmake.nc' && X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X NAME X dmake - maintain program groups, or interdependent files X SYNOPSIS X dmake [-AceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|C|K} X file] [macro[*][+][:]=value ...] [target ...] X DESCRIPTION X dmake executes commands found in an external file called a X makefile to update one or more target names. Each target X may depend on zero or more prerequisite targets. If any of X the target's prerequisites is newer than the target or if X the target itself does not exist, then dmake will attempt to X make the target. X X If no -f command line option is present then dmake searches X for an existing makefile from the list of prerequisites X specified for the special target .MAKEFILES (see the STARTUP X section for more details). If "-" is the name of the file X specified to the -f flag then dmake uses standard input as X the source of the makefile text. X X Any macro definitions (arguments with embedded "=" signs) X that appear on the command line are processed first and X supersede definitions for macros of the same name found X within the makefile. In general it is impossible for defin- X itions found inside the makefile to redefine a macro defined X on the command line, see the MACROS section for an excep- X tion. X X If no target names are specified on the command line, then X dmake uses the first non-special target found in the X makefile as the default target. See the SPECIAL TARGETS X section for the list of special targets and their function. X dmake is a re-implementation of the UNIX Make utility with X significant enhancements. Makefiles written for most previ- X ous versions of Make will be handled correctly by dmake. X Known differences between dmake and other versions of make X are discussed in the COMPATIBILITY section found at the end X of this document. X OPTIONS X -A Enable AUGMAKE special inference rule transformations X (see the "PERCENT(%) RULES" section), these are set to X off by default. X X -c Use non-standard comment stripping. If you specify -c X then dmake will treat any # character as a start of X comment character wherever it may appear unless it is X escaped by a \. X X X X X Version 3.70 UW 1 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X -C [+]file X This option writes to file a copy of standard output X and standard error from any child processes and from X the dmake process itself. If you specify a + prior to X the file name then the text is appended to the previous X contents of file. This option is active in the MSDOS X implementation only and is ignored by non-MSDOS ver- X sions of dmake. X X -e Read the environment and define all strings of the form X 'ENV-VAR=evalue' defined within as macros whose name is X ENV-VAR, and whose value is 'evalue'. The environment X is processed prior to processing the user specified X makefile thereby allowing definitions in the makefile X to override definitions in the environment. X X -E Same as -e, except that the environment is processed X after the user specified makefile has been processed X (thus definitions in the environment override defini- X tions in the makefile). The -e and -E options are X mutually exclusive. If both are given the latter takes X effect. X X -f file X Use file as the source for the makefile text. Only one X -f option is allowed. X X -h Print the command summary for dmake. X X -i Tells dmake to ignore errors, and continue making other X targets. This is equivalent to the .IGNORE attribute X or macro. X X -K file X Turns on .KEEP_STATE state tracking and tells dmake to X use file as the state file. X X -k Causes dmake to ignore errors caused by command execu- X tion and to make all targets not depending on targets X that could not be made. Ordinarily dmake stops after a X command returns a non-zero status, specifying -k causes X dmake to ignore the error and continue to make as much X as possible. X X -n Causes dmake to print out what it would have executed, X but does not actually execute the commands. A special X check is made for the string "$(MAKE)" inside a recipe X line, if found, the line is expanded and invoked, X thereby enabling recursive makes to give a full X description of all that they will do. The check for X "$(MAKE)" is disabled inside group recipes. X X X X Version 3.70 UW 2 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X -p Print out a version of the digested makefile in human X readable form. (useful for debugging, but cannot be X re-read by dmake) X X -P# On systems that support multi-processing cause dmake to X use # concurrent child processes to make targets. See X the "MULTI PROCESSING" section for more information. X X -q Check and see if the target is up to date. Exits with X code 0 if up to date, 1 otherwise. X X -r Tells dmake not to read the initial startup makefile, X see STARTUP section for more details. X X -s Tells dmake to do all its work silently and not echo X the commands it is executing to stdout (also suppresses X warnings). This is equivalent to the .SILENT attri- X bute or macro. X X -S Force sequential execution of recipes on architectures X which support concurrent makes. For backward compati- X bility with old makefiles that have nasty side-effect X prerequisite dependencies. X X -t Causes dmake to touch the targets and bring them up to X date without executing any commands. X X -T Tells dmake to not perform transitive closure on the X inference graph. X X -u Force an unconditional update. (ie. do everything that X would be done if everything that a target depended on X was out of date) X X -v[dfimt] X Verbose flag, when making targets print to stdout what X we are going to make and what we think its time stamp X is. The optional flags [dfimt] can be used to restrict X the information that is displayed. In the absence of X any optional flags all are assumed to be given (ie. -v X is equivalent to -vdfimt). The meanings of the X optional flags are: X X d Notify of change directory operations only. X X f Notify of file I/O operations only. X X i Notify of inference algorithm operation only. X X m Notify of target update operations only. X X X X X Version 3.70 UW 3 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X t Keep any temporary files created; normally they X are automatically deleted. X X -V Print the version of dmake, and values of builtin mac- X ros. X X -x Upon processing the user makefile export all non- X internally defined macros to the user's environment. X This option together with the -e option allows SYSV X AUGMAKE recursive makes to function as expected. X INDEX X Here is a list of the sections that follow and a short X description of each. Perhaps you won't have to read the X whole man page to find what you need. X X STARTUP Describes dmake initialization. X X SYNTAX Describes the syntax of makefile expres- X sions. X X ATTRIBUTES Describes the notion of attributes and X how they are used when making targets. X X MACROS Defining and expanding macros. X X RULES AND TARGETS How to define targets and their prere- X quisites. X X RECIPES How to tell dmake how to make a target. X X TEXT DIVERSIONS How to use text diversions in recipes and X macro expansions. X X SPECIAL TARGETS Some targets are special. X X SPECIAL MACROS Macros used by dmake to alter the pro- X cessing of the makefile, and those X defined by dmake for the user. X X CONTROL MACROS Itemized list of special control macros. X X RUN-TIME MACROS Discussion of special run-time macros X such as $@ and $<. X X FUNCTION MACROS GNU style function macros, only $(mktmp X ...) for now. X X DYNAMIC PREREQUISITES X Processing of prerequisites which contain X macro expansions in their name. X X X X Version 3.70 UW 4 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X BINDING TARGETS The rules that dmake uses to bind a tar- X get to an existing file in the file sys- X tem. X X PERCENT(%) RULES Specification of recipes to be used by X the inference algorithm. X X MAKING INFERENCES The rules that dmake uses when inferring X how to make a target which has no expli- X cit recipe. This and the previous sec- X tion are really a single section in the X text. X X MAKING TARGETS How dmake makes targets other than X libraries. X X MAKING LIBRARIES How dmake makes libraries. X X KEEP STATE A discussion of how .KEEP_STATE works. X X MULTI PROCESSING Discussion of dmake's parallel make X facilities for architectures that support X them. X X CONDITIONALS Conditional expressions which control the X processing of the makefile. X X EXAMPLES Some hopefully useful examples. X X COMPATIBILITY How dmake compares with previous versions X of make. X X LIMITS Limitations of dmake. X X PORTABILITY Comments on writing portable makefiles. X X FILES Files used by dmake. X X SEE ALSO Other related programs, and man pages. X X AUTHOR The guy responsible for this thing. X X BUGS Hope not. X STARTUP X When dmake begins execution it first processes the command X line and then processes an initial startup-makefile. This X is followed by an attempt to locate and process a user sup- X plied makefile. The startup file defines the default values X of all required control macros and the set of default rules X for making targets and inferences. When searching for the X startup makefile, dmake searches the following locations, in X X X Version 3.70 UW 5 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X the order specified, until a startup file is located: X X 1. The location given as the value of the macro MAK- X ESTARTUP defined on the command line. X X 2. The location given as the value of the environment X variable MAKESTARTUP defined in the current X environment. X X 3. The location given as the value of the macro MAK- X ESTARTUP defined internally within dmake. X X The above search is disabled by specifying the -r option on X the command line. An error is issued if a startup makefile X cannot be found and the -r option was not specified. A user X may substitute a custom startup file by defining the MAKES- X TARTUP environment variable or by redefining the MAKESTARTUP X macro on the command line. To determine where dmake looks X for the default startup file, check your environment or X issue the command "dmake -V". X X A similar search is performed to locate a default user X makefile when no -f command line option is specified. By X default, the prerequisite list of the special target X .MAKEFILES specifies the names of possible makefiles and the X search order that dmake should use to determine if one X exists. A typical definition for this target is: X X .MAKEFILES : makefile.mk Makefile makefile X X dmake will first look for makefile.mk and then the others. X If a prerequisite cannot be found dmake will try to make it X before going on to the next prerequisite. For example, X makefile.mk can be checked out of an RCS file if the proper X rules for doing so are defined in the startup file. X SYNTAX X This section is a summary of the syntax of makefile state- X ments. The description is given in a style similar to BNF, X where { } enclose items that may appear zero or more times, X and [ ] enclose items that are optional. Alternative pro- X ductions for a left hand side are indicated by '->', and X newlines are significant. All symbols in bold type are text X or names representing text supplied by the user. X X X X Makefile -> { Statement } X X Statement -> Macro-Definition X -> Conditional X -> Rule-Definition X X X Version 3.70 UW 6 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X -> Attribute-Definition X X Macro-Definition -> MACRO = LINE X -> MACRO *= LINE X -> MACRO := LINE X -> MACRO *:= LINE X -> MACRO += LINE X -> MACRO +:= LINE X X Conditional -> .IF expression X Makefile X [ .ELIF expression X Makefile ] X [ .ELSE X Makefile ] X .END X X expression -> LINE X -> STRING == LINE X -> STRING != LINE X X X Rule-Definition -> target-definition X [ recipe ] X X target-definition -> targets [attrs] op { PREREQUISITE } [; rcp-line] X X targets -> target { targets } X -> "target" { targets } X X target -> special-target X -> TARGET X X attrs -> attribute { attrs } X -> "attribute" { attrs } X X op -> : { modifier } X X modifier -> : X -> ^ X -> ! X -> - X X recipe -> { TAB rcp-line } X -> [@][%][-] [ X { LINE } X ] X X rcp-line -> [@][%][-][+] LINE X X X X X X Version 3.70 UW 7 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X Attribute-Definition -> attrs : targets X X X attribute -> .EPILOG X -> .IGNORE X -> .LIBRARY X -> .MKSARGS X -> .NOINFER X -> .NOSTATE X -> .PHONY X -> .PRECIOUS X -> .PROLOG X -> .SETDIR=path X -> .SILENT X -> .SEQUENTIAL X -> .SWAP X -> .USESHELL X -> .SYMBOL X -> .UPDATEALL X X special-target -> .ERROR X -> .EXPORT X -> .GROUPEPILOG X -> .GROUPPROLOG X -> .IMPORT X -> .INCLUDE X -> .INCLUDEDIRS X -> .MAKEFILES X -> .REMOVE X -> .SOURCE X -> .SOURCE.suffix X -> .suffix1.suffix2 X X X Where, TAB represents a character, STRING represents X an arbitrary sequence of characters, and LINE represents a X possibly empty sequence of characters terminated by a non- X escaped (not immediately preceded by a backslash '\') new- X line character. MACRO, PREREQUISITE, and TARGET each X represent a string of characters not including space or tab X which respectively form the name of a macro, prerequisite or X target. The name may itself be a macro expansion expres- X sion. A LINE can be continued over several physical lines X by terminating it with a single backslash character. Com- X ments are initiated by the pound # character and extend to X the end of line. All comment text is discarded, a '#' may X be placed into the makefile text by escaping it with '\' X (ie. \# translates to # when it is parsed). An exception to X this occurs when a # is seen inside a recipe line that X begins with a or is inside a group recipe. If you X specify the -c command line switch then this behavior is X disabled and dmake will treat all # characters as start of X X X Version 3.70 UW 8 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X comment indicators unless they are escaped by \. A set of X continued lines may be commented out by placing a single # X at the start of the first line. A continued line cannot X span more than one makefile. X X white space is defined to be any combination of , X , and the sequence \ when \ is used to ter- X minate a LINE. When processing macro definition lines, any X amount of white space is allowed on either side of the macro X operator (=, *=, :=, *:=, += or +:=), and white space is X stripped from both before and after the macro value string. X The sequence \ is treated as white space during recipe X expansion and is deleted from the final recipe string. You X must escape the \ with another \ in order to get a \ at X the end of a recipe line. The \ sequence is deleted X from macro values when they are expanded. X X When processing target definition lines, the recipe for a X target must, in general, follow the first definition of the X target (See the RULES AND TARGETS section for an exception), X and the recipe may not span across multiple makefiles. Any X targets and prerequisites found on a target definition line X are taken to be white space separated tokens. The rule X operator (op in SYNTAX section) is also considered to be a X token but does not require white space to precede or follow X it. Since the rule operator begins with a `:', traditional X versions of make do not allow the `:' character to form a X valid target name. dmake allows `:' to be present in X target/prerequisite names as long as the entire X target/prerequisite name is quoted. For example: X X a:fred : test X X would be parsed as TARGET = a, PREREQUISITES={fred, :, X test}, which is not what was intended. To fix this you must X write: X X "a:fred" : test X X Which will be parsed as expected. See the EXAMPLES section X for how to apply " quoting to a list of targets. X ATTRIBUTES X dmake defines several target attributes. Attributes may be X assigned to a single target, a group of targets, or to all X targets in the makefile. Attributes are used to modify X dmake actions during target update. The recognized attri- X butes are: X X X .EPILOG Insert shell epilog code when executing a group X recipe associated with any target having this X X X Version 3.70 UW 9 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X attribute set. X X .IGNORE Ignore an error when trying to make any target X with this attribute set. X X .LIBRARY Target is a library. X X .MKSARGS If running in an MSDOS environment then use MKS X extended argument passing conventions to pass X arguments to commands. Non-MSDOS environments X ignore this attribute. X X .NOINFER Any target with this attribute set will not be X subjected to transitive closure if it is X inferred as a prerequisite of a target whose X recipe and prerequisites are being inferred. X (i.e. the inference algorithm will not use any X prerequisite with this attribute set, as a tar- X get) If specified as '.NOINFER:' (ie. with no X prerequisites or targets) then the effect is X equivalent to specifying -T on the command line. X X .NOSTATE Any target with this attribute set will not have X command line flag information stored in the X state file if .KEEP_STATE has been enabled. X X .PHONY Any target with this attribute set will have its X recipe executed each time the target is made X even if a file matching the target name can be X located. Any targets that have a .PHONY attri- X buted target as a prerequisite will be made each X time the .PHONY attributed prerequisite is made. X X .PRECIOUS Do not remove associated target under any cir- X cumstances. Set by default for any targets X whose corresponding files exist in the file sys- X tem prior to the execution of dmake. X X .PROLOG Insert shell prolog code when executing a group X recipe associated with any target having this X attribute set. X X .SEQUENTIAL Force a sequential make of the associated X target's prerequisites. X X .SETDIR Change current working directory to specified X directory when making the associated target. X You must specify the directory at the time the X attribute is specified. To do this simply give X .SETDIR=path as the attribute. path is expanded X and the result is used as the value of the X directory to change to. If path is surrounded X X X Version 3.70 UW 10 X X X X DMAKE(p) Unsupported Free Software DMAKE(p) X X X X by single quotes then path is not expanded, and X is used literally as the directory name. If the X path contains any `:' characters then the entire X attribute string must be quoted using ". If a X target having this attribute set also has the X .IGNORE attribute set then if the change to the X specified directory fails it will be ignored, X and no error message will be issued. X X .SILENT Do not echo the recipe lines when making any X target with this attribute set, and do not issue X any warnings. X X .SWAP Under MSDOS when making a target with this X attribute set swap the dmake executable to disk X prior to executing the recipe line. Also see X the '%' recipe line flag defined in the RECIPES X section. X X .SYMBOL Target is a library member and is an entry point X into a module in the library. This attribute is X used only when searching a library for a target. X Targets of the form lib((entry)) have this X attribute set automatically. X X .USESHELL Force each recipe line of a target to be exe- X cuted using a shell. Specifying this attribute X is equivalent to specifying the '+' character at X the start of each line of a non-group recipe. X X .UPDATEALL Indicates that all the targets listed in this X rule are updated by the execution of the accom- X panying recipe. A common example is the produc- X tion of the y.tab.c and y.tab.h files by yacc X when it is run on a grammar. Specifying X .UPDATEALL in such a rule prevents the running X of yacc twice, once for the y.tab.c file and SHAR_EOF true || echo 'restore of dmake/man/dmake.nc failed' fi echo 'End of part 12, continue with part 13' echo 13 > _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.