head     1.30;
branch   ;
access   ;
symbols  REV_5:1.25 REV_4:1.25 REV_3:1.23 REV_2:1.20 REV_9:1.15;
locks    ; strict;
comment  @# @;


1.30
date     90.11.28.16.02.49;  author kevin;  state Exp;
branches ;
next     1.29;

1.29
date     90.11.28.16.00.33;  author kevin;  state Exp;
branches ;
next     1.28;

1.28
date     90.11.27.17.20.58;  author kevin;  state Exp;
branches ;
next     1.27;

1.27
date     90.11.16.15.25.14;  author kevin;  state Exp;
branches ;
next     1.26;

1.26
date     90.11.16.15.20.21;  author kevin;  state Exp;
branches ;
next     1.25;

1.25
date     90.10.05.20.00.59;  author Kevin;  state Exp;
branches ;
next     1.24;

1.24
date     90.10.05.19.57.37;  author Kevin;  state Exp;
branches ;
next     1.23;

1.23
date     90.10.05.19.38.58;  author Kevin;  state Exp;
branches ;
next     1.22;

1.22
date     90.10.05.19.36.47;  author Kevin;  state Exp;
branches ;
next     1.21;

1.21
date     90.10.05.19.33.46;  author Kevin;  state Exp;
branches ;
next     1.20;

1.20
date     90.10.05.19.31.19;  author Kevin;  state Exp;
branches ;
next     1.19;

1.19
date     90.10.05.19.28.38;  author Kevin;  state Exp;
branches ;
next     1.18;

1.18
date     90.10.05.19.23.31;  author Kevin;  state Exp;
branches ;
next     1.17;

1.17
date     90.10.05.19.17.42;  author Kevin;  state Exp;
branches ;
next     1.16;

1.16
date     90.10.05.19.11.35;  author Kevin;  state Exp;
branches ;
next     1.15;

1.15
date     90.10.05.17.58.18;  author Kevin;  state Exp;
branches ;
next     1.14;

1.14
date     90.10.05.17.56.01;  author Kevin;  state Exp;
branches ;
next     1.13;

1.13
date     90.10.05.17.43.28;  author Kevin;  state Exp;
branches ;
next     1.12;

1.12
date     90.10.05.17.42.20;  author Kevin;  state Exp;
branches ;
next     1.11;

1.11
date     90.10.05.16.58.16;  author Kevin;  state Exp;
branches ;
next     1.10;

1.10
date     90.10.05.16.54.11;  author Kevin;  state Exp;
branches ;
next     1.9;

1.9
date     90.10.04.16.10.57;  author Kevin;  state Exp;
branches ;
next     1.8;

1.8
date     90.10.04.14.50.09;  author Kevin;  state Exp;
branches ;
next     1.7;

1.7
date     90.10.04.14.13.24;  author Kevin;  state Exp;
branches ;
next     1.6;

1.6
date     90.10.04.02.54.12;  author Kevin;  state Exp;
branches ;
next     1.5;

1.5
date     90.10.04.02.29.23;  author Kevin;  state Exp;
branches ;
next     1.4;

1.4
date     90.10.04.01.58.57;  author Kevin;  state Exp;
branches ;
next     1.3;

1.3
date     90.10.04.00.22.40;  author Kevin;  state Exp;
branches ;
next     1.2;

1.2
date     90.10.03.18.55.00;  author Kevin;  state Exp;
branches ;
next     1.1;

1.1
date     90.10.03.15.06.40;  author Kevin;  state Exp;
branches ;
next     ;


desc
@Native Make Meta control file.  Contains all the build
scripts (written in Rexx) for maintaining a module.
@


1.30
log
@Forgot to force the path to the depend utility to
use the depend program from NMM:
@
text
@#
#	This is a temporary native make environment while
#	Some technical problems with the full blown one is
#	worked out.
#
#	It incorporates the same concepts and is forward compatible
#	with the full blown one.  (i.e. the full blown one adds features
#	that this one lacks).  This contains MAKE INTERNAL and MAKE
#	only.
#
######################################################################
#
#	$Id: NMakeMeta,v 1.29 90/11/28 16:00:33 kevin Exp Locker: kevin $
#
#
######################################################################
#
#	In order to use this, you need the following assigns:
#
#	V:		Points to the current version tree on the server
#
#	INCLUDE:        Points to the directory that contains the include
#				files you wish to use.
#	LIB:		Points to the directory containing the library
#				files you wish to use.
#	SFD:		Points to the directory in which to place SFD
#				SFD files
#	INCLUDE.STRIP:	Point to the directory in which to place stripped
#				include files.
#	INCLUDE.NOSTRIP:Points to the directory in which to place
#				non-stripped include files.
#	DOC:		Points to the directory in which to place autodoc
#				files.
#
#	TMP:		Points to a temporary directory where short
#				temporary files can be stored.  Note
#				that this only has to be 10 or 20K.
#
#	NMM:		Points to the directory that contains all the
#				NativeMakeMeta scripts and such.  Normally
#				this SHOULD point to the server's
#				NativeMakeMeta directory, but you can
#				change that if you feel comfortable with
#				it.
#
######################################################################
#
#	Within your makefile you need to define the following macros:
#
#	ASSEMBLER	set this to ${CAPE}, ${AMANX3} (for the manx
#			3.x Assembler), ${AMANX} for Manx 5.x or greater,
#			${ALATTICE} (for the lattice
#			assembler) or the mnemonic for whatever
#			assembler you are using.  If your assembler isn't
#			supported, then please see the keeper of native
#			make meta to incorporate your assembler into the
#			standard list.
#
#	COMPILER	set this to either ${LATTICE}, ${MANX3}, or
#			${MANX} depending on your particular compiler.
#
#	LINKER		set this to the linker that you use.  Normally
#			this is ${LLATTICE}, ${LMANX3}, or ${LMANX},
#			but you can set this if you need something really
#			whacked
#
#			${LLATTICE} should be used if you're using the
#			latice compiler, ${LMANX3} should be specified if
#			you're using the MANX 3.x compiler, or ${LMANX}
#			if you're using something more recent.
#
#	CFLAGS		Set this to any special compiler flags you wish to
#			use over the standard ones set by native makemeta
#			for your compiler.
#
#	AFLAGS		set this to any special assembler flags you wish to
#			use over the standard ones set by native makemeta
#			for your assembler.
#
#	LFLAGS		set this to any special linker flags you wish to
#			use over the standard ones set for BLINK
#
#	MODULE		set this to the name of your module.  For example:
#
#				MODULE = workbench
#
#	MODULEDIR	The directory to which to release your module.
#
#	CFILES		set this to the list of C source files you use.
#
#	AFILES		set this to the list of assembler source files you
#			use.
#
#	OFILES		set this to the list of object files to be made.
#
#	HFILES		set this to the list of .H files you need are
#			responsible for.
#
#	IFILES		set this to the list of .I files that you are
#			responsible for.
#
#	EXTINCL		set this to the list of include files that you
#			wish to release to the public.
#
#	INTINCL		set this to the list of include files that you
#			wish to release to other members of the
#			development team.
#
#		***	Note that EXTINCL and INTINCL make contain entries
#			that are duplicates of those in HFILES and IFILES
#			It is assumed that the union of CFILES, AFILES,
#			HFILES, and IFILES are to be kept under RCS.  It
#			is further assumed that all other files can be
#			rebuilt from CFILES, AFILES, HFILES, IFILES, or
#			a combination of them, or an outside agency.
#
#	LIBS		any libs that you need included
#
#	CLEANUP		_OPTIONAL_ is passed to a delete command during a
#			make clean operation.  The exact command executed
#			is DELETE >NIL: ${CLEANUP}, so CLEANUP can be any
#			valid file specification you wish.
#
#	SUBDIRS		Sub directories to make as well.
#
#	REVISION	set to the major revision number (2.0 should have
#			this set to 36)
#
#######################################################################
#
# Other defines
#
TARGET	=	${MODULE}.ld
#
# Disable the "default" command prefixes and suffixes in order to let me
# do various error processing.
#
# Uncomment the next line and comment the one after it for debugging
# information.
#
#CMDPREFIX =	TRACE INTERMEDIATES;
CMDPREFIX =
CMDSUFFIX =     
#
#######################################################################
#
#	Start defining rules for makemeta
#
#######################################################################
#
#	I thought about making ${TARGET} the default thing to make,
#	but that might hide a problem in the makefile, so the idea
#	was dropped.  If you want it to be made as a default target,
#	then make a line something like:
#
#		all : ${MODULE}.ld
#
#	and that will cause make to recreate your module as its default
#	behaviour.
#
#######################################################################

#######################################################################
#
#	Start defining dependencies
#
#######################################################################

.c.o :
	@@say "---> Compiling $*"
	@@SIGNAL ON ERROR; '${COMPILER} ${CFLAGS} $*.c '; ERROR: EXIT RC

.asm.o :
	@@say "---> Assembling $*"
	@@SIGNAL ON ERROR; '${ASSEMBLER} $* ${AFLAGS}' ; ERROR: EXIT RC

#
#	Person didn't specify a default target.  OOPS!
#

default :
	@@say ""
	@@say "Error.  Possible cause - no target specified before native"
	@@say "make meta included in your makefile.  Please check the"
	@@say "number and dial again."
	@@say ""

.INCLUDE=${MODULE}.depend

#
# Make the dependency file
#

depend ${MODULE}.depend :
	@@SourceFiles = "${CFILES} ${AFILES}" ;\
	IF EXISTS('${MODULE}.depend') THEN 'delete ${MODULE}.depend' ;\
	DO WHILE SourceFiles ~= "" ;\
		PARSE VAR SourceFiles aFile SourceFiles ;\
		'NMM:depend' aFile '${MODULE}.depend' ;\
	END

${MODULE}_rev.rev : version

#
#	How to make internal (i.e. do a release)
#

internal :
	@@say "---> Now starting make internal.  This could take a while."
	@@say "---> Getting current revision number."
	@@OPTIONS RESULTS;\
	IF (OPEN('TheRevFile', '${MODULE}_rev.rev','R')) THEN DO;\
		CurrentLabel = "REV_" || READLN('TheRevFile');\
		IF(CLOSE('TheRevFile')) THEN DO; END;\
	END;\
	ELSE DO;\
		SAY 'Could not open ${MODULE}_rev.rev file.  Aborting...';\
		EXIT(255);\
	END;\
	say "---> Checking if everything's checked in.";\
	RcsFiles = "${RFILES} ${AFILES} ${CFILES} ${HFILES} ${IFILES}";\
	IF(RcsFiles ~= "") THEN DO WHILE RcsFiles ~= "";\
		PARSE VAR RcsFiles aFile RcsFiles;\
		IF(~EXISTS(AFile)) THEN DO;\
			'co -u' AFile;\
			IF (RC > 0) THEN DO;\
				SAY '---> ERROR: Could not find file:' AFile;\
				EXIT 255;\
			END;\
		END;\
		'rcsdiff >NIL: -q ' aFile;\
		IF(RC == 1) THEN DO;\
			SAY '---> ERROR:' AFile 'is not checked in.';\
			SAY 'Check it in?';\
			PULL Answer;\
			IF(LEFT(Answer,1) == 'Y') THEN 'ci -u' AFile;\
			ELSE EXIT(255);\
			DROP Answer;\
			END;\
		ELSE IF(RC==2) THEN DO;\
			SAY '---> ERROR: rcsdiff returned error code 2';\
			say "           (Don't ask me why - talk to Ray)";\
		END;\
		'rlog >tmp:NMake001 -h' aFile;\
		IF(OPEN('InfoFile', 'tmp:NMake001', 'R')) THEN DO;\
			RCSHead.AFile = READLN('InfoFile');\
			RCSHead.AFile = READLN('InfoFile');\
			RCSHead.AFile = READLN('InfoFile');\
			PARSE VAR RCSHead.AFile Trash RCSHead.AFile;\
			RCSHEad.AFile = COMPRESS(RCSHead.AFile);\
			IF(CLOSE('InfoFile')) THEN DO; END;\
			DROP Trash;\
		END;\
	END;\
	RcsFiles = "${RFILES}";\
	DO WHILE RcsFiles ~= "";\
		PARSE VAR RcsFiles AFile RcsFiles;\
		'rcs >NIL: -q -N' || CurrentLabel || ':' || RCSHead.AFile AFile;\
	END;\
	say "--->Copying files to the server.";\
	'delete >NIL: ${MODULEDIR}/#?';\
	'list >TMP:NMake001 ${MODULEDIR}/RCS/#? LFORMAT "protect >NIL: ${MODULEDIR}/RCS/%s RWED"';\
	'execute TMP:NMake001';\
	'list >TMP:NMake001 ${MODULEDIR}/#? LFORMAT "delete >NIL: ${MODULEDIR}/%s all"';\
	'execute tmp:NMake001';\
	TheFiles = "${HFILES} ${IFILES} ${OFILES} ${CFILES} ${AFILES} ${TARGET}";\
	DO WHILE TheFiles ~= "";\
		PARSE VAR TheFiles aFile, TheFiles;\
		IF index(aFile, "/") ~= 0 THEN 'copy' aFile 'INCLUDE.STRIP:' || aFile;\
		ELSE 'copy' aFile '${MODULEDIR}/' || aFile;\
	END;\
	'copy RCS/#?' ${MODULEDIR} || '/RCS';\
	say "--->Make internal complete.";\
	'delete >NIL: TMP:NMake001';\
	EXIT(0)


#
#	The target make rule
#

${TARGET} : ${MODULE}.depend ${SUBDIRS} ${OFILES} ${LIBS}
	@@'amake version'
	@@say "---> Linking together ${TARGET} from ${OFILES} ${LIBS}"
	@@SIGNAL ON ERROR; '${LINKER}'; ERROR: EXIT RC

#
# make the _rev.rev file.
#

version :
	@@SAY '---> Bumping revision number in ${MODULE}_rev.rev'
	@@"V:aug/bin/bumprev ${REVISION} ${MODULE}_rev"

#
# clean up the source directory
#

clean :
	@@-TheFiles = '${OFILES}' ;\
	DO WHILE TheFiles ~= ""  ;\
		PARSE VAR TheFiles AFile TheFiles ;\
		'delete >NIL:' AFile ;\
	END ;\
	'delete >NIL: ${TARGET}' ;\
	IF("${CLEANUP}" ~= "") THEN DO ;\
		'delete >NIL: (${CLEANUP})' ;\
	END ;\
	EXIT(0)

#
# Check in all the moduls that are checked out
#

ciall : ${RFILES}
        @@LineNumber = 0 ;\
	SAY 'Message for checked in files : ' ;\
	DO WHILE aLine.LineNumber ~= '' ;\
		LineNumber = LineNumber + 1 ;\
		PULL aLine.LineNumber ;\
	END ;\
	SAY '---> Checking in any files still checked out.' ;\
	RcsFiles = "${RFILES}" ;\
	NChecked = "" ;\
	IF(RcsFiles ~= "") THEN DO WHILE RcsFiles ~= "";\
		PARSE VAR RcsFiles aFile RcsFiles;\
		IF(~EXISTS(AFile)) THEN DO;\
			'co -u' AFile;\
			IF (RC > 0) THEN DO;\
				SAY '---> ERROR: Could not find file:' AFile;\
				EXIT 255;\
			END;\
		END;\
		'rcsdiff >NIL: -q ' aFile;\
		IF(RC == 1) THEN NChecked = NChecked AFile ;\
		ELSE IF(RC==2) THEN DO;\
			SAY '---> ERROR: rcsdiff returned error code 2';\
			say "           (Don't ask me why - talk to Ray)";\
		END;\
	END;\
	DO WHILE NChecked ~= "" ;\
		PARSE VAR NChecked AFile NCHecked ;\
		Temp = LineNumber ;\
		DO WHILE Temp > 0 ;\
			QUEUE aLine.LineNumber ;\
		END ;\
		QUEUE '.' ;\
		'ci -u' AFile ;\
	END ;\
	EXIT 0

#
# Make the sub directories.
#

MakeMetaBogusTarget ${SUBDIRS} ::
	@@TheSubDirs = "${SUBDIRS}";\
	DO WHILE TheSubDirs ~= "";\
		PARSE VAR TheSubDirs aDir TheSubDirs;\
		'echo >>TMP:NMakeMeta002 "cd' aDir '"';\
		'echo >>TMP:NMakeMeta002 "make";\
		'echo >>TMP:NMakeMeta002 "cd /";\
	END;\
	'EXECUTE TMP:NMakeMeta002'

@


1.29
log
@Defines the make depend rule.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.28 90/11/27 17:20:58 kevin Exp Locker: kevin $
d199 1
a199 1
		'depend' aFile '${MODULE}.depend' ;\
@


1.28
log
@Fixed make revision problem (wrong file name)
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.27 90/11/16 15:25:14 kevin Exp Locker: kevin $
d188 14
d282 1
a282 1
${TARGET} : ${SUBDIRS} ${OFILES} ${LIBS}
a293 16
#	@@IF(EXISTS('${MODULE}_rev.rev')) THEN DO;\
#		IF(Open('aFile','${MODULE}_rev.rev','R')) THEN DO;\
#			CurrentRev = READLN('aFile');\
#			IF(Close('aFile')) THEN DO; END;\
#			CurrentRev = CurrentRev + 1;\
#			'echo >${MODULE}_rev.rev' CurrentRev;\
#		END;\
#		ELSE DO;\
#			SAY "Could not open ${MODULE}_rev.rev for input.";\
#			EXIT(20);\
#		END;\
#	END;\
#	ELSE DO;\
#		SAY "${MODULE}_rev.rev doesn't exist.  Starting it over from 1.";\
#		'echo >${MODULE}_rev.rev 1';\
#	END
a298 2
#${OFILES} : ${CFILES} ${AFILES}

d365 1
@


1.27
log
@Converted make version to use the BumpRev program rather
than an ARexx Script.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.26 90/11/16 15:20:21 kevin Exp Locker: kevin $
d279 1
a279 1
	@@"V:aug/bin/bumprev ${REVISION} ${MODULE}_rev.rev"
@


1.26
log
@added a few new options.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.27 90/11/06 23:50:22 Kevin Exp Locker: Kevin $
d126 3
d279 17
a295 16
	@@IF(EXISTS('${MODULE}_rev.rev')) THEN DO;\
		IF(Open('aFile','${MODULE}_rev.rev','R')) THEN DO;\
			CurrentRev = READLN('aFile');\
			IF(Close('aFile')) THEN DO; END;\
			CurrentRev = CurrentRev + 1;\
			'echo >${MODULE}_rev.rev' CurrentRev;\
		END;\
		ELSE DO;\
			SAY "Could not open ${MODULE}_rev.rev for input.";\
			EXIT(20);\
		END;\
	END;\
	ELSE DO;\
		SAY "${MODULE}_rev.rev doesn't exist.  Starting it over from 1.";\
		'echo >${MODULE}_rev.rev 1';\
	END
@


1.25
log
@Takes care of the case where a file named in the RFILES macro
doesn't exists in the source directory.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.24 90/10/05 19:57:37 Kevin Exp Locker: Kevin $
d39 7
d124 2
d168 1
a168 1
	@@SIGNAL ON ERROR; '${COMPILER} $*.c'; ERROR: EXIT RC
d172 1
a172 1
	@@SIGNAL ON ERROR; '${ASSEMBLER} $*' ; ERROR: EXIT RC
d204 1
a204 1
	RcsFiles = "${RFILES}";\
d249 7
a255 1
	'copy >NIL: "" ${MODULEDIR} ALL';\
d265 2
a266 2
${TARGET} : ${OFILES} ${LIBS}
	@@'make version'
d297 2
d310 55
@


1.24
log
@reduced the number of assigns necessary to function.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.23 90/10/05 19:38:58 Kevin Exp Locker: Kevin $
d198 7
@


1.23
log
@removed some more of the RCS output from the screen.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.22 90/10/05 19:36:47 Kevin Exp Locker: Kevin $
d21 1
a33 2
#
#	NMAKEMETA:	Points to the native makemeta routines
@


1.22
log
@removed some of the fershlugginer DOS messages that serve only
to clutter up one's screen.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.21 90/10/05 19:33:46 Kevin Exp Locker: Kevin $
d226 1
a226 1
		'rcs >NIL: -N' || CurrentLabel || ':' || RCSHead.AFile AFile;\
@


1.21
log
@Removed the auto-log messages since they were going into
the description rather than the log.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.20 90/10/05 19:31:19 Kevin Exp Locker: Kevin $
d226 1
a226 1
		'rcs -N' || CurrentLabel || ':' || RCSHead.AFile AFile;\
d230 1
a230 1
	'list >TMP:NMake001 ${MODULEDIR}/RCS/#? LFORMAT "protect ${MODULEDIR}/RCS/%s RWED"';\
d232 1
a232 1
	'list >TMP:NMake001 ${MODULEDIR}/#? LFORMAT "delete ${MODULEDIR}/%s all"';\
d234 1
a234 1
	'copy "" ${MODULEDIR} ALL';\
d236 1
a236 1
	'delete TMP:NMake001';\
@


1.20
log
@*** empty log message ***
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.19 90/10/05 19:28:38 Kevin Exp Locker: Kevin $
d204 1
a204 4
			IF(LEFT(Answer,1) == 'Y') THEN DO;\
				'echo >TMP:NMake001 "MAKE INTERNAL Auto-Checkin!';\
				'ci -u -tTMP:NMake001' AFile;\
			END;\
@


1.19
log
@*** empty log message ***
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.18 90/10/05 19:23:31 Kevin Exp $
d183 1
a183 1
internal ::
@


1.18
log
@*** empty log message ***
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.17 90/10/05 19:17:42 Kevin Exp $
d227 4
@


1.17
log
@*** empty log message ***
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.16 90/10/05 19:11:35 Kevin Exp Locker: Kevin $
d204 4
a207 1
			IF(LEFT(Answer,1) == 'Y') THEN 'ci -u' AFile;\
d235 1
@


1.16
log
@Modified make internal to handle write protection of the
destination directory.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.15 90/10/05 17:58:18 Kevin Exp Locker: Kevin $
d272 1
a272 1
	@@TheFiles = '${OFILES}' ;\
@


1.15
log
@added status messages that keep the user informed as
make internal goes along its merry way.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.14 90/10/05 17:56:01 Kevin Exp Locker: Kevin $
d183 1
a183 1
internal :
d225 6
a230 9
	DO WHILE RcsFiles ~= "";\
		PARSE VAR RcsFiles AFile RcsFiles;\
		'rcs -n' || CurrentLabel || ':' || RCSHead.AFile AFile;\
		'copy' AFile '${MODULEDIR}';\
	END
	@@OPTIONS RESULTS;\
	IF(EXISTS('RCS')) THEN DO;\
		'copy RCS ${MODULEDIR}/RCS CLONE';\
	END;\
@


1.14
log
@removed the anoying debugging information.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.13 90/10/05 17:43:28 Kevin Exp Locker: Kevin $
d185 1
d195 1
d224 1
d234 1
@


1.13
log
@Removed the log messges from NMakeMeta - they would have grown way too
large during this development state.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.12 90/10/05 17:42:20 Kevin Exp Locker: Kevin $
d127 5
a131 1
CMDPREFIX =	TRACE INTERMEDIATES;
d225 1
a225 1
		'copy' AFile 'V:src/${MODULEDIR}';\
d229 1
a229 1
		'copy RCS V:src/${MODULEDIR}/RCS CLONE';\
@


1.12
log
@First working version using RCS and return codes from RCS.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.10 90/10/05 16:54:11 Kevin Exp Locker: Kevin $
a14 39
#	$Log:	NMakeMeta,v $
# Revision 1.10  90/10/05  16:54:11  Kevin
# modified to use RCS again.
# 
# Revision 1.8  90/10/04  14:50:09  Kevin
# removed the default command line headers and trailers.
# implemented make clean in a more elegant manner.
# 
# Revision 1.7  90/10/04  14:13:24  Kevin
# implemented make clean and make version
# 
# Revision 1.6  90/10/04  02:54:12  Kevin
# moved all the compiler definitions out to NCOMPILERS
# file since there was a problem defining everything in
# one file.  Basically, the user had to define some things,
# then some automated things needed to be defined, then
# the user needed to define some more things in terms of
# what had been automatically generated, then the main portion
# of NMakeMeta needed to loaded.
# 
# Revision 1.5  90/10/04  02:29:23  Kevin
# added logic to make the _rev.rev file.
# 
# Revision 1.4  90/10/04  01:58:57  Kevin
# MakeInternal now works!  Amazing, but true,
# and it only required reimplementing part of RCS
# in REXX.
# 
# Revision 1.3  90/10/04  00:22:40  Kevin
# First "completed" make internal.
# Still has bugs, but I wanted to checkpoint
# the work so far.
# 
# Revision 1.2  90/10/03  18:55:00  Kevin
# First completed MakeMeta makefile
# 
# Revision 1.1  90/10/03  15:06:40  Kevin
# Initial revision
# 
@


1.11
log
@*** empty log message ***
@
text
@d220 10
a229 2
	@@OPTIONS RESULTS\
	;RcsFiles = "${RFILES}";\
d233 1
a233 1
		IF(RC ~= 1) THEN DO;\
d239 1
d241 3
d245 9
a253 8
		RcsFiles = "${RFILES}";\
		DO WHILE RcsFiles ~= "";\
			PARSE VAR RcsFiles AFile RcsFiles;\
			'rcs -n' || CurrentLabel || ':' || RCSHead.AFile AFile;\
		END
		@@OPTIONS RESULTS;\
		IF(EXISTS('RCS')) THEN DO;\
			'copy RCS V:src/${MODULEDIR}/RCS CLONE';\
d255 10
@


1.10
log
@modified to use RCS again.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.8 90/10/04 14:50:09 Kevin Exp Locker: Kevin $
d16 3
d224 1
a224 1
		'rcsdiff -q >NIL:' aFile;\
a236 1
			'copy' AFile 'V:src/${MODULEDIR}';\
@


1.9
log
@More clean up work done to simplify things a bit.
@
text
@d163 1
a163 1
CMDPREFIX =	
d219 9
a227 24
	SAY "Checking the following files to make sure they're checked in";\
	SAY '${RFILES}';\
	IF(RcsFiles == "RCSFILES") THEN DO;\
		SAY "";\
		SAY "You don't seem to have specified your RCSFILES macro";\
		SAY "in your makefile.  Tsk Tsk Tsk.  (Stopping).";\
		SAY "";\
		EXIT(100);\
	END;\
	DO WHILE RcsFiles ~= "";\
		PARSE VAR RcsFiles AFile RcsFiles;\
		IF(~ EXISTS(AFile)) THEN 'co -u AFile';\
		IF(~ EXISTS(AFile)) THEN DO;\
			SAY 'File "' || AFile || '" doesn' || "'" || 't seem to exist.';\
			EXIT(10);\
		END;\
		IF(EXISTS('RCS')) THEN Prefix = "RCS/";\
		ELSE DO;\
			Prefix = "";\
			IF(EXISTS('RcsLink')) THEN DO;\
				IF(Open('RFile','RCSLink','r')) THEN DO;\
					Prefix = ReadLn('RFile');\
					IF(Close('RFile')) THEN DO; END;\
				END;\
d230 9
a238 22
		IF(EXISTS(Prefix || AFile || ',v')) THEN DO;\
			Done = 'Not Done';\
			IF(Open('RFile', Prefix || AFile || ',v', 'R')) THEN DO WHILE (EOF('RFile') == 0) & (Done == 'Not Done');\
				aLine = READLN('RFile');\
				PARSE VAR aLine KeyWord RestOfLine;\
				IF(KeyWord == 'head') THEN DO;\
					TRACE INTERMEDIATES ;\
					PARSE VAR RestOfLine RCSTmp ThrowAway;\
					RCSHead.AFile = COMPRESS(TRANSLATE(RCSTmp,'',';','')) ;\
					TRACE NORMAL;\
				END;\
				IF(KeyWord == 'locks') THEN DO;\
					Done = 'Done';\
					PARSE VAR RestOfLine KeyWord RestOfLine;\
					IF(KeyWord ~= ';') THEN DO;\
						IF(CLOSE('RFile')) THEN DO; END;\
						SAY "File '" || AFile || "' is not checked in.";\
						EXIT 10;\
					END;\
				END;\
			END;\
			IF(Close('RFile')) THEN DO; END;\
d240 2
a241 40
		ELSE DO ;\
			SAY "File '" || AFile || "' doesn't have an RCS file.";\
			EXIT 20;\
		END;\
        END;\
#
############################################################################
#
#	The following code was removed due to the completion of make version
#
############################################################################
#
#	TRACE INTERMEDIATES;\
#	OPTIONS RESULTS;\
#	IF (EXISTS('${MODULE}_rev.rev')) THEN DO;\
#		IF(Open('aFile','${MODULE}_rev.rev','R')) THEN DO;\
#			CurrentRev = READLN('aFile');\
#			CurrentLabel = 'REV_' || CurrentRev;\
#			IF(Close('aFile')) THEN DO; END;\
#		END;\
#		ELSE DO;\
#			SAY "Can't open ${MODULE}_rev.rev!";\
#			EXIT 20;\
#		END;\
#	END;\
#	ELSE DO;\
#		SAY "${MODULE}_rev.rev doesn't exist!";\
#		EXIT 20;\
#	END;\
#	;RcsFiles = "${RFILES}";\
#	DO WHILE RcsFiles ~= "";\
#		PARSE VAR RcsFiles AFile RcsFiles;\
#		'rcs -n' || CurrentLabel || ':' || RCSHead.AFile AFile;\
#		'copy' AFile 'V:src/${MODULEDIR}';\
#	END
#	@@OPTIONS RESULTS;\
#	IF(EXISTS('RCS')) THEN DO;\
#		'copy RCS V:src/${MODULEDIR}/RCS CLONE';\
#	END
############################################################################
@


1.8
log
@removed the default command line headers and trailers.
implemented make clean in a more elegant manner.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.7 90/10/04 14:13:24 Kevin Exp Locker: Kevin $
d16 4
d192 1
a192 1
	@@'${COMPILER} $*.c'
d196 1
a196 1
	@@'${ASSEMBLER} $*'
d317 1
a317 1
	@@'${LINKER}'
d347 1
a347 1
	TheFiles = '${OFILES}' ;\
@


1.7
log
@implemented make clean and make version
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.6 90/10/04 02:54:12 Kevin Exp Locker: Kevin $
d16 3
d156 6
a342 1
	@@TRACE INTERMEDIATES;\
d344 9
a352 17
	IF(OPEN('TheFile', 'TMP:NMake01', 'W')) THEN DO;\
		IF(WRITELN('TheFile','FAILAT 250') > 0) THEN DO; END;\
		DO WHILE TheFiles ~= "" ;\
			PARSE VAR TheFiles AFile TheFiles;\
			IF(WRITELN('TheFile','delete >NIL:' AFile) > 0) THEN DO; END;\
		END;\
		IF(WRITELN('TheFile','delete >NIL: ${TARGET}') > 0) THEN DO; END;\
		IF("${CLEANUP}" ~= "") THEN DO;\
			IF(WRITELN('TheFile',"delete >NIL: (${CLEANUP})") > 0) THEN DO; END;\
		END;\
		IF(CLOSE('TheFile')) THEN DO; END;\
		'execute tmp:Nmake01';\
		'delete tmp:NMake01';\
	END;\
	ELSE DO;\
		SAY '---> ERROR: Could not write to tmp:NMake01.';\
	END
@


1.6
log
@moved all the compiler definitions out to NCOMPILERS
file since there was a problem defining everything in
one file.  Basically, the user had to define some things,
then some automated things needed to be defined, then
the user needed to define some more things in terms of
what had been automatically generated, then the main portion
of NMakeMeta needed to loaded.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.5 90/10/04 02:29:23 Kevin Exp Locker: Kevin $
d16 9
d142 5
d196 2
d260 35
a294 27
	TRACE INTERMEDIATES;\
	OPTIONS RESULTS;\
	IF (EXISTS('${MODULE}_rev.rev')) THEN DO;\
		IF(Open('aFile','${MODULE}_rev.rev','R')) THEN DO;\
			CurrentRev = READLN('aFile');\
			CurrentLabel = 'REV_' || CurrentRev;\
			IF(Close('aFile')) THEN DO; END;\
		END;\
		ELSE DO;\
			SAY "Can't open ${MODULE}_rev.rev!";\
			EXIT 20;\
		END;\
	END;\
	ELSE DO;\
		SAY "${MODULE}_rev.rev doesn't exist!";\
		EXIT 20;\
	END;\
	;RcsFiles = "${RFILES}";\
	DO WHILE RcsFiles ~= "";\
		PARSE VAR RcsFiles AFile RcsFiles;\
		'rcs -n' || CurrentLabel || ':' || RCSHead.AFile AFile;\
		'copy' AFile 'V:src/${MODULEDIR}';\
	END
	@@OPTIONS RESULTS;\
	IF(EXISTS('RCS')) THEN DO;\
		'copy RCS V:src/${MODULEDIR}/RCS CLONE';\
	END
d301 2
a302 1
${TARGET} : ${OFILES} ${LIBS} ${MODULE}_rev.rev
d310 2
a311 1
${MODULE}_rev.rev : ${CFILES} ${AFILES} ${HFILES}
d327 25
@


1.5
log
@added logic to make the _rev.rev file.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.4 90/10/04 01:58:57 Kevin Exp Locker: Kevin $
d16 3
a134 25
#	Define the standard assemblers and their environments.
#
# Assemblers first
#
CAPE	=	casm -a
AMANX	=	as -eAMIGA -iINCLUDE: -iINCLUDE.STRIP:
AMANX3	=	as -IINCLUDE: -IINCLUDE.STRIP: -EAMIGA
ALATTICE=	asm 
#
# Compilers next
#
LATTICE	=	lc
MANX	=	cc -dAMIGA -iINCLUDE: -iINCLUDE.STRIP: -sa -sb -sm -sn -sp -ss -su -wa -we -wr -ww
MANX3	=	cc -IINCLUDE: -IINCLUDE.STRIP: -DAMIGA
#
# Linkers next
#
LSTARTUP=	LIB:c.o
LLIBS	=	${LIBS} LIBS LIB:LC.LIB LIB:AMIGA.LIB
MLIBS3	=	${LIBS} LIB:c.lib LIB:amiga.lib 
MLIBS	=	${LIBS} LIB:c.lib LIB:amiga.lib ${LIBS}
LLATTICE=	BLINK FROM ${LSTARTUP} ${OFILES} ${LLIBS} TO ${TARGET} ${LFLAGS}
LMANX3	=	ln -O ${TARGET} -W ${LFLAGS} ${OFILES} ${MLIBS3}
LMANX	=	ln -o ${TARGET} -w ${LFLAGS} ${OFILES} ${MLIBS}
#
d164 2
a165 2
	say "---> Compiling $*"
	'${COMPILER} $*'
d168 2
a169 2
	say "---> Assembling $*"
	'${ASSEMBLER} $*'
d278 2
a279 2
	say "---> Linking together ${TARGET} from ${OFILES} ${LIBS}"
	'${LINKER}'
@


1.4
log
@MakeInternal now works!  Amazing, but true,
and it only required reimplementing part of RCS
in REXX.
@
text
@d13 1
a13 1
#	$Id: NMakeMeta,v 1.3 90/10/04 00:22:40 Kevin Exp Locker: Kevin $
d16 5
a204 8
#	The target make rule
#

${TARGET} : ${OFILES} ${LIBS}
	say "---> Linking together ${TARGET} from ${OFILES} ${LIBS}"
	'${LINKER}'

#
d294 30
@


1.3
log
@First "completed" make internal.
Still has bugs, but I wanted to checkpoint
the work so far.
@
text
@d13 1
a13 1
#	$Id: makefile,v 1.2 90/10/03 18:55:00 Kevin Exp Locker: Kevin $
d15 6
a20 1
#	$Log:	makefile,v $
a154 1
RCSFILES =	${CFILES} ${AFILES} ${HFILES} ${IFILES}
d213 4
a216 5
	@@TRACE Intermediates;\
	OPTIONS RESULTS\
	;RcsFiles = '${RFILES}';\
	SAY "Checking the following files to make sure they're checked in:"\;
	SAY '${RFiles}';\
d243 1
a243 1
			IF(Open('RFile', Prefix || AFile || ',v', 'R')) THEN DO WHILE ((EOF('RFile') == 0) & (Done == 'Not Done')) ;\
d246 6
a253 1
					IF(Close('RFile')) THEN DO; END;\
a260 1
				IF(Close('RFile')) THEN DO; END;\
d262 1
a262 2
			SAY 'RCS/' || AFile || ',v is not a valid RCS file.';\
			EXIT 20;\
d268 19
a286 2
        END
	RcsFiles = ${RCSFILES};\
d289 1
d291 4
a294 1
		END;\
d296 1
@


1.2
log
@First completed MakeMeta makefile
@
text
@d13 1
a13 1
#	$Id: makefile,v 1.1 90/10/03 15:06:40 Kevin Exp Locker: Kevin $
d16 3
d189 5
a193 5
	say ""
	say "Error.  Possible cause - no target specified before native"
	say "make meta included in your makefile.  Please check the"
	say "number and dial again."
	say ""
d208 27
a234 8
	say "---> Now starting make internal.  This could take a while."
	;RcsFiles = ${RCSFILES}; \
		DO WHILE RcsFiles ~= "";\
			PARSE VAR RcsFiles AFile RcsFiles;\
			IF(~ EXIST(AFile)) THEN 'co -u AFile';\
			IF(~ EXIST(AFile)) THEN DO;\
				SAY 'File "' || AFile || '" doesn' || "'" || 't seem to exist.';\
				EXIT(10);\
a235 1
			'execute NMAKEMETA:CheckedIn' AFile;\
d237 15
a251 5
		IF(~ EXISTS('tmp:STOPNMAKEMETA')) THEN DO;\
			RcsFiles = ${RCSFILES};\
			DO WHILE RcsFiles ~= "";\
				PARSE VAR RcsFiles AFile RcsFiles;\
				'copy' AFile 'V:src/${MODULEDIR}';\
d253 1
d255 14
a268 4
		ELSE DO;\
			SAY '!!! Stop !!!';\
			'DELETE tmp:STOPNMAKEMETA';\
			END
@


1.1
log
@Initial revision
@
text
@d13 1
a13 1
#	$Id: $
d15 4
a18 1
#	$Log: $
d38 6
d206 1
a206 1
	;RcsFiles = ${RCSFILES} \
d209 18
a226 3
			
	
	'copy "" ${MODULEDIR} all clone >NIL:'
@
