	REM PROGRAM TO MANUFACTURE "DO" FILES THAT COMPILE FORTRAN PROGRAMS
	REM PROGRAM INVOCATION
	REM	.COMPILE <PROG> [ FOR FORTRAN ]
	REM
	REM 3/24/80

	DIM LINE$(120),SOURCEFILE$(50),OBJECTFILE$(50),WITH$(50)
	DIM ERROR102$/:12,4,0,102/,CREATELOG$/:7,:E/
	INPUT "" LINE$
	LINE$=UPPERCASE$(LINE$)
	IF	LINE$="?VERSION" THEN
		PRINT	"MDOS COMPILE V1.0a 6/18/80"
		EXIT
	FI
!
!	COMPILE FORTRAN PROGRAM...
!		DEFAULT SOURCE EXTENSION = .SA
!		COMPILE SEQUENCE:
!
!		.MDOSSIM FORT <PROG>
!		.MDOSSIM RLOAD
!		?BASE
!		?IDON
!		?LOAD=<PROG>
!		?LIB=FORLB
!		?LOAD=FTTOMD
!		?OBJX=<PROG>
!		?LOAD=<PROG>
!		?LIB=FORLB
!		?LOAD=FTTOMD
!		?EXIT
!		.MAKEBINARY
!		.....=<PROG>.LX
!		.....=<PROG>.CM
!		.....=  <CR>
!		***DONE***
!
	I	=FIND(LINE$,".")
	IF I THEN
		IF I=1 THEN
			PRINT "I CAN'T HANNDLE FILE NAMES THAT START IN '.'!!"
			EXIT
		FI
		LINE$	=LINE$(1,I-1)
	FI
	CREATE	#1, "JUNK.DO"
	PRINT	#1, "DELETE ";LINE$;".RO"
	PRINT	#1, "IFERROR 1011 OK"
	PRINT	#1, "LABEL OK"
	PRINT	#1, "MDOSSIM FORT ";LINE$
	PRINT	#1, "DELETE ";LINE$;".LX"
	PRINT	#1, "IFERROR 1011 OK"
	PRINT	#1, "LABEL OK"
	PRINT	#1, "MDOSSIM RLOAD"
	PRINT	#1, "BASE"
	PRINT	#1, "IDON"
	PRINT	#1, "LOAD=";LINE$
	PRINT	#1, "LIB=FORLB"
	PRINT	#1, "LOAD=FTTOMD"
	PRINT	#1, "OBJX=";LINE$
	PRINT	#1, "LOAD=";LINE$
	PRINT	#1, "LIB=FORLB"
	PRINT	#1, "LOAD=FTTOMD"
	PRINT	#1, "EXIT"
	PRINT	#1, "MAKEBINARY"
	PRINT	#1, LINE$;".LX"
	PRINT	#1, LINE$;".CM"
	PRINT	#1
	PRINT	#1, "* * * DONE * * *"
	CLOSE #1
	REM DO FILE IS BUILT, NOW "DO" IT!
	CLOSE #0
	OPEN	#0, "JUNK.DO"
	DELETE	"JUNK.DO"
	ON ERROR GOTO LEAVELOGFILEALONE
	SYSCALL(CREATELOG$,"CONSOLE:",LINE$)
FINISH:	ON ERROR GOTO 0
	EXIT
LEAVELOGFILEALONE:	IF ERR<>1031 THEN ERROR ELSE FINISH
	END
