home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / COMM / MISC / SRC26_2.ZIP / BATCH / COMPILE.BJ < prev    next >
Encoding:
Text File  |  1990-07-13  |  31.8 KB  |  1,211 lines

  1. echo off
  2. bj -ew %0
  3. goto exit
  4. #                 (4 tab)
  5. #
  6. # compile.bj:    hterm compile program in structured batch syntax
  7. #
  8. # Edition history:
  9. #  1.1 Ohta.ricoh 89/06/00 creation
  10. #  1.2 Halca.Hirano 89/09/18
  11. #       1) if PC98XA use glioxa.c else use glio98.c
  12. #       2) set machine type to asm option
  13. #       3) add ICO_SAVER switch
  14. #       4) add X/YMODEM switch
  15. #  1.3 89/09/26 Halca.Hirano
  16. #       1) change asm /DAX to asm /AX_
  17. #  1.4 89/11/19 Halca.Hirano
  18. #          add J3100
  19. #  2.1 90/05/12 Halca.Hirano
  20. #        rewrite into structured batch syntax
  21. #  2.2 90/06/21 Halca.Hirano
  22. #        add soft font option
  23. #  2.3 90/07/02 Halca.Hirano
  24. #        add hemacs
  25. #  2.4 90/07/13 Halca.Hirano
  26. #        ask linker type
  27. #
  28. #  $Header: compile.bjv  1.3  90/06/30 22:26:18  hirano  Exp $
  29. #
  30. #
  31.  
  32. #
  33. # utility macros
  34. #
  35. define elif        "else if"
  36. define print    "!ECHO"
  37. define terpri    "!TYPE S.$"
  38. define rem        "!REM"
  39. define set        "!SET"
  40. define ask        "!bin\\batchcom"
  41. define number    "!bin\\batchcom 0"
  42. define yesno    "!bin\\batchcom 1"
  43.  
  44. #
  45. # dependency macros
  46. #
  47.  
  48. # exe files
  49. define INDEXER_EXE_D "print indexer.exe: indexer.c indexer.h"
  50. define HKEY_E_D        "print hkey.exe: crt.obj hkey98.obj"
  51. define HKEYSET_E_D    "print hkeyset.exe: hkeyset.c hkey.h keytab98.h config.h option.h default.h global.h version.h"
  52. define HTERM_E_C1_D    "print     hterm.obj ansi.obj console.obj edit.obj file.obj font.obj"
  53. define HTERM_E_C2_D    "print     indexlib.obj kermit.obj msdos.obj port.obj printer.obj"
  54. define HTERM_E_C3_D    "print     setup.obj utils.obj xmodem.obj"
  55. define HTERM_E_981_D "print     key98.obj pc98.obj saver98.obj serdrv98.obj vram98.obj"
  56. define HTERM_E_982_D "print     plot.obj ico.obj glio98.obj glioxa.obj graph98.obj"
  57. define HTERM_E_PC1_D "print     keypc.obj keydrvpc.obj saverpc.obj serdrvpc.obj"
  58. define HTERM_E_PC2_D "print     ibmpc.obj vrampc.obj"
  59. define HTERM_E_J3_D "print     j3100.obj vramj3.obj"
  60. define HEMACS_E_C1_D    "print     hemacs.obj ansi.obj console.obj hedit.obj file.obj font.obj"
  61. define HEMACS_E_C2_D    "print     indexlib.obj msdos.obj"
  62. define HEMACS_E_C3_D    "print     utils.obj"
  63. define HEMACS_E_981_D "print     key98.obj pc98.obj saver98.obj serdrv98.obj vram98.obj"
  64. define HEMACS_E_PC1_D "print     keypc.obj keydrvpc.obj saverpc.obj serdrvpc.obj"
  65. define HEMACS_E_PC2_D "print     ibmpc.obj vrampc.obj"
  66. define HEMACS_E_J3_D "print     j3100.obj vramj3.obj"
  67.  
  68. # obj files
  69. define ALL98_D        "print all: hterm.exe hkey.exe hkeyset.exe hemacs.exe"
  70. define ALL_D        "print all: hterm.exe hemacs.exe"
  71. define ANSI_O_D        "print ansi.obj: ansi.c config.h option.h default.h global.h"
  72. define CONSOLE_O_D    "print console.obj: console.c config.h option.h default.h global.h"
  73. define CRT_O_D        "print crt.obj: crt.asm"
  74. define EDIT_O_D        "print edit.obj: edit.c config.h option.h default.h global.h"
  75. define FILE_O_D        "print file.obj: file.c config.h option.h default.h global.h"
  76. define FONT_O_D        "print font.obj: font.c config.h option.h default.h global.h font.h"
  77. define GLIO98_O_D    "print glio98.obj: option.h glio98.c glio98.h"
  78. define GLIOXA_O_D    "print glioxa.obj: option.h glioxa.c"
  79. define GRAPH98_O_D    "print graph98.obj: graph98.c graph.h glio98.h"
  80. define HEDIT_O_D    "print hedit.obj: edit.c config.h option.h default.h global.h"
  81. define HKEY98_O_D    "print hkey98.obj: key98.c hterm.h config.h option.h default.h hkey.h global.h keytab98.h"
  82. define HEMACS_O_D    "print hemacs.obj: hemacs.c config.h option.h default.h global.h version.h"
  83. define HTERM_O_D    "print hterm.obj: hterm.c config.h option.h default.h global.h version.h"
  84. define IBMPC_O_D    "print ibmpc.obj: ibmpc.c config.h option.h default.h global.h"
  85. define ICO_O_D        "print ico.obj: ico.c hterm.h config.h option.h default.h global.h graph.h"
  86. define INDEXLIB_O_D    "print indexlib.obj: indexlib.c indexer.h"
  87. define J3100_O_D    "print j3100.obj: j3100.c hterm.h config.h option.h default.h global.h"
  88. define KERMIT_O_D    "print kermit.obj: kermit.c hterm.h config.h option.h default.h global.h"
  89. define KEY98_O_D    "print key98.obj: key98.c hterm.h config.h option.h default.h hkey.h global.h keytab98.h"
  90. define KEYDRVPC_O_D    "print keydrvpc.obj: keydrvpc.asm"
  91. define KEYOSK_O_D    "print keyosk.obj: keyosk.c hterm.h"
  92. define KEYPC_O_D    "print keypc.obj: keypc.c hterm.h keytabpc.h"
  93. define MSDOS_O_D    "print msdos.obj: msdos.c hterm.h config.h option.h default.h global.h"
  94. define PC98_O_D        "print pc98.obj: pc98.c hterm.h config.h option.h default.h global.h"
  95. define PLOT_O_D        "print plot.obj: plot.c graph.h"
  96. define PORT_O_D        "print port.obj: port.c hterm.h config.h option.h default.h global.h"
  97. define PRINTER_O_D    "print printer.obj: printer.c hterm.h config.h option.h default.h global.h"
  98. define SAVER98_O_D    "print saver98.obj: saver98.c hterm.h config.h option.h default.h global.h"
  99. define SAVERPC_O_D    "print saverpc.obj: saverpc.c hterm.h config.h option.h default.h global.h"
  100. define SERDRV98_O_D    "print serdrv98.obj: serdrv98.asm"
  101. define SERDRVPC_O_D    "print serdrvpc.obj: serdrvpc.asm"
  102. define SETUP_O_D    "print setup.obj: setup.c hterm.h config.h option.h default.h global.h version.h"
  103. define UTILS_O_D    "print utils.obj: utils.c hterm.h config.h option.h default.h global.h version.h indexer.h"
  104. define VRAM98_O_D    "print vram98.obj: vram98.asm"
  105. define VRAMJ3_O_D    "print vramj3.obj: vramj3.asm"
  106. define VRAMPC_O_D    "print vrampc.obj: vrampc.asm"
  107. define XMODEM_O_D    "print xmodem.obj: xmodem.c hterm.h config.h option.h default.h global.h"
  108.  
  109. #
  110. # global variables
  111. #
  112. # A asembler name and assembler option
  113. # C compiler name
  114. # F compile flag
  115. # M make name
  116. # P machine architecture
  117. #
  118.  
  119.  
  120. #
  121. # program begin
  122. #
  123. print OFF
  124. rem
  125. rem compile.bat: hterm compile program
  126. rem   (generated by Batch Jack; structured batch preprocessor)
  127. rem
  128.  
  129. if (X%DEBUG%==XON)
  130.     print ON
  131. !CLS
  132.  
  133. print #########################################################
  134. print #                                                       #
  135. print #     COMPILE.BAT - Makefile builder for hterm 2.6      #
  136. print #                                                       #
  137. print #                  Copyright (C) 1989 by Junn Ohta      #
  138. print #                                                       #
  139. print #########################################################
  140. print 
  141.  
  142. #
  143. # check functionality of batchcom.com
  144. #
  145. ask p > S.$
  146. if (NOT EXIST S.$) {
  147.     print 
  148.     print Can't execute 'BATCHCOM' needed for compilation procedure.
  149.     goto END1 
  150. }
  151.  
  152.  
  153. #
  154. # target machine and compiler check 
  155. #
  156. print 
  157. print Building Makefile from the combination of target machine,
  158. print compiler, assembler, make and optional facilities.
  159. print 
  160. print   * Target must be one of PC-9801, PC-98XA, AX, IBM-PC, J3100.
  161. print   * Compiler must be one of Microsoft C 5.1, Turbo C 1.5 / 2.0.
  162. print   * Assembler must be one of MASM 3.0 / 4.0 / 5.1, TASM1.0.
  163. print 
  164. yesno "Is your system listed above? [yn] "
  165. print 
  166. if (ERRORLEVEL 255) {
  167.     print ... Sorry, you can't make hterm.
  168.     goto END1 
  169. }
  170. print ... Gee, you got it!
  171. print 
  172.  
  173. #
  174. # check environment space
  175. #
  176. print #########################################################
  177. print #    Checking environment space            #
  178. print #########################################################
  179. print 
  180. print Checking whether enough space is left or not.
  181. print 
  182. ask e A C D F M O P > E.$
  183. !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
  184. set A=12345678901234
  185. set C=12345
  186. set D=12345
  187. set F=123456789012345678901234567890
  188. set O=123
  189. set L=1234567890
  190. set P=12345678
  191.  
  192. if (NOT X%P%==X12345678) {
  193.     !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
  194.     print ... There isn't enough space to work with.
  195.     print 
  196.     print COMPILE needs at least 100 bytes of free space.
  197.     print 
  198.     print If you are on MS-DOS 2.11, use some utility to extend
  199.     print environment space or unset some environment variables
  200.     print to get more space, then re-run COMPILE.
  201.     print 
  202.     print If you are on MS-DOS 3.1 or later, you can change the
  203.     print size of environment space (defaulted to 160 bytes) by
  204.     print placing SHELL command into CONFIG.SYS.  Unset some
  205.     print environment variables, or extend environment space as
  206.     print shown below and reset system, then re-run COMPILE.
  207.     print 
  208.     print = To set the size of environment space, e.g. to 320 bytes =
  209.     print 
  210.     print DOS 3.1:          SHELL=A:\COMMAND.COM A:\ /P /E:20
  211.     print DOS 3.2 or later: SHELL=A:\COMMAND.COM A:\ /P /E:320
  212.     goto END0 
  213. }
  214.  
  215. #
  216. # clear default parameters
  217. #
  218. !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
  219. print ... There seems enough environment space.
  220. print 
  221.  
  222. #
  223. # set target machine
  224. #
  225. set OK=F
  226. while (%OK%==F) {
  227.     print #########################################################
  228.     print #    Target machine                    #
  229.     print #########################################################
  230.     print 
  231.     print   1. PC-9801 or PC-286 series
  232.     print   2. PC-98XA
  233.     print   3. AX machine
  234.     print   4. IBM-PC or clone
  235.     print   5. J3100 series
  236.     print 
  237.  
  238.     number "Which machine do you have? [12345] "
  239.     print 
  240.     switch (ERRORLEVEL) {
  241.         case 5:
  242.             if (ERRORLEVEL 6)
  243.                 goto macherr
  244.             print ... Target machine is J3100 series.
  245.             set P=J3100
  246.         case 4:
  247.             print ... Target machine is IBM-PC or clone.
  248.             set P=IBMPC
  249.         case 3:
  250.             print ... Target machine is AX.
  251.             set P=AX
  252.         case 2:
  253.             print ... Target machine is PC-98XA.
  254.             set P=PC98XA
  255.         case 1:
  256.             print ... Target machine is PC-9801 or PC-286 series.
  257.             set P=PC98
  258.         default:
  259. :macherr
  260.             continue 
  261.     }
  262.  
  263.     print 
  264.     yesno "Is this ok? [yn] "
  265.     print 
  266.     if (NOT ERRORLEVEL 255)
  267.         set OK=T
  268. }
  269.         
  270. print 
  271.  
  272. #
  273. # set compiler type
  274. #
  275. set OK=F
  276. while (%OK%==F) {
  277.     print #########################################################
  278.     print #    Compiler                    #
  279.     print #########################################################
  280.     print 
  281.     print   1. Microsoft C 5.1 / 6.0
  282.     print   2. Turbo C 1.5 / 2.0
  283.     print 
  284.     print If you have both of compilers, type '1'.
  285.     print 
  286.     number "Which compiler do you have? [12] "
  287.     print 
  288.     switch (ERRORLEVEL) {
  289.     case 2:
  290.         if (ERRORLEVEL 3)
  291.             goto comerr
  292.         print ... Compiler is Turbo C 1.5 or 2.0.
  293.         set C=tcc
  294.         set F=-mm -O -G -d -DMSDOS -D%P%
  295.     case 1:
  296.         print ... Compiler is Microsoft C 5.1.
  297.         set C=cl
  298.         set F=-AM -Ox -Zp -D%P%
  299.     default:
  300. :comerr
  301.         continue
  302.     }
  303.  
  304.     print 
  305.     yesno "Is this ok? [yn] "
  306.     print 
  307.     if (NOT ERRORLEVEL 255)
  308.         set OK=T
  309. }
  310.  
  311. #
  312. # set assembler type
  313. #
  314. set OK=F
  315. while (%OK%==F) {
  316.     print #########################################################
  317.     print #    Assembler                    #
  318.     print #########################################################
  319.     print 
  320.     print   1. MASM 3.0 / 4.0 / 5.1
  321.     print   2. TASM 1.0
  322.     print 
  323.     number "Which assembler do you have? [12] "
  324.     print 
  325.     switch (ERRORLEVEL) {
  326.     case 2:
  327.         if (ERRORLEVEL 3)
  328.             goto asmerr
  329.         print ... Assembler is TASM 1.0.
  330.         if (%P%==AX)
  331.             set A=tasm /mx /DAX_
  332.         else
  333.             set A=tasm /mx /D%P%
  334.     case 1:
  335.         print ... Assembler is MASM 3.0, 4.0 or 5.1.
  336.         if (%P%==AX)
  337.             set A=masm /MX /DAX_
  338.         else
  339.             set A=masm /MX /D%P%
  340.     default:
  341. :asmerr
  342.         continue 
  343.     }
  344.  
  345.     print 
  346.     yesno "Is this ok? [yn] "
  347.     print 
  348.     if (NOT ERRORLEVEL 255)
  349.         set OK=T
  350. }
  351.  
  352. #
  353. # set linker type
  354. #
  355. set OK=F
  356. while (%OK%==F) {
  357.     print #########################################################
  358.     print #    linker                    #
  359.     print #########################################################
  360.     print 
  361.     print   1. Microsoft Linker (You can use overlay.)
  362.     print   2. Turbo Linker (You can't use overlay.)
  363.     print 
  364.     number "Which linker do you have? [12] "
  365.     print 
  366.     switch (ERRORLEVEL) {
  367.     case 2:
  368.         if (ERRORLEVEL 3)
  369.             goto linerr
  370.         print ... Linker is Turbo Link.
  371.         set L=tlink /c
  372.         set R=tlk
  373.     case 1:
  374.         print ... Linker is Microsoft Link.
  375.         set L=link /NOI
  376.         set R=mlk
  377.     default:
  378. :linerr
  379.         continue
  380.     }
  381.  
  382.     print 
  383.     yesno "Is this ok? [yn] "
  384.     print 
  385.     if (NOT ERRORLEVEL 255)
  386.         set OK=T
  387. }
  388.  
  389. #
  390. # set make type
  391. #
  392. set OK=F
  393. while (%OK%==F) {
  394.     print #########################################################
  395.     print #    Make                        #
  396.     print #########################################################
  397.     print 
  398.     print   1. MS-MAKE (in MS-DOS)        (can't use comment, macro)
  399.     print   2. MS-MAKE (in Microsoft C)   (target order is fixed)
  400.     print   3. KAO make                   (can't redefine .c.obj)
  401.     print   4. Turbo Make                 (.SUFFIXES not supported)
  402.     print   5. NDMAKE, GY make, PolyMake  (and other unix-like makes)
  403.     print   6. GNU Make                   (unix-like, but named as 'gmake')
  404.     print 
  405.     number "Which make do you have? [123456] "
  406.     print 
  407.     switch (ERRORLEVEL) {
  408.     case 6:
  409.         if (ERRORLEVEL 7)
  410.             goto makeerr
  411.         print ... Make is GNU Make
  412.         set M=gnu
  413.     case 5:
  414.         print ... Make is NDMAKE, GY make, PolyMake (or another unix-like make).
  415.         set M=unix
  416.     case 4:
  417.         print ... Make is Turbo Make.
  418.         set M=turbo
  419.     case 3:
  420.         print ... Make is the KAO make.
  421.         set M=kao
  422.     case 2:
  423.         print ... Make is Microsoft MAKE in Microsoft C.
  424.         set M=msc
  425.     case 1:
  426.         print ... Make is Microsoft MAKE in MS-DOS.
  427.         set M=dos
  428.     default:
  429. :makeerr
  430.         continue 
  431.     }
  432.  
  433.     print 
  434.     yesno "Is this ok? [yn] "
  435.     print 
  436.     if (NOT ERRORLEVEL 255)
  437.         set OK=T
  438. }
  439.  
  440. #
  441. # set compile time options
  442. #
  443.  
  444. # default options
  445. #
  446. print #########################################################
  447. print #    Optional facilities                #
  448. print #########################################################
  449.  
  450. print /* generated by compile.bat */ >option.h
  451.  
  452. print 
  453. print You can include optional facilities as below:
  454. print 
  455. print   * SET-UP
  456. print   * NEC Kanji
  457. print   * MOUSE
  458. print   * BS Key Watcher
  459. print   * KERMIT file transfer
  460. print   * X/YMODEM file transfer
  461. print   * History editor
  462. print   * Soft font
  463. if ((%P%==PC98)|(%P%==PC98XA)) {
  464.     print   * Graphics code from University of Osaka pref. (UOP_GRAPHICS)
  465.     print   * Special screen saver (need UOP_GRAPHICS)
  466. }
  467. if (%R%==mlk)
  468.     print   * Overlay
  469.  
  470. #
  471. # ask
  472. #
  473. print 
  474. print Set-Up is used to make settings of hterm.
  475. print I strongly recommend to type 'y' unless you are making mimimum hterm.
  476. print 
  477. yesno "Do you include Set-Up? [yn] "
  478. print 
  479. if (NOT ERRORLEVEL 255) {
  480.     print ... Include Set-Up.
  481.     print #define SETUP >>option.h
  482. } else {
  483.     print ... Do not include Set-Up.
  484. }
  485.  
  486. print 
  487. print NEC kanji sequence is used to connect ACOS system.
  488. print My recommendation is 'n'.
  489. print 
  490. yesno "Do you include NEC kanji? [yn] "
  491. print 
  492. if (NOT ERRORLEVEL 255) {
  493.     print ... Include NEC kanji.
  494.     print #define NEC_KANJI >>option.h
  495. } else {
  496.     print ... Do not include NEC kanji.
  497. }
  498.  
  499. print 
  500. print hterm can be controled by mouse.
  501. print My recommendation is 'y'.
  502. print 
  503. yesno "Do you include mouse? [yn] "
  504. print 
  505. if (NOT ERRORLEVEL 255) {
  506.     print ... Include mouse.
  507.     print #define MOUSE >>option.h
  508. } else {
  509.     print ... Do not include mouse.
  510. }
  511.  
  512. print 
  513. print BS key watcher is a friend of hard worker.
  514. print BS key watcher warns you when you are fatigued with your work.
  515. print If you are a hard worker, type 'y' 
  516. print 
  517. yesno "Do you include BS key watcher? [yn] "
  518. print 
  519. if (NOT ERRORLEVEL 255) {
  520.     print ... Include BS key watcher.
  521.     print #define BS_WATCHER >>option.h
  522. } else {
  523.     print ... Do not include BS key watcher.
  524. }
  525.  
  526. print 
  527. print kermit is a popular file transfer protocol.
  528. print 
  529. yesno "Do you include KERMIT file transfer? [yn] "
  530. print 
  531. if (NOT ERRORLEVEL 255) {
  532.     print ... Include KERMIT file transfer.
  533.     print #define KERMIT >>option.h
  534. } else {
  535.     print ... Do not include KERMIT file transfer.
  536. }
  537.  
  538. print 
  539. print X/YMODEM is also a popular file transfer protocol.
  540. print 
  541. print 
  542. yesno "Do you include X/YMODEM file transfer? [yn] "
  543. print 
  544. if (NOT ERRORLEVEL 255) {
  545.     print ... Include X/YMODEM file transfer.
  546.     print #define XMODEM >>option.h
  547. } else {
  548.     print ... Do not include X/YMODEM file transfer.
  549. }
  550.  
  551. print 
  552. print History editor allows you to view session history and it provides
  553. print editing or pasting.
  554. print 
  555. yesno "Do you include history editor? [yn] "
  556. print 
  557. if (NOT ERRORLEVEL 255) {
  558.     print #define COPY_PASTE >>option.h
  559.     print ... Include history editor.
  560. } else {
  561.     print ... Do not include history editor.
  562. }
  563.  
  564. print 
  565. print Soft font allows you to display Japanese even if you are using IBM PC.
  566. print Soft font can be used with EGA or VGA.
  567. print On other machines (PC98xx/AX/J3100..) this is just a memory consuming stuff.
  568. print 
  569. yesno "Do you include soft font? [yn] "
  570. print 
  571. if (NOT ERRORLEVEL 255) {
  572.     print #define SOFT_FONT >>option.h
  573.     print ... Include soft font.
  574. } else {
  575.     print ... Do not include soft font.
  576. }
  577.  
  578. if ((%P%==PC98)|(%P%==PC98XA)) {
  579.     print 
  580.     print Graphics allows you to make graphs by plot command on your unix.
  581.     print Ico screen saver needs graphics code.
  582.     print 
  583.     yesno "Do you include graphics? [yn] "
  584.     print 
  585.     if (NOT ERRORLEVEL 255) {
  586.         print #define UOP_GRAPHICS >>option.h
  587.         print ... Include graphics.
  588.         if (%C%==tcc) {
  589.             set F=%F% -f
  590.         }
  591.         print 
  592.         yesno "Do you include special screen saver? [yn] "
  593.         print 
  594.         if (NOT ERRORLEVEL 255) {
  595.             print #define ICO_SAVER >>option.h
  596.             print ... Include special screen saver.
  597.         } else {
  598.             print ... Do not include special screen saver.
  599.         }
  600.     } else {
  601.         print ... Do not include graphics code.
  602.         if (%C%==tcc)
  603.             set F=%F% -f-
  604.     }
  605. # else IBM-PC/AX/J3100
  606. } else {
  607.     if (%C%==tcc)
  608.         set F=%F% -f-
  609. }
  610.  
  611. set O=
  612. if (%R%==mlk) {
  613.     print 
  614.     print Overlay saves memory. But you can not use lzexe.
  615.     print I recommend to type 'n' unless you use lots of funcy TSRs.
  616.     print 
  617.     yesno "Do you like overlay? [yn] "
  618.     print 
  619.     if (NOT ERRORLEVEL 255) {
  620.         set O=ov
  621.         print #define OVERLAY >>option.h
  622.         print ... Overlay.
  623.     } else {
  624.         set O=
  625.         print ... No overlay.
  626.     }
  627. }
  628. print 
  629.  
  630. #
  631. #
  632. # generating makefile
  633. #
  634. #
  635. ask n "Mocking up a Makefile ... "
  636. if (EXIST Makefile) {
  637.     !DEL Makefile
  638. }
  639. if (EXIST "src\\*.obj")
  640.     !del src\*.obj
  641.  
  642. #
  643. # comments and macros for non-dos makes
  644. #
  645. if (NOT %M%==dos) {
  646.     print #########################################################>>Makefile
  647.     print #                            #>>Makefile
  648.     print #    Makefile - Makefile for hterm 2.6        #>>Makefile
  649.     print #                            #>>Makefile
  650.     print #    ============== C A U T I O N ==============    #>>Makefile
  651.     print #    Since this file is generated by COMPILE.BAT,    #>>Makefile
  652.     print #    all changes you will make to this file will    #>>Makefile
  653.     print #    silently GO AWAY!                #>>Makefile
  654.     print #                            #>>Makefile
  655.     print #########################################################>>Makefile
  656.     terpri >>Makefile
  657.     print CC    = %C%>>Makefile
  658.     print LD    = %L%>>Makefile
  659.     print ASM    = %A%>>Makefile
  660.     print CFLAGS    = %F%>>Makefile
  661.     terpri >>Makefile
  662.     set D=%C%
  663.     set C=$(CC)
  664.     set A=$(ASM)
  665.     set L=$(LD)
  666.     set F=$(CFLAGS)
  667. }
  668.  
  669. #
  670. # final target for kao make
  671. #
  672. if (%M%==kao) {
  673.     if ((%P%==PC98)|(%P%==PC98XA))
  674.         ALL98_D >>Makefile
  675.     else
  676.         ALL_D >>Makefile
  677.     terpri >>Makefile
  678. }
  679.  
  680. #
  681. # make *.obj on non unix make
  682. #
  683. if ((%M%==dos)|(%M%==msc)|(%M%==kao)) {
  684.     #-------------------------------------------------------------------*
  685.     #  all for makes which don't allow .c.obj (dos, msc, kao)
  686.     #-------------------------------------------------------------------*
  687.  
  688.     ANSI_O_D >>Makefile
  689.     print     %C% -c %F% ansi.c>>Makefile
  690.     terpri >>Makefile
  691.  
  692.     CONSOLE_O_D >>Makefile
  693.     print     %C% -c %F% console.c>>Makefile
  694.     terpri >>Makefile
  695.  
  696.     EDIT_O_D >>Makefile
  697.     print     %C% -c %F% edit.c>>Makefile
  698.     terpri >>Makefile
  699.  
  700.     FILE_O_D >>Makefile
  701.     print     %C% -c %F% file.c>>Makefile
  702.     terpri >>Makefile
  703.  
  704.     FONT_O_D >>Makefile
  705.     print     %C% -c %F% font.c>>Makefile
  706.     terpri >>Makefile
  707.  
  708.     HEDIT_O_D >>Makefile
  709.     if (%D%==cl)
  710.         print     %C% -c %F% -DHEMACS -Fohedit.obj edit.c>>Makefile
  711.     else
  712.         print     %C% -c %F% -DHEMACS -ohedit.obj edit.c>>Makefile
  713.     terpri >>Makefile
  714.  
  715.     HEMACS_O_D >>Makefile
  716.     print     %C% -c %F% hemacs.c>>Makefile
  717.     terpri >>Makefile
  718.  
  719.     HTERM_O_D >>Makefile
  720.     print     %C% -c %F% hterm.c>>Makefile
  721.     terpri >>Makefile
  722.  
  723.     INDEXLIB_O_D >>Makefile
  724.     print     %C% -c %F% indexlib.c>>Makefile
  725.     terpri >>Makefile
  726.  
  727.     KERMIT_O_D >>Makefile
  728.     print     %C% -c %F% kermit.c>>Makefile
  729.     terpri >>Makefile
  730.  
  731.     MSDOS_O_D >>Makefile
  732.     print     %C% -c %F% msdos.c>>Makefile
  733.     terpri >>Makefile
  734.  
  735.     PORT_O_D >>Makefile
  736.     print     %C% -c %F% port.c>>Makefile
  737.     terpri >>Makefile
  738.  
  739.     PRINTER_O_D >>Makefile
  740.     print     %C% -c %F% printer.c>>Makefile
  741.     terpri >>Makefile
  742.  
  743.     SETUP_O_D >>Makefile
  744.     print     %C% -c %F% setup.c>>Makefile
  745.     terpri >>Makefile
  746.  
  747.     UTILS_O_D >>Makefile
  748.     print     %C% -c %F% utils.c>>Makefile
  749.     terpri >>Makefile
  750.  
  751.     XMODEM_O_D >>Makefile
  752.     print     %C% -c %F% xmodem.c>>Makefile
  753.     terpri >>Makefile
  754.  
  755.     if ((%P%==PC98)|(%P%==PC98XA)) {
  756.         #
  757.         # PC98, PC98XA
  758.         #
  759.         CRT_O_D >>Makefile
  760.         print     %A% crt.asm;>>Makefile
  761.         terpri >>Makefile
  762.  
  763.         GLIO98_O_D >>Makefile
  764.         print     %C% -c %F% glio98.c>>Makefile
  765.         terpri >>Makefile
  766.  
  767.         GLIOXA_O_D >>Makefile
  768.         print     %C% -c %F% glioxa.c>>Makefile
  769.         terpri >>Makefile
  770.  
  771.         GRAPH98_O_D >>Makefile
  772.         print     %C% -c %F% graph98.c>>Makefile
  773.         terpri >>Makefile
  774.  
  775.         KEY98_O_D >>Makefile
  776.         print     %C% -c %F% key98.c>>Makefile
  777.         terpri >>Makefile
  778.  
  779.         HKEY98_O_D >>Makefile
  780.         if (%D%==cl)
  781.             print     %C% -c -Ox -D%P% -DTSR -Fohkey98.obj key98.c>>Makefile
  782.         else
  783.             print     %C% -c -mc -G -O -D%P% -DTSR -DMSDOS -ohkey98.obj key98.c>>Makefile
  784.         terpri >>Makefile
  785.  
  786.         HKEY_E_D >>Makefile
  787.         print     %L% crt.obj+hkey98.obj,hkey.exe; >>Makefile
  788.         if (%P%==PC98)
  789.             print     copy hkey.exe ..\bin\hkey.98>>Makefile
  790.         else
  791.             print     copy hkey.exe ..\bin\hkey.xa>>Makefile
  792.         terpri >>Makefile
  793.  
  794.         HKEYSET_E_D >>Makefile
  795.         if (%D%==cl)
  796.             print     %C% -D%P% -Ox -Zp1 hkeyset.c>>Makefile
  797.         else
  798.             print     %C% -D%P% -G -O -DMSDOS  hkeyset.c>>Makefile
  799.         if (%P%==PC98)
  800.             print     copy hkeyset.exe ..\bin\hkeyset.98>>Makefile
  801.         else
  802.             print     copy hkeyset.exe ..\bin\hkeyset.xa>>Makefile
  803.         terpri >>Makefile
  804.  
  805.         ICO_O_D >>Makefile
  806.         print     %C% -c %F% ico.c>>Makefile
  807.         terpri >>Makefile
  808.  
  809.         PC98_O_D >>Makefile
  810.         print     %C% -c %F% pc98.c>>Makefile
  811.         terpri >>Makefile
  812.  
  813.         PLOT_O_D >>Makefile
  814.         print     %C% -c %F% plot.c>>Makefile
  815.         terpri >>Makefile
  816.  
  817.         SAVER98_O_D >>Makefile
  818.         print     %C% -c %F% saver98.c>>Makefile
  819.         terpri >>Makefile
  820.  
  821.         SERDRV98_O_D >>Makefile
  822.         print     %A% serdrv98.asm;>>Makefile
  823.         terpri >>Makefile
  824.  
  825.         VRAM98_O_D >>Makefile
  826.         print     %A% vram98.asm;>>Makefile
  827.         terpri >>Makefile
  828.  
  829.         print hemacs.exe: \>>Makefile
  830.         HEMACS_E_C1_D\>>Makefile
  831.         HEMACS_E_C2_D\>>Makefile
  832.         HEMACS_E_C3_D\>>Makefile
  833.         HEMACS_E_981_D>>Makefile
  834.         print     %L% @..\link\hemacs98.%R%>>Makefile
  835.         if (%P%==PC98)
  836.             print     copy hemacs.exe ..\bin\hemacs.98>>Makefile
  837.         else
  838.             print     copy hemacs.exe ..\bin\hemacs.xa>>Makefile
  839.         terpri >>Makefile
  840.  
  841.         print hterm.exe: \>>Makefile
  842.         HTERM_E_C1_D\>>Makefile
  843.         HTERM_E_C2_D\>>Makefile
  844.         HTERM_E_C3_D\>>Makefile
  845.         HTERM_E_981_D\>>Makefile
  846.         HTERM_E_982_D>>Makefile
  847.         print     %L% @..\link\pc98%O%.%R%>>Makefile
  848.         if (%P%==PC98)
  849.             print     copy hterm.exe ..\bin\hterm.98>>Makefile
  850.         else
  851.             print     copy hterm.exe ..\bin\hterm.xa>>Makefile
  852.         terpri >>Makefile
  853.     } else {
  854.         #
  855.         # IBM-PC, AX, J3100
  856.         #
  857.         if (%P%==J3100) {
  858.             J3100_O_D >>Makefile
  859.             print     %C% -c %F% j3100.c>>Makefile
  860.             terpri >>Makefile
  861.  
  862.             VRAMJ3_O_D >>Makefile
  863.             print     %A% vramj3.asm;>>Makefile
  864.             terpri >>Makefile
  865.         } else {
  866.             IBMPC_O_D >>Makefile
  867.             print     %C% -c %F% ibmpc.c>>Makefile
  868.             terpri >>Makefile
  869.  
  870.             VRAMPC_O_D >>Makefile
  871.             print     %A% vrampc.asm;>>Makefile
  872.             terpri >>Makefile
  873.         }
  874.         KEYPC_O_D >>Makefile
  875.         print     %C% -c %F% keypc.c>>Makefile
  876.         terpri >>Makefile
  877.  
  878.         SAVERPC_O_D >>Makefile
  879.         print     %C% -c %F% saverpc.c>>Makefile
  880.         terpri >>Makefile
  881.  
  882.         SERDRVPC_O_D >>Makefile
  883.         print     %A% serdrvpc.asm;>>Makefile
  884.         terpri >>Makefile
  885.  
  886.         KEYDRVPC_O_D >>Makefile
  887.         print     %A% keydrvpc.asm;>>Makefile
  888.         terpri >>Makefile
  889.  
  890.         
  891.         print hemacs.exe: \>>Makefile
  892.         HEMACS_E_C1_D\>>Makefile
  893.         HEMACS_E_C2_D\>>Makefile
  894.         HEMACS_E_C3_D\>>Makefile
  895.         HEMACS_E_PC1_D\>>Makefile
  896.         switch (%P%==) {
  897.         case J3100:
  898.             HEMACS_E_J3_D>>Makefile
  899.             print     %L% @..\link\hemacsj3.%R%>>Makefile
  900.             print     copy hemacs.exe ..\bin\hemacs.j3>>Makefile
  901.         case AX:
  902.             HEMACS_E_PC2_D>>Makefile
  903.             print     %L% @..\link\hemacspc.%R%>>Makefile
  904.             print     copy hemacs.exe ..\bin\hemacs.ax>>Makefile
  905.         case IBMPC:
  906.             HEMACS_E_PC2_D>>Makefile
  907.             print     %L% @..\link\hemacspc.%R%>>Makefile
  908.             print     copy hemacs.exe ..\bin\hemacs.pc>>Makefile
  909.         }
  910.         terpri >>Makefile
  911.  
  912.         print hterm.exe: \>>Makefile
  913.         HTERM_E_C1_D\>>Makefile
  914.         HTERM_E_C2_D\>>Makefile
  915.         HTERM_E_C3_D\>>Makefile
  916.         HTERM_E_PC1_D\>>Makefile
  917.         switch (%P%==) {
  918.         case J3100:
  919.             HTERM_E_J3_D>>Makefile
  920.             print     %L% @..\link\j3100%O%.%R% >>Makefile
  921.             print     copy hterm.exe ..\bin\hterm.j3>>Makefile
  922.         case AX:
  923.             HTERM_E_PC2_D>>Makefile
  924.             print     %L% @..\link\ibmpc%O%.%R% >>Makefile
  925.             print     copy hterm.exe ..\bin\hterm.ax>>Makefile
  926.         case IBMPC:
  927.             HTERM_E_PC2_D>>Makefile
  928.             print     %L% @..\link\ibmpc%O%.%R% >>Makefile
  929.             print     copy hterm.exe ..\bin\hterm.pc>>Makefile
  930.         }
  931.         terpri >>Makefile
  932.     }
  933.     INDEXER_EXE_D >>Makefile
  934.     print     %C% %F% indexer.c>>Makefile
  935.     print     copy indexer.exe ..\bin\indexer.exe>>Makefile
  936.     terpri >>Makefile
  937.  
  938.     if (%M%==kao) {
  939.         #
  940.         # clean for kao make
  941.         #
  942.         terpri >>Makefile
  943.         print clean:>>Makefile
  944.         print     command /C if EXIST hterm.exe   del hterm.exe>>Makefile
  945.         print     command /C if EXIST hkey.exe   del hkey.exe>>Makefile
  946.         print     command /C if EXIST hkeyset.exe   del hkeyset.exe>>Makefile
  947.         print     command /C if EXIST hemacs.exe   del hemacs.exe>>Makefile
  948.         print     command /C if EXIST *.obj       del *.obj>>Makefile
  949.         print     command /C if EXIST indexer.exe del indexer.exe>>Makefile
  950.     }
  951.     #
  952.     #  end point for non-unix makes
  953.     #
  954. } else {
  955.     #
  956.     # unix-like make
  957.     #
  958.     print HTOBJS = \>>Makefile
  959.     HTERM_E_C1_D\>>Makefile
  960.     HTERM_E_C2_D\>>Makefile
  961.     HTERM_E_C3_D\>>Makefile
  962.     
  963.     if ((%P%==PC98)|(%P%==PC98XA)) {
  964.         HTERM_E_981_D\>>Makefile
  965.         HTERM_E_982_D>>Makefile
  966.     } else {
  967.         #  for AX, IBMPC and J3100
  968.         HTERM_E_PC1_D\>>Makefile
  969.         if (%P%==J3100)
  970.             HTERM_E_J3_D>>Makefile
  971.         else
  972.             HTERM_E_PC2_D>>Makefile
  973.     }
  974.     terpri >>Makefile
  975.  
  976.     print HEOBJS = \>>Makefile
  977.     HEMACS_E_C1_D\>>Makefile
  978.     HEMACS_E_C2_D\>>Makefile
  979.     HEMACS_E_C3_D\>>Makefile
  980.     
  981.     if ((%P%==PC98)|(%P%==PC98XA)) {
  982.         HEMACS_E_981_D>>Makefile
  983.     } else {
  984.         HEMACS_E_PC1_D\>>Makefile
  985.         if (%P%==J3100)
  986.             HEMACS_E_J3_D>>Makefile
  987.         else
  988.             HEMACS_E_PC2_D>>Makefile
  989.     }
  990.     terpri >>Makefile
  991.  
  992.     if ((%M%==unix)|(%M%==gnu)) {
  993.         #
  994.         # for makes support .SUFFIXES (unix, gnu)
  995.         #
  996.         print .SUFFIXES:>>Makefile
  997.         print .SUFFIXES: .exe .obj .asm .c>>Makefile
  998.         terpri >>Makefile
  999.     }
  1000.  
  1001.     print .c.obj:>>Makefile
  1002.     print     $(CC) -c $(CFLAGS) $*.c>>Makefile
  1003.     terpri >>Makefile
  1004.  
  1005.     print .asm.obj:>>Makefile
  1006.     print     $(ASM) $*.asm;>>Makefile
  1007.     terpri >>Makefile
  1008.  
  1009.     if ((%P%==PC98)|(%P%==PC98XA))
  1010.         ALL98_D >>Makefile
  1011.     else
  1012.         ALL_D >>Makefile
  1013.     terpri >>Makefile
  1014.  
  1015.     print hterm.exe: $(HTOBJS)>>Makefile
  1016.     switch (%P%==) {
  1017.         case PC98:
  1018.             print     $(LD) @..\link\pc98%O%.%R% >>Makefile
  1019.             print     copy hterm.exe ..\bin\hterm.98>>Makefile
  1020.         case PC98XA:
  1021.             print     $(LD) @..\link\pc98%O%.%R% >>Makefile
  1022.             print     copy hterm.exe ..\bin\hterm.xa>>Makefile
  1023.         case IBMPC:
  1024.             print     $(LD) @..\link\ibmpc%O%.%R% >>Makefile
  1025.             print     copy hterm.exe ..\bin\hterm.pc>>Makefile
  1026.         case AX:
  1027.             print     $(LD) @..\link\ibmpc%O%.%R% >>Makefile
  1028.             print     copy hterm.exe ..\bin\hterm.ax>>Makefile
  1029.         case J3100:
  1030.             print     $(LD) @..\link\j3100%O%.%R% >>Makefile
  1031.             print     copy hterm.exe ..\bin\hterm.j3>>Makefile
  1032.     }
  1033.     terpri >>Makefile
  1034.  
  1035.     print hemacs.exe: $(HEOBJS)>>Makefile
  1036.     switch (%P%==) {
  1037.         case PC98:
  1038.             print     $(LD) @..\link\hemacs98.%R% >>Makefile
  1039.             print     copy hemacs.exe ..\bin\hemacs.98>>Makefile
  1040.         case PC98XA:
  1041.             print     $(LD) @..\link\hemacs98.%R% >>Makefile
  1042.             print     copy hemacs.exe ..\bin\hemacs.xa>>Makefile
  1043.         case IBMPC:
  1044.             print     $(LD) @..\link\hemacspc.%R% >>Makefile
  1045.             print     copy hemacs.exe ..\bin\hemacs.pc>>Makefile
  1046.         case AX:
  1047.             print     $(LD) @..\link\hemacspc.%R% >>Makefile
  1048.             print     copy hemacs.exe ..\bin\hemacs.ax>>Makefile
  1049.         case J3100:
  1050.             print     $(LD) @..\link\hemacsj3.%R% >>Makefile
  1051.             print     copy hemacs.exe ..\bin\hemacs.j3>>Makefile
  1052.     }
  1053.     terpri >>Makefile
  1054.  
  1055.     if ((%P%==PC98) | (%P%==PC98XA)) {
  1056.         HKEY_E_D>>Makefile
  1057.         print     %L% crt.obj+hkey98.obj,hkey.exe; >>Makefile
  1058.         if (%P%==PC98)
  1059.             print     copy hkey.exe ..\bin\hkey.98>>Makefile
  1060.         else
  1061.             print     copy hkey.exe ..\bin\hkey.xa>>Makefile
  1062.         terpri >>Makefile
  1063.  
  1064.         HKEYSET_E_D>>Makefile
  1065.         if (%D%==cl)
  1066.             print     %C% -D%P% -Ox -Zp1 hkeyset.c>>Makefile
  1067.         else
  1068.             print     %C% -D%P% -G -O -DMSDOS hkeyset.c>>Makefile
  1069.         if (%P%==PC98)
  1070.             print     copy hkeyset.exe ..\bin\hkeyset.98>>Makefile
  1071.         else
  1072.             print     copy hkeyset.exe ..\bin\hkeyset.xa>>Makefile
  1073.         terpri >>Makefile
  1074.     }
  1075.         
  1076.     INDEXER_EXE_D >>Makefile
  1077.     print     $(CC) $(CFLAGS) indexer.c>>Makefile
  1078.     print     copy indexer.exe ..\bin\indexer.exe>>Makefile
  1079.     terpri >>Makefile
  1080.  
  1081.     print clean:>>Makefile
  1082.     print     -del hterm.exe>>Makefile
  1083.     print     -del hkey.exe >>Makefile
  1084.     print     -del hkeyset.exe >>Makefile
  1085.     print     -del hemacs.exe >>Makefile
  1086.     print     -del *.obj>>Makefile
  1087.     print     -del indexer.exe>>Makefile
  1088.     terpri >>Makefile
  1089.  
  1090.     ANSI_O_D >>Makefile
  1091.     CONSOLE_O_D >>Makefile
  1092.     CRT_O_D >>Makefile
  1093.     EDIT_O_D >>Makefile
  1094.     FILE_O_D >>Makefile
  1095.     FONT_O_D >>Makefile
  1096.     HTERM_O_D >>Makefile
  1097.     HEMACS_O_D >>Makefile
  1098.     INDEXLIB_O_D >>Makefile
  1099.     KERMIT_O_D >>Makefile
  1100.     MSDOS_O_D >>Makefile
  1101.     PORT_O_D >>Makefile
  1102.     PRINTER_O_D >>Makefile
  1103.     SETUP_O_D >>Makefile
  1104.     UTILS_O_D >>Makefile
  1105.     XMODEM_O_D >>Makefile
  1106.     HEDIT_O_D >>Makefile
  1107.     if (%D%==cl)
  1108.         print     %C% -c %F% -DHEMACS -Fohedit.obj edit.c>>Makefile
  1109.     else
  1110.         print     %C% -c %F% -DHEMACS -ohedit.obj edit.c>>Makefile
  1111.     terpri >>Makefile
  1112.  
  1113.     if ((%P%==PC98) | (%P%==PC98XA)) {
  1114.         PC98_O_D >>Makefile
  1115.         KEY98_O_D >>Makefile
  1116.         SERDRV98_O_D >>Makefile
  1117.         VRAM98_O_D >>Makefile
  1118.         SAVER98_O_D >>Makefile
  1119.         PLOT_O_D >>Makefile
  1120.         GRAPH98_O_D >>Makefile
  1121.         GLIO98_O_D >>Makefile
  1122.         GLIOXA_O_D >>Makefile
  1123.         ICO_O_D >>Makefile
  1124.         HKEY98_O_D >>Makefile
  1125.         if (%D%==cl)
  1126.             print     %C% -c -Ox -D%P% -DTSR -Fohkey98.obj key98.c>>Makefile
  1127.         else
  1128.             print     %C% -c -mc -G -O -D%P% -DTSR -DMSDOS -ohkey98.obj key98.c>>Makefile
  1129.         terpri >>Makefile
  1130.     } else {
  1131.         IBMPC_O_D >>Makefile
  1132.         J3100_O_D >>Makefile
  1133.         KEYPC_O_D >>Makefile
  1134.         SERDRVPC_O_D >>Makefile
  1135.         VRAMPC_O_D >>Makefile
  1136.         VRAMJ3_O_D >>Makefile
  1137.         SAVERPC_O_D >>Makefile
  1138.         KEYDRVPC_O_D >>Makefile
  1139.     }
  1140. }
  1141.  
  1142. print done.
  1143. print 
  1144.  
  1145. #
  1146. # move makefile to src directory
  1147. #
  1148. !copy makefile src
  1149. !del makefile
  1150.  
  1151. #
  1152. # move option.h to src directory
  1153. #
  1154. !copy option.h src
  1155. !del option.h
  1156.  
  1157.  
  1158. set F=make
  1159. if ((%M%==dos) | (%M%==msc))
  1160.     set F=make Makefile
  1161. else {
  1162.     if (%M%==gnu)
  1163.         set F=gmake
  1164.     else
  1165.         set F=make
  1166. }
  1167.  
  1168. print #########################################################
  1169. print #    Running make                    #
  1170. print #########################################################
  1171. print 
  1172. yesno "Run make to create hterm right now? [yn] "
  1173. print 
  1174. if (ERRORLEVEL 255)
  1175.     print ... Type "%F%" in src directory to make hterm.
  1176. else {
  1177.     print ... Running make.
  1178.     print 
  1179.     !cd src
  1180.     !%F%
  1181.     !cd ..
  1182.     print 
  1183.     if (ERRORLEVEL 1)
  1184.         print Alas!  Failed to make hterm...
  1185.     else
  1186.         print Hterm has successfully made.
  1187. }
  1188.  
  1189. #-------------------------------------------------------------------*
  1190. #  end point for running make
  1191. #-------------------------------------------------------------------*
  1192.  
  1193. :END0
  1194. !FOR %%Z IN (A C D F L M O P) DO SET %%Z=
  1195. IF (EXIST E.$)
  1196.     ask r < E.$
  1197.  
  1198. :END1
  1199. if (EXIST E.$)
  1200.     !DEL E.$
  1201. if (EXIST S.$)
  1202.     !DEL S.$
  1203. print 
  1204. print COMPILE is done.  Good bye...
  1205.  
  1206.  
  1207. rem *-------------------------------------------------------------------*
  1208. rem !  end of all
  1209. rem *-------------------------------------------------------------------*
  1210. :exit
  1211.