Dec 232017
 
A great programmer's MAKE utility.
File MAKE4.ZIP from The Programmer’s Corner in
Category Miscellaneous Language Source Code
A great programmer’s MAKE utility.
File Name File Size Zip Size Zip Type
MAKE4.DOC 7936 3544 deflated
MAKE4.EXE 33834 14230 deflated

Download File MAKE4.ZIP Here

Contents of the MAKE4.DOC file


MAKE4.EXE -- Lloyd Zusman, Master Byte Software, 7/14/84
(Voice line: 408-395-5693)

MAKE4 is an improved version of MAKE. It CAN execute "internal"
DOS commands such as DIR and CD, as well as the "external" commands
as described below. The rest of the documentation is up to date.

********************************************************************* */



/*
This a called 'Make'and is a much simplified version of
the make utility on UNIX (a trademarkor something ofAT&T)
written using the Lattice C compiler
for the IBM PersonalComputer. The Lattice package is
available from Lifeboat Assoc. 1651 Third Avenue
New York, NY 10128 .

'Make' takesa fileof dependencies (a 'makefile') and
decides whatcommands have to be executed tobring the files
up todate. These commands are either executed directly from
'Make' or written tothe standard output without executing
them.

'Makefile' format:
- There mustbe a 'makefile'; you can't take inputfrom the
standard input.
- Thedefaultname ofthe 'makefile' is 'MAKEFILE' on the
default disk. Different 'makefiles'can be specified using
the '-f' option on the command line. If the '-f' option is
used,the default 'makefile' is not processed.
- Anyblank lines in the 'makefile(s)' are ignored.
- A line in a'makefile' thatstarts with a tab character is
a 'howto' line and consists of a command name followed by
arguments. The command name must be a filename, e.g.
'cc'. When commandsare executed, the PATH environment
variable is used to find the command,in (hopefully) the
same manner as DOS does. 'Howto' lines apply to themost
recently preceding 'dependency' line. It isan error for
a 'howto' line to precede the first 'dependency' line.
- Anyother non-blankline isa 'dependency'line. 'Dependency'
linesconsistof a filename followed by a (possibly empty) list
of dependent filenames.

Operation:
Syntax:
make [filename] [-f makefilename] [-i] [-n]
-i means continue even if anerror is encountered while
executing acommand.
-n means don't execute the commands, just write the ones that
should be executed to the standardoutput. This is useful
forcreating batch files, for example.
-f specifies that thefollowing argument is the name of a makefile
to be usedinsteadof thedefault(MAKEFILE).
All argumentsmay be repeatedand relative position of the
arguments is not important. If multiple definitionsof a file
are found, only the first one is significant.

First, 'Make' reads all of the makefiles.It thenproceeds through
all of the filename arguments, 'making' each one in turn.A file
is remade if it is out of date with respect to the files it depends
on oris non-existent. Dependencies are processed ina 'tree' fashion,
so that the lowest-order files are remade first.

'Make' cannot execute DOS built-in commands e.g. 'cd' or 'dir'.
'Make' uses the first 20k or so after the residentportionof DOS.
all definitions and howto's are stored in dynamicallyallocated struct's.
Any executed commands are loaded above'Make'in memory.

'Make' REQUIRES DOS2.0 (or higher?).


The code is alittle kludgy in places.

No guaranteesor warranties of any kind: I think itworks and
I useit.

Any suggestions for improvements gratefully accepted.

I believe that commercial versions exist. Ialso beleive that they
wouldbe superior to this.

version2.0 comments:
This program was converted toLattice'C' ver2.11 on15 jun 84.
This allowed the use of the lattice 'fork' command. The command
will automatically search thepath name specified to find the
desired executable image. This also allows the use ofimage names
with out the extension. ie 'lc1' instead of 'lc1.exe'. All of
the assemblerroutines have been replaced with lattice dos calls.

The Lattice version uses about 55k bytes lessmemory than the
Desmet version. This is nice for the systems with already tight
memory requirements.
version3 comments:
The default makefile name is MAKEFILEnot MAKEFILE.DAT.
Therenow is a symbolprocessor to dosubstitiutions
in the argument line.
A symbol definition MUST begin with a$.
An example follows.
Fixeda bug-If a dependent file did not existthen make didn't
work correctly.
Checks to seeif a command results ina non-zero return code.
If so then aborts unless the -i flag is used.

Any comments on this code should be directed to
Jeffrey Spidle
Systems Analyst
Office of Continuing Education
Iowa State University
Ames,IA 50011
or a message on one of the following BBS.
Gene Plantz (312)887-4227
Lynn Long (918)749-0718
Bob Blackwell(319)363-3314


*/


/*
Written by John M Sellens, April, 1984
Modified for Lattice C ver 2.11by JeffSpidle jun 15 84

Code is all original except where indicated otherwise.

Until August, 1984:
[email protected]

107 -180 Brybeck Cres.
Kitchener, Ontario
N2M 5G4

After August, 1984:
c/o 1135 Lansdowne Ave. SW
Calgary, Alberta
T2S 1A4

(c) Copyright 1984 John M Sellens
Permission is granted to use, distribute and/or modifythis code unless
done for direct commercial profit. Ifyou find theseroutines useful,
modest contributions (monetary or otherwise) will be gratefully accepted.
Author's name, address and this noticemust beincluded in any copies.

=ASCII 09
An example: To compile this program thefollowing makefile was used
$CFLAGS-ms -i/code/c/lc/
make.exe make.obj
link /code/c/lc/s/cs+make,make,make,/code/c/lc/s/lcs -map
make.obj make.c/code/c/lc/stdio.h
lc1 make $CFLAGS -i/code/c/lc/s/ -n
lc2 make

An explination: make.exe is a dependent file. Is is dependent on
make.obj. make.obj is dependent on make.c and stdio.h. If the
following command isissued:MAKE make.exe then make will
check to seeif either make.c or stdio.h hasa newerdate&time
thanmake.obj. if sothen the 2 compile instructionsare issued.
thenthe link instruction will be issued. Ifonly make.obj is
newer than make.exe then only the link step would beexecuted.

The symbol substitutionwill end up having the lc1 calllook like
lc1 make -ms -i/code/c/lc/ -i/code/c/lc/s/ -n

Hints: Dependencies canbe in any order. Make will resolve them
correctly.

How to lines must begin with a notjust 7 spaces.

Symbol definition lines must start with a $.

Symbols cannot have other symbols in their definition.

A symbolmay have a max of 39 characters.

The equate for asymbol may be up to 80 characters.

You may have an unlimited(withinreason)number of
symbols.

A symbolthat isnot defined will be copied to the
output line. ie
lc2 $TEST
with $TEST not defined will create the command
lc2 $TEST

Symbols are casespecific. upperand lower case are significant.

The command linemust specify what file you wishto
make. You may have more than oneset of file definitions
in a makefile. If you do you may run out of memory. I
haven't run intothis yet but I suppose it is possible.

If a command returns an error-code (ERRORLEVEL) not equal
to zero then MAKE thinksthat there was an error. MAKE
will abort processing unless the-i (ignore errors) flag
is used.

Any suggestionsor improvementswill bemuch appreciated. I
am nextgoing to try toput definable symbols for substitution
in a makefile next aka UNIX-MAKE. So wewill see what happens.
*/


 December 23, 2017  Add comments

Leave a Reply