home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-13 | 31.8 KB | 1,211 lines |
- echo off
- bj -ew %0
- goto exit
- # (4 tab)
- #
- # compile.bj: hterm compile program in structured batch syntax
- #
- # Edition history:
- # 1.1 Ohta.ricoh 89/06/00 creation
- # 1.2 Halca.Hirano 89/09/18
- # 1) if PC98XA use glioxa.c else use glio98.c
- # 2) set machine type to asm option
- # 3) add ICO_SAVER switch
- # 4) add X/YMODEM switch
- # 1.3 89/09/26 Halca.Hirano
- # 1) change asm /DAX to asm /AX_
- # 1.4 89/11/19 Halca.Hirano
- # add J3100
- # 2.1 90/05/12 Halca.Hirano
- # rewrite into structured batch syntax
- # 2.2 90/06/21 Halca.Hirano
- # add soft font option
- # 2.3 90/07/02 Halca.Hirano
- # add hemacs
- # 2.4 90/07/13 Halca.Hirano
- # ask linker type
- #
- # $Header: compile.bjv 1.3 90/06/30 22:26:18 hirano Exp $
- #
- #
-
- #
- # utility macros
- #
- define elif "else if"
- define print "!ECHO"
- define terpri "!TYPE S.$"
- define rem "!REM"
- define set "!SET"
- define ask "!bin\\batchcom"
- define number "!bin\\batchcom 0"
- define yesno "!bin\\batchcom 1"
-
- #
- # dependency macros
- #
-
- # exe files
- define INDEXER_EXE_D "print indexer.exe: indexer.c indexer.h"
- define HKEY_E_D "print hkey.exe: crt.obj hkey98.obj"
- define HKEYSET_E_D "print hkeyset.exe: hkeyset.c hkey.h keytab98.h config.h option.h default.h global.h version.h"
- define HTERM_E_C1_D "print hterm.obj ansi.obj console.obj edit.obj file.obj font.obj"
- define HTERM_E_C2_D "print indexlib.obj kermit.obj msdos.obj port.obj printer.obj"
- define HTERM_E_C3_D "print setup.obj utils.obj xmodem.obj"
- define HTERM_E_981_D "print key98.obj pc98.obj saver98.obj serdrv98.obj vram98.obj"
- define HTERM_E_982_D "print plot.obj ico.obj glio98.obj glioxa.obj graph98.obj"
- define HTERM_E_PC1_D "print keypc.obj keydrvpc.obj saverpc.obj serdrvpc.obj"
- define HTERM_E_PC2_D "print ibmpc.obj vrampc.obj"
- define HTERM_E_J3_D "print j3100.obj vramj3.obj"
- define HEMACS_E_C1_D "print hemacs.obj ansi.obj console.obj hedit.obj file.obj font.obj"
- define HEMACS_E_C2_D "print indexlib.obj msdos.obj"
- define HEMACS_E_C3_D "print utils.obj"
- define HEMACS_E_981_D "print key98.obj pc98.obj saver98.obj serdrv98.obj vram98.obj"
- define HEMACS_E_PC1_D "print keypc.obj keydrvpc.obj saverpc.obj serdrvpc.obj"
- define HEMACS_E_PC2_D "print ibmpc.obj vrampc.obj"
- define HEMACS_E_J3_D "print j3100.obj vramj3.obj"
-
- # obj files
- define ALL98_D "print all: hterm.exe hkey.exe hkeyset.exe hemacs.exe"
- define ALL_D "print all: hterm.exe hemacs.exe"
- define ANSI_O_D "print ansi.obj: ansi.c config.h option.h default.h global.h"
- define CONSOLE_O_D "print console.obj: console.c config.h option.h default.h global.h"
- define CRT_O_D "print crt.obj: crt.asm"
- define EDIT_O_D "print edit.obj: edit.c config.h option.h default.h global.h"
- define FILE_O_D "print file.obj: file.c config.h option.h default.h global.h"
- define FONT_O_D "print font.obj: font.c config.h option.h default.h global.h font.h"
- define GLIO98_O_D "print glio98.obj: option.h glio98.c glio98.h"
- define GLIOXA_O_D "print glioxa.obj: option.h glioxa.c"
- define GRAPH98_O_D "print graph98.obj: graph98.c graph.h glio98.h"
- define HEDIT_O_D "print hedit.obj: edit.c config.h option.h default.h global.h"
- define HKEY98_O_D "print hkey98.obj: key98.c hterm.h config.h option.h default.h hkey.h global.h keytab98.h"
- define HEMACS_O_D "print hemacs.obj: hemacs.c config.h option.h default.h global.h version.h"
- define HTERM_O_D "print hterm.obj: hterm.c config.h option.h default.h global.h version.h"
- define IBMPC_O_D "print ibmpc.obj: ibmpc.c config.h option.h default.h global.h"
- define ICO_O_D "print ico.obj: ico.c hterm.h config.h option.h default.h global.h graph.h"
- define INDEXLIB_O_D "print indexlib.obj: indexlib.c indexer.h"
- define J3100_O_D "print j3100.obj: j3100.c hterm.h config.h option.h default.h global.h"
- define KERMIT_O_D "print kermit.obj: kermit.c hterm.h config.h option.h default.h global.h"
- define KEY98_O_D "print key98.obj: key98.c hterm.h config.h option.h default.h hkey.h global.h keytab98.h"
- define KEYDRVPC_O_D "print keydrvpc.obj: keydrvpc.asm"
- define KEYOSK_O_D "print keyosk.obj: keyosk.c hterm.h"
- define KEYPC_O_D "print keypc.obj: keypc.c hterm.h keytabpc.h"
- define MSDOS_O_D "print msdos.obj: msdos.c hterm.h config.h option.h default.h global.h"
- define PC98_O_D "print pc98.obj: pc98.c hterm.h config.h option.h default.h global.h"
- define PLOT_O_D "print plot.obj: plot.c graph.h"
- define PORT_O_D "print port.obj: port.c hterm.h config.h option.h default.h global.h"
- define PRINTER_O_D "print printer.obj: printer.c hterm.h config.h option.h default.h global.h"
- define SAVER98_O_D "print saver98.obj: saver98.c hterm.h config.h option.h default.h global.h"
- define SAVERPC_O_D "print saverpc.obj: saverpc.c hterm.h config.h option.h default.h global.h"
- define SERDRV98_O_D "print serdrv98.obj: serdrv98.asm"
- define SERDRVPC_O_D "print serdrvpc.obj: serdrvpc.asm"
- define SETUP_O_D "print setup.obj: setup.c hterm.h config.h option.h default.h global.h version.h"
- define UTILS_O_D "print utils.obj: utils.c hterm.h config.h option.h default.h global.h version.h indexer.h"
- define VRAM98_O_D "print vram98.obj: vram98.asm"
- define VRAMJ3_O_D "print vramj3.obj: vramj3.asm"
- define VRAMPC_O_D "print vrampc.obj: vrampc.asm"
- define XMODEM_O_D "print xmodem.obj: xmodem.c hterm.h config.h option.h default.h global.h"
-
- #
- # global variables
- #
- # A asembler name and assembler option
- # C compiler name
- # F compile flag
- # M make name
- # P machine architecture
- #
-
-
- #
- # program begin
- #
- print OFF
- rem
- rem compile.bat: hterm compile program
- rem (generated by Batch Jack; structured batch preprocessor)
- rem
-
- if (X%DEBUG%==XON)
- print ON
- !CLS
-
- print #########################################################
- print # #
- print # COMPILE.BAT - Makefile builder for hterm 2.6 #
- print # #
- print # Copyright (C) 1989 by Junn Ohta #
- print # #
- print #########################################################
- print
-
- #
- # check functionality of batchcom.com
- #
- ask p > S.$
- if (NOT EXIST S.$) {
- print
- print Can't execute 'BATCHCOM' needed for compilation procedure.
- goto END1
- }
-
-
- #
- # target machine and compiler check
- #
- print
- print Building Makefile from the combination of target machine,
- print compiler, assembler, make and optional facilities.
- print
- print * Target must be one of PC-9801, PC-98XA, AX, IBM-PC, J3100.
- print * Compiler must be one of Microsoft C 5.1, Turbo C 1.5 / 2.0.
- print * Assembler must be one of MASM 3.0 / 4.0 / 5.1, TASM1.0.
- print
- yesno "Is your system listed above? [yn] "
- print
- if (ERRORLEVEL 255) {
- print ... Sorry, you can't make hterm.
- goto END1
- }
- print ... Gee, you got it!
- print
-
- #
- # check environment space
- #
- print #########################################################
- print # Checking environment space #
- print #########################################################
- print
- print Checking whether enough space is left or not.
- print
- ask e A C D F M O P > E.$
- !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
- set A=12345678901234
- set C=12345
- set D=12345
- set F=123456789012345678901234567890
- set O=123
- set L=1234567890
- set P=12345678
-
- if (NOT X%P%==X12345678) {
- !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
- print ... There isn't enough space to work with.
- print
- print COMPILE needs at least 100 bytes of free space.
- print
- print If you are on MS-DOS 2.11, use some utility to extend
- print environment space or unset some environment variables
- print to get more space, then re-run COMPILE.
- print
- print If you are on MS-DOS 3.1 or later, you can change the
- print size of environment space (defaulted to 160 bytes) by
- print placing SHELL command into CONFIG.SYS. Unset some
- print environment variables, or extend environment space as
- print shown below and reset system, then re-run COMPILE.
- print
- print = To set the size of environment space, e.g. to 320 bytes =
- print
- print DOS 3.1: SHELL=A:\COMMAND.COM A:\ /P /E:20
- print DOS 3.2 or later: SHELL=A:\COMMAND.COM A:\ /P /E:320
- goto END0
- }
-
- #
- # clear default parameters
- #
- !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
- print ... There seems enough environment space.
- print
-
- #
- # set target machine
- #
- set OK=F
- while (%OK%==F) {
- print #########################################################
- print # Target machine #
- print #########################################################
- print
- print 1. PC-9801 or PC-286 series
- print 2. PC-98XA
- print 3. AX machine
- print 4. IBM-PC or clone
- print 5. J3100 series
- print
-
- number "Which machine do you have? [12345] "
- print
- switch (ERRORLEVEL) {
- case 5:
- if (ERRORLEVEL 6)
- goto macherr
- print ... Target machine is J3100 series.
- set P=J3100
- case 4:
- print ... Target machine is IBM-PC or clone.
- set P=IBMPC
- case 3:
- print ... Target machine is AX.
- set P=AX
- case 2:
- print ... Target machine is PC-98XA.
- set P=PC98XA
- case 1:
- print ... Target machine is PC-9801 or PC-286 series.
- set P=PC98
- default:
- :macherr
- continue
- }
-
- print
- yesno "Is this ok? [yn] "
- print
- if (NOT ERRORLEVEL 255)
- set OK=T
- }
-
- print
-
- #
- # set compiler type
- #
- set OK=F
- while (%OK%==F) {
- print #########################################################
- print # Compiler #
- print #########################################################
- print
- print 1. Microsoft C 5.1 / 6.0
- print 2. Turbo C 1.5 / 2.0
- print
- print If you have both of compilers, type '1'.
- print
- number "Which compiler do you have? [12] "
- print
- switch (ERRORLEVEL) {
- case 2:
- if (ERRORLEVEL 3)
- goto comerr
- print ... Compiler is Turbo C 1.5 or 2.0.
- set C=tcc
- set F=-mm -O -G -d -DMSDOS -D%P%
- case 1:
- print ... Compiler is Microsoft C 5.1.
- set C=cl
- set F=-AM -Ox -Zp -D%P%
- default:
- :comerr
- continue
- }
-
- print
- yesno "Is this ok? [yn] "
- print
- if (NOT ERRORLEVEL 255)
- set OK=T
- }
-
- #
- # set assembler type
- #
- set OK=F
- while (%OK%==F) {
- print #########################################################
- print # Assembler #
- print #########################################################
- print
- print 1. MASM 3.0 / 4.0 / 5.1
- print 2. TASM 1.0
- print
- number "Which assembler do you have? [12] "
- print
- switch (ERRORLEVEL) {
- case 2:
- if (ERRORLEVEL 3)
- goto asmerr
- print ... Assembler is TASM 1.0.
- if (%P%==AX)
- set A=tasm /mx /DAX_
- else
- set A=tasm /mx /D%P%
- case 1:
- print ... Assembler is MASM 3.0, 4.0 or 5.1.
- if (%P%==AX)
- set A=masm /MX /DAX_
- else
- set A=masm /MX /D%P%
- default:
- :asmerr
- continue
- }
-
- print
- yesno "Is this ok? [yn] "
- print
- if (NOT ERRORLEVEL 255)
- set OK=T
- }
-
- #
- # set linker type
- #
- set OK=F
- while (%OK%==F) {
- print #########################################################
- print # linker #
- print #########################################################
- print
- print 1. Microsoft Linker (You can use overlay.)
- print 2. Turbo Linker (You can't use overlay.)
- print
- number "Which linker do you have? [12] "
- print
- switch (ERRORLEVEL) {
- case 2:
- if (ERRORLEVEL 3)
- goto linerr
- print ... Linker is Turbo Link.
- set L=tlink /c
- set R=tlk
- case 1:
- print ... Linker is Microsoft Link.
- set L=link /NOI
- set R=mlk
- default:
- :linerr
- continue
- }
-
- print
- yesno "Is this ok? [yn] "
- print
- if (NOT ERRORLEVEL 255)
- set OK=T
- }
-
- #
- # set make type
- #
- set OK=F
- while (%OK%==F) {
- print #########################################################
- print # Make #
- print #########################################################
- print
- print 1. MS-MAKE (in MS-DOS) (can't use comment, macro)
- print 2. MS-MAKE (in Microsoft C) (target order is fixed)
- print 3. KAO make (can't redefine .c.obj)
- print 4. Turbo Make (.SUFFIXES not supported)
- print 5. NDMAKE, GY make, PolyMake (and other unix-like makes)
- print 6. GNU Make (unix-like, but named as 'gmake')
- print
- number "Which make do you have? [123456] "
- print
- switch (ERRORLEVEL) {
- case 6:
- if (ERRORLEVEL 7)
- goto makeerr
- print ... Make is GNU Make
- set M=gnu
- case 5:
- print ... Make is NDMAKE, GY make, PolyMake (or another unix-like make).
- set M=unix
- case 4:
- print ... Make is Turbo Make.
- set M=turbo
- case 3:
- print ... Make is the KAO make.
- set M=kao
- case 2:
- print ... Make is Microsoft MAKE in Microsoft C.
- set M=msc
- case 1:
- print ... Make is Microsoft MAKE in MS-DOS.
- set M=dos
- default:
- :makeerr
- continue
- }
-
- print
- yesno "Is this ok? [yn] "
- print
- if (NOT ERRORLEVEL 255)
- set OK=T
- }
-
- #
- # set compile time options
- #
-
- # default options
- #
- print #########################################################
- print # Optional facilities #
- print #########################################################
-
- print /* generated by compile.bat */ >option.h
-
- print
- print You can include optional facilities as below:
- print
- print * SET-UP
- print * NEC Kanji
- print * MOUSE
- print * BS Key Watcher
- print * KERMIT file transfer
- print * X/YMODEM file transfer
- print * History editor
- print * Soft font
- if ((%P%==PC98)|(%P%==PC98XA)) {
- print * Graphics code from University of Osaka pref. (UOP_GRAPHICS)
- print * Special screen saver (need UOP_GRAPHICS)
- }
- if (%R%==mlk)
- print * Overlay
-
- #
- # ask
- #
- print
- print Set-Up is used to make settings of hterm.
- print I strongly recommend to type 'y' unless you are making mimimum hterm.
- print
- yesno "Do you include Set-Up? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print ... Include Set-Up.
- print #define SETUP >>option.h
- } else {
- print ... Do not include Set-Up.
- }
-
- print
- print NEC kanji sequence is used to connect ACOS system.
- print My recommendation is 'n'.
- print
- yesno "Do you include NEC kanji? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print ... Include NEC kanji.
- print #define NEC_KANJI >>option.h
- } else {
- print ... Do not include NEC kanji.
- }
-
- print
- print hterm can be controled by mouse.
- print My recommendation is 'y'.
- print
- yesno "Do you include mouse? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print ... Include mouse.
- print #define MOUSE >>option.h
- } else {
- print ... Do not include mouse.
- }
-
- print
- print BS key watcher is a friend of hard worker.
- print BS key watcher warns you when you are fatigued with your work.
- print If you are a hard worker, type 'y'
- print
- yesno "Do you include BS key watcher? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print ... Include BS key watcher.
- print #define BS_WATCHER >>option.h
- } else {
- print ... Do not include BS key watcher.
- }
-
- print
- print kermit is a popular file transfer protocol.
- print
- yesno "Do you include KERMIT file transfer? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print ... Include KERMIT file transfer.
- print #define KERMIT >>option.h
- } else {
- print ... Do not include KERMIT file transfer.
- }
-
- print
- print X/YMODEM is also a popular file transfer protocol.
- print
- print
- yesno "Do you include X/YMODEM file transfer? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print ... Include X/YMODEM file transfer.
- print #define XMODEM >>option.h
- } else {
- print ... Do not include X/YMODEM file transfer.
- }
-
- print
- print History editor allows you to view session history and it provides
- print editing or pasting.
- print
- yesno "Do you include history editor? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print #define COPY_PASTE >>option.h
- print ... Include history editor.
- } else {
- print ... Do not include history editor.
- }
-
- print
- print Soft font allows you to display Japanese even if you are using IBM PC.
- print Soft font can be used with EGA or VGA.
- print On other machines (PC98xx/AX/J3100..) this is just a memory consuming stuff.
- print
- yesno "Do you include soft font? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print #define SOFT_FONT >>option.h
- print ... Include soft font.
- } else {
- print ... Do not include soft font.
- }
-
- if ((%P%==PC98)|(%P%==PC98XA)) {
- print
- print Graphics allows you to make graphs by plot command on your unix.
- print Ico screen saver needs graphics code.
- print
- yesno "Do you include graphics? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print #define UOP_GRAPHICS >>option.h
- print ... Include graphics.
- if (%C%==tcc) {
- set F=%F% -f
- }
- print
- yesno "Do you include special screen saver? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- print #define ICO_SAVER >>option.h
- print ... Include special screen saver.
- } else {
- print ... Do not include special screen saver.
- }
- } else {
- print ... Do not include graphics code.
- if (%C%==tcc)
- set F=%F% -f-
- }
- # else IBM-PC/AX/J3100
- } else {
- if (%C%==tcc)
- set F=%F% -f-
- }
-
- set O=
- if (%R%==mlk) {
- print
- print Overlay saves memory. But you can not use lzexe.
- print I recommend to type 'n' unless you use lots of funcy TSRs.
- print
- yesno "Do you like overlay? [yn] "
- print
- if (NOT ERRORLEVEL 255) {
- set O=ov
- print #define OVERLAY >>option.h
- print ... Overlay.
- } else {
- set O=
- print ... No overlay.
- }
- }
- print
-
- #
- #
- # generating makefile
- #
- #
- ask n "Mocking up a Makefile ... "
- if (EXIST Makefile) {
- !DEL Makefile
- }
- if (EXIST "src\\*.obj")
- !del src\*.obj
-
- #
- # comments and macros for non-dos makes
- #
- if (NOT %M%==dos) {
- print #########################################################>>Makefile
- print # #>>Makefile
- print # Makefile - Makefile for hterm 2.6 #>>Makefile
- print # #>>Makefile
- print # ============== C A U T I O N ============== #>>Makefile
- print # Since this file is generated by COMPILE.BAT, #>>Makefile
- print # all changes you will make to this file will #>>Makefile
- print # silently GO AWAY! #>>Makefile
- print # #>>Makefile
- print #########################################################>>Makefile
- terpri >>Makefile
- print CC = %C%>>Makefile
- print LD = %L%>>Makefile
- print ASM = %A%>>Makefile
- print CFLAGS = %F%>>Makefile
- terpri >>Makefile
- set D=%C%
- set C=$(CC)
- set A=$(ASM)
- set L=$(LD)
- set F=$(CFLAGS)
- }
-
- #
- # final target for kao make
- #
- if (%M%==kao) {
- if ((%P%==PC98)|(%P%==PC98XA))
- ALL98_D >>Makefile
- else
- ALL_D >>Makefile
- terpri >>Makefile
- }
-
- #
- # make *.obj on non unix make
- #
- if ((%M%==dos)|(%M%==msc)|(%M%==kao)) {
- #-------------------------------------------------------------------*
- # all for makes which don't allow .c.obj (dos, msc, kao)
- #-------------------------------------------------------------------*
-
- ANSI_O_D >>Makefile
- print %C% -c %F% ansi.c>>Makefile
- terpri >>Makefile
-
- CONSOLE_O_D >>Makefile
- print %C% -c %F% console.c>>Makefile
- terpri >>Makefile
-
- EDIT_O_D >>Makefile
- print %C% -c %F% edit.c>>Makefile
- terpri >>Makefile
-
- FILE_O_D >>Makefile
- print %C% -c %F% file.c>>Makefile
- terpri >>Makefile
-
- FONT_O_D >>Makefile
- print %C% -c %F% font.c>>Makefile
- terpri >>Makefile
-
- HEDIT_O_D >>Makefile
- if (%D%==cl)
- print %C% -c %F% -DHEMACS -Fohedit.obj edit.c>>Makefile
- else
- print %C% -c %F% -DHEMACS -ohedit.obj edit.c>>Makefile
- terpri >>Makefile
-
- HEMACS_O_D >>Makefile
- print %C% -c %F% hemacs.c>>Makefile
- terpri >>Makefile
-
- HTERM_O_D >>Makefile
- print %C% -c %F% hterm.c>>Makefile
- terpri >>Makefile
-
- INDEXLIB_O_D >>Makefile
- print %C% -c %F% indexlib.c>>Makefile
- terpri >>Makefile
-
- KERMIT_O_D >>Makefile
- print %C% -c %F% kermit.c>>Makefile
- terpri >>Makefile
-
- MSDOS_O_D >>Makefile
- print %C% -c %F% msdos.c>>Makefile
- terpri >>Makefile
-
- PORT_O_D >>Makefile
- print %C% -c %F% port.c>>Makefile
- terpri >>Makefile
-
- PRINTER_O_D >>Makefile
- print %C% -c %F% printer.c>>Makefile
- terpri >>Makefile
-
- SETUP_O_D >>Makefile
- print %C% -c %F% setup.c>>Makefile
- terpri >>Makefile
-
- UTILS_O_D >>Makefile
- print %C% -c %F% utils.c>>Makefile
- terpri >>Makefile
-
- XMODEM_O_D >>Makefile
- print %C% -c %F% xmodem.c>>Makefile
- terpri >>Makefile
-
- if ((%P%==PC98)|(%P%==PC98XA)) {
- #
- # PC98, PC98XA
- #
- CRT_O_D >>Makefile
- print %A% crt.asm;>>Makefile
- terpri >>Makefile
-
- GLIO98_O_D >>Makefile
- print %C% -c %F% glio98.c>>Makefile
- terpri >>Makefile
-
- GLIOXA_O_D >>Makefile
- print %C% -c %F% glioxa.c>>Makefile
- terpri >>Makefile
-
- GRAPH98_O_D >>Makefile
- print %C% -c %F% graph98.c>>Makefile
- terpri >>Makefile
-
- KEY98_O_D >>Makefile
- print %C% -c %F% key98.c>>Makefile
- terpri >>Makefile
-
- HKEY98_O_D >>Makefile
- if (%D%==cl)
- print %C% -c -Ox -D%P% -DTSR -Fohkey98.obj key98.c>>Makefile
- else
- print %C% -c -mc -G -O -D%P% -DTSR -DMSDOS -ohkey98.obj key98.c>>Makefile
- terpri >>Makefile
-
- HKEY_E_D >>Makefile
- print %L% crt.obj+hkey98.obj,hkey.exe; >>Makefile
- if (%P%==PC98)
- print copy hkey.exe ..\bin\hkey.98>>Makefile
- else
- print copy hkey.exe ..\bin\hkey.xa>>Makefile
- terpri >>Makefile
-
- HKEYSET_E_D >>Makefile
- if (%D%==cl)
- print %C% -D%P% -Ox -Zp1 hkeyset.c>>Makefile
- else
- print %C% -D%P% -G -O -DMSDOS hkeyset.c>>Makefile
- if (%P%==PC98)
- print copy hkeyset.exe ..\bin\hkeyset.98>>Makefile
- else
- print copy hkeyset.exe ..\bin\hkeyset.xa>>Makefile
- terpri >>Makefile
-
- ICO_O_D >>Makefile
- print %C% -c %F% ico.c>>Makefile
- terpri >>Makefile
-
- PC98_O_D >>Makefile
- print %C% -c %F% pc98.c>>Makefile
- terpri >>Makefile
-
- PLOT_O_D >>Makefile
- print %C% -c %F% plot.c>>Makefile
- terpri >>Makefile
-
- SAVER98_O_D >>Makefile
- print %C% -c %F% saver98.c>>Makefile
- terpri >>Makefile
-
- SERDRV98_O_D >>Makefile
- print %A% serdrv98.asm;>>Makefile
- terpri >>Makefile
-
- VRAM98_O_D >>Makefile
- print %A% vram98.asm;>>Makefile
- terpri >>Makefile
-
- print hemacs.exe: \>>Makefile
- HEMACS_E_C1_D\>>Makefile
- HEMACS_E_C2_D\>>Makefile
- HEMACS_E_C3_D\>>Makefile
- HEMACS_E_981_D>>Makefile
- print %L% @..\link\hemacs98.%R%>>Makefile
- if (%P%==PC98)
- print copy hemacs.exe ..\bin\hemacs.98>>Makefile
- else
- print copy hemacs.exe ..\bin\hemacs.xa>>Makefile
- terpri >>Makefile
-
- print hterm.exe: \>>Makefile
- HTERM_E_C1_D\>>Makefile
- HTERM_E_C2_D\>>Makefile
- HTERM_E_C3_D\>>Makefile
- HTERM_E_981_D\>>Makefile
- HTERM_E_982_D>>Makefile
- print %L% @..\link\pc98%O%.%R%>>Makefile
- if (%P%==PC98)
- print copy hterm.exe ..\bin\hterm.98>>Makefile
- else
- print copy hterm.exe ..\bin\hterm.xa>>Makefile
- terpri >>Makefile
- } else {
- #
- # IBM-PC, AX, J3100
- #
- if (%P%==J3100) {
- J3100_O_D >>Makefile
- print %C% -c %F% j3100.c>>Makefile
- terpri >>Makefile
-
- VRAMJ3_O_D >>Makefile
- print %A% vramj3.asm;>>Makefile
- terpri >>Makefile
- } else {
- IBMPC_O_D >>Makefile
- print %C% -c %F% ibmpc.c>>Makefile
- terpri >>Makefile
-
- VRAMPC_O_D >>Makefile
- print %A% vrampc.asm;>>Makefile
- terpri >>Makefile
- }
- KEYPC_O_D >>Makefile
- print %C% -c %F% keypc.c>>Makefile
- terpri >>Makefile
-
- SAVERPC_O_D >>Makefile
- print %C% -c %F% saverpc.c>>Makefile
- terpri >>Makefile
-
- SERDRVPC_O_D >>Makefile
- print %A% serdrvpc.asm;>>Makefile
- terpri >>Makefile
-
- KEYDRVPC_O_D >>Makefile
- print %A% keydrvpc.asm;>>Makefile
- terpri >>Makefile
-
-
- print hemacs.exe: \>>Makefile
- HEMACS_E_C1_D\>>Makefile
- HEMACS_E_C2_D\>>Makefile
- HEMACS_E_C3_D\>>Makefile
- HEMACS_E_PC1_D\>>Makefile
- switch (%P%==) {
- case J3100:
- HEMACS_E_J3_D>>Makefile
- print %L% @..\link\hemacsj3.%R%>>Makefile
- print copy hemacs.exe ..\bin\hemacs.j3>>Makefile
- case AX:
- HEMACS_E_PC2_D>>Makefile
- print %L% @..\link\hemacspc.%R%>>Makefile
- print copy hemacs.exe ..\bin\hemacs.ax>>Makefile
- case IBMPC:
- HEMACS_E_PC2_D>>Makefile
- print %L% @..\link\hemacspc.%R%>>Makefile
- print copy hemacs.exe ..\bin\hemacs.pc>>Makefile
- }
- terpri >>Makefile
-
- print hterm.exe: \>>Makefile
- HTERM_E_C1_D\>>Makefile
- HTERM_E_C2_D\>>Makefile
- HTERM_E_C3_D\>>Makefile
- HTERM_E_PC1_D\>>Makefile
- switch (%P%==) {
- case J3100:
- HTERM_E_J3_D>>Makefile
- print %L% @..\link\j3100%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.j3>>Makefile
- case AX:
- HTERM_E_PC2_D>>Makefile
- print %L% @..\link\ibmpc%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.ax>>Makefile
- case IBMPC:
- HTERM_E_PC2_D>>Makefile
- print %L% @..\link\ibmpc%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.pc>>Makefile
- }
- terpri >>Makefile
- }
- INDEXER_EXE_D >>Makefile
- print %C% %F% indexer.c>>Makefile
- print copy indexer.exe ..\bin\indexer.exe>>Makefile
- terpri >>Makefile
-
- if (%M%==kao) {
- #
- # clean for kao make
- #
- terpri >>Makefile
- print clean:>>Makefile
- print command /C if EXIST hterm.exe del hterm.exe>>Makefile
- print command /C if EXIST hkey.exe del hkey.exe>>Makefile
- print command /C if EXIST hkeyset.exe del hkeyset.exe>>Makefile
- print command /C if EXIST hemacs.exe del hemacs.exe>>Makefile
- print command /C if EXIST *.obj del *.obj>>Makefile
- print command /C if EXIST indexer.exe del indexer.exe>>Makefile
- }
- #
- # end point for non-unix makes
- #
- } else {
- #
- # unix-like make
- #
- print HTOBJS = \>>Makefile
- HTERM_E_C1_D\>>Makefile
- HTERM_E_C2_D\>>Makefile
- HTERM_E_C3_D\>>Makefile
-
- if ((%P%==PC98)|(%P%==PC98XA)) {
- HTERM_E_981_D\>>Makefile
- HTERM_E_982_D>>Makefile
- } else {
- # for AX, IBMPC and J3100
- HTERM_E_PC1_D\>>Makefile
- if (%P%==J3100)
- HTERM_E_J3_D>>Makefile
- else
- HTERM_E_PC2_D>>Makefile
- }
- terpri >>Makefile
-
- print HEOBJS = \>>Makefile
- HEMACS_E_C1_D\>>Makefile
- HEMACS_E_C2_D\>>Makefile
- HEMACS_E_C3_D\>>Makefile
-
- if ((%P%==PC98)|(%P%==PC98XA)) {
- HEMACS_E_981_D>>Makefile
- } else {
- HEMACS_E_PC1_D\>>Makefile
- if (%P%==J3100)
- HEMACS_E_J3_D>>Makefile
- else
- HEMACS_E_PC2_D>>Makefile
- }
- terpri >>Makefile
-
- if ((%M%==unix)|(%M%==gnu)) {
- #
- # for makes support .SUFFIXES (unix, gnu)
- #
- print .SUFFIXES:>>Makefile
- print .SUFFIXES: .exe .obj .asm .c>>Makefile
- terpri >>Makefile
- }
-
- print .c.obj:>>Makefile
- print $(CC) -c $(CFLAGS) $*.c>>Makefile
- terpri >>Makefile
-
- print .asm.obj:>>Makefile
- print $(ASM) $*.asm;>>Makefile
- terpri >>Makefile
-
- if ((%P%==PC98)|(%P%==PC98XA))
- ALL98_D >>Makefile
- else
- ALL_D >>Makefile
- terpri >>Makefile
-
- print hterm.exe: $(HTOBJS)>>Makefile
- switch (%P%==) {
- case PC98:
- print $(LD) @..\link\pc98%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.98>>Makefile
- case PC98XA:
- print $(LD) @..\link\pc98%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.xa>>Makefile
- case IBMPC:
- print $(LD) @..\link\ibmpc%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.pc>>Makefile
- case AX:
- print $(LD) @..\link\ibmpc%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.ax>>Makefile
- case J3100:
- print $(LD) @..\link\j3100%O%.%R% >>Makefile
- print copy hterm.exe ..\bin\hterm.j3>>Makefile
- }
- terpri >>Makefile
-
- print hemacs.exe: $(HEOBJS)>>Makefile
- switch (%P%==) {
- case PC98:
- print $(LD) @..\link\hemacs98.%R% >>Makefile
- print copy hemacs.exe ..\bin\hemacs.98>>Makefile
- case PC98XA:
- print $(LD) @..\link\hemacs98.%R% >>Makefile
- print copy hemacs.exe ..\bin\hemacs.xa>>Makefile
- case IBMPC:
- print $(LD) @..\link\hemacspc.%R% >>Makefile
- print copy hemacs.exe ..\bin\hemacs.pc>>Makefile
- case AX:
- print $(LD) @..\link\hemacspc.%R% >>Makefile
- print copy hemacs.exe ..\bin\hemacs.ax>>Makefile
- case J3100:
- print $(LD) @..\link\hemacsj3.%R% >>Makefile
- print copy hemacs.exe ..\bin\hemacs.j3>>Makefile
- }
- terpri >>Makefile
-
- if ((%P%==PC98) | (%P%==PC98XA)) {
- HKEY_E_D>>Makefile
- print %L% crt.obj+hkey98.obj,hkey.exe; >>Makefile
- if (%P%==PC98)
- print copy hkey.exe ..\bin\hkey.98>>Makefile
- else
- print copy hkey.exe ..\bin\hkey.xa>>Makefile
- terpri >>Makefile
-
- HKEYSET_E_D>>Makefile
- if (%D%==cl)
- print %C% -D%P% -Ox -Zp1 hkeyset.c>>Makefile
- else
- print %C% -D%P% -G -O -DMSDOS hkeyset.c>>Makefile
- if (%P%==PC98)
- print copy hkeyset.exe ..\bin\hkeyset.98>>Makefile
- else
- print copy hkeyset.exe ..\bin\hkeyset.xa>>Makefile
- terpri >>Makefile
- }
-
- INDEXER_EXE_D >>Makefile
- print $(CC) $(CFLAGS) indexer.c>>Makefile
- print copy indexer.exe ..\bin\indexer.exe>>Makefile
- terpri >>Makefile
-
- print clean:>>Makefile
- print -del hterm.exe>>Makefile
- print -del hkey.exe >>Makefile
- print -del hkeyset.exe >>Makefile
- print -del hemacs.exe >>Makefile
- print -del *.obj>>Makefile
- print -del indexer.exe>>Makefile
- terpri >>Makefile
-
- ANSI_O_D >>Makefile
- CONSOLE_O_D >>Makefile
- CRT_O_D >>Makefile
- EDIT_O_D >>Makefile
- FILE_O_D >>Makefile
- FONT_O_D >>Makefile
- HTERM_O_D >>Makefile
- HEMACS_O_D >>Makefile
- INDEXLIB_O_D >>Makefile
- KERMIT_O_D >>Makefile
- MSDOS_O_D >>Makefile
- PORT_O_D >>Makefile
- PRINTER_O_D >>Makefile
- SETUP_O_D >>Makefile
- UTILS_O_D >>Makefile
- XMODEM_O_D >>Makefile
- HEDIT_O_D >>Makefile
- if (%D%==cl)
- print %C% -c %F% -DHEMACS -Fohedit.obj edit.c>>Makefile
- else
- print %C% -c %F% -DHEMACS -ohedit.obj edit.c>>Makefile
- terpri >>Makefile
-
- if ((%P%==PC98) | (%P%==PC98XA)) {
- PC98_O_D >>Makefile
- KEY98_O_D >>Makefile
- SERDRV98_O_D >>Makefile
- VRAM98_O_D >>Makefile
- SAVER98_O_D >>Makefile
- PLOT_O_D >>Makefile
- GRAPH98_O_D >>Makefile
- GLIO98_O_D >>Makefile
- GLIOXA_O_D >>Makefile
- ICO_O_D >>Makefile
- HKEY98_O_D >>Makefile
- if (%D%==cl)
- print %C% -c -Ox -D%P% -DTSR -Fohkey98.obj key98.c>>Makefile
- else
- print %C% -c -mc -G -O -D%P% -DTSR -DMSDOS -ohkey98.obj key98.c>>Makefile
- terpri >>Makefile
- } else {
- IBMPC_O_D >>Makefile
- J3100_O_D >>Makefile
- KEYPC_O_D >>Makefile
- SERDRVPC_O_D >>Makefile
- VRAMPC_O_D >>Makefile
- VRAMJ3_O_D >>Makefile
- SAVERPC_O_D >>Makefile
- KEYDRVPC_O_D >>Makefile
- }
- }
-
- print done.
- print
-
- #
- # move makefile to src directory
- #
- !copy makefile src
- !del makefile
-
- #
- # move option.h to src directory
- #
- !copy option.h src
- !del option.h
-
-
- set F=make
- if ((%M%==dos) | (%M%==msc))
- set F=make Makefile
- else {
- if (%M%==gnu)
- set F=gmake
- else
- set F=make
- }
-
- print #########################################################
- print # Running make #
- print #########################################################
- print
- yesno "Run make to create hterm right now? [yn] "
- print
- if (ERRORLEVEL 255)
- print ... Type "%F%" in src directory to make hterm.
- else {
- print ... Running make.
- print
- !cd src
- !%F%
- !cd ..
- print
- if (ERRORLEVEL 1)
- print Alas! Failed to make hterm...
- else
- print Hterm has successfully made.
- }
-
- #-------------------------------------------------------------------*
- # end point for running make
- #-------------------------------------------------------------------*
-
- :END0
- !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
- IF (EXIST E.$)
- ask r < E.$
-
- :END1
- if (EXIST E.$)
- !DEL E.$
- if (EXIST S.$)
- !DEL S.$
- print
- print COMPILE is done. Good bye...
-
-
- rem *-------------------------------------------------------------------*
- rem ! end of all
- rem *-------------------------------------------------------------------*
- :exit
-