home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / epmgcc10.zip / GCC.E < prev    next >
Text File  |  1994-01-22  |  8KB  |  171 lines

  1. /*
  2. ╔══════════════════════════════════════════════════════════════════════════════╗
  3. ║ What's it called: EPMGCC  V1.00                                              ║
  4. ║                                                                              ║
  5. ║ What does it do:  The E source code for the GCC-Interface for EPM.           ║
  6. ║                   This file contains the menu definition. The commands       ║
  7. ║                   and procedures are defined in a separate file and linked   ║
  8. ║                   in an additional modul because of the size limitation      ║
  9. ║                   of emx.ex (64K).                                           ║
  10. ║                                                                              ║
  11. ║ Who and When:     B. Bablok 12/93 - 01/94                                    ║
  12. ║                                                                              ║
  13. ╚══════════════════════════════════════════════════════════════════════════════╝
  14.  
  15. ┌──────────────────────────────────────────────────────────────────────────────┐
  16. │  Defining default constants if not defined in GCCENV.E                       │
  17. └──────────────────────────────────────────────────────────────────────────────┘
  18. */
  19. TRYINCLUDE 'gccenv.e'
  20.  
  21. COMPILE IF not defined(GCC_MENU_ALWAYS_ON)
  22.    CONST   GCC_MENU_ALWAYS_ON = 0              --  default is to grey out GCC-
  23. COMPILE ENDIF                                  --  menu for non c/cc files
  24.  
  25. COMPILE IF not defined(GCC_D_COMPILE_OPTIONS)
  26.    CONST   GCC_D_COMPILE_OPTIONS = '-c -g %*'  --  default: compile and create
  27. COMPILE ENDIF                                  --  debug information
  28.  
  29. COMPILE IF not defined(GCC_P_COMPILE_OPTIONS)
  30.    CONST GCC_P_COMPILE_OPTIONS = '-O2 -o %**P%**N.exe %*' --  default: compile
  31. COMPILE ENDIF                                             --  with optimization
  32.                                                           --  and link
  33.  
  34. COMPILE IF not defined(GCC_D_BUILD_OPTIONS)
  35.    CONST   GCC_D_BUILD_OPTIONS = '-k -f %* MODE=D' -- default debug build option
  36. COMPILE ENDIF
  37.  
  38. COMPILE IF not defined(GCC_P_BUILD_OPTIONS)
  39.    CONST   GCC_P_BUILD_OPTIONS = '-k -f %* MODE=P' -- default production build
  40. COMPILE ENDIF                                      -- options
  41.  
  42. COMPILE IF not defined(GCC_AUTOSAVE_FILE)
  43.    CONST   GCC_AUTOSAVE_FILE = 1               --  default is to turn on smart
  44. COMPILE ENDIF                                  --  save before compile
  45.  
  46. COMPILE IF not defined(GCC_DEBUG_MODE)
  47.    CONST   GCC_DEBUG_MODE = 1                  -- default is to turn on debug -
  48. COMPILE ENDIF                                  -- mode
  49.  
  50. COMPILE IF not defined(GCC_VERBOSE_MODE)
  51.    CONST   GCC_VERBOSE_MODE = 0                -- default is to turn off verbose
  52. COMPILE ENDIF                                  -- mode
  53. /*
  54. ┌───────────────────────────────────────────────────────────────────────────────┐
  55. │   English language support for GCC menu help                                  │
  56. └───────────────────────────────────────────────────────────────────────────────┘
  57. */
  58. CONST
  59.   GCC_MENU__MSG      = \1'Menus related to GCC support'
  60.   GCC_OPEN__MSG      = \1'Open (define) the current project'
  61.   GCC_EDIT__MSG      = \1'Edit the current project'
  62.   GCC_CLOSE__MSG     = \1'Close the current project'
  63.   GCC_COMP_OPT__MSG  = \1'Set compile options'
  64.   GCC_COMP__MSG      = \1'Compile the current file'
  65.   GCC_BUILD_OPT__MSG = \1'Set build options'
  66.   GCC_BUILD__MSG     = \1'Build the current project'
  67.   GCC_VIEW__MSG      = \1'View compile results'
  68.   GCC_RUN__MSG       = \1'Run EXE - file'
  69.   GCC_DEBUG__MSG     = \1'Debug EXE - file'
  70.   GCC_DEBUGMODE__MSG = \1'Toggle debug-mode'
  71.   GCC_AUTOSAVE__MSG  = \1'Toggle autosave mode'
  72.   GCC_VERBOSE__MSG   = \1'Verbose mode for troubleshooting GCC commands.'
  73. /*
  74. ┌──────────────────────────────────────────────────────────────────────────────┐
  75. │  Define EPMGCC variables and post menu build                                 │
  76. └──────────────────────────────────────────────────────────────────────────────┘
  77. */
  78. DEFINIT
  79.     UNIVERSAL gcc_project,            -- project name
  80.               gcc_project_file,       -- make file name
  81.               gcc_d_comp_options,     -- compile options (debug)
  82.               gcc_p_comp_options,     -- compile options (production)
  83.               gcc_d_make_options,     -- make    options (debug)
  84.               gcc_p_make_options,     -- make    options (production)
  85.               gcc_error_file,         -- latest error-file
  86.               gcc_error_file_id,      -- ID of latest error-file
  87.               gcc_debug,              -- debug mode
  88.               gcc_autosave,           -- auto-save mode
  89.               gcc_verbose,            -- verbose mode
  90.               gcc_runtime_arguments   -- runtime arguments
  91.  
  92.     gcc_project           = ''
  93.     gcc_project_file      = ''
  94.     gcc_d_comp_options    = GCC_D_COMPILE_OPTIONS
  95.     gcc_p_comp_options    = GCC_P_COMPILE_OPTIONS
  96.     gcc_d_make_options    = GCC_D_BUILD_OPTIONS
  97.     gcc_p_make_options    = GCC_P_BUILD_OPTIONS
  98.     gcc_error_file        = ''
  99.     gcc_error_file_id     = ''
  100.     gcc_debug             = GCC_DEBUG_MODE
  101.     gcc_autosave          = GCC_AUTOSAVE_FILE
  102.     gcc_verbose           = GCC_VERBOSE_MODE
  103.     gcc_runtime_arguments = ''
  104.  
  105.     'PostMe LINK gccproc'    -- else the epm.ex file would be > 64k
  106.     'PostMe BuildGCCMenu'    -- delay creating menu until after the definit
  107. /*
  108. ┌──────────────────────────────────────────────────────────────────────────────┐
  109. │  GCC menu registering                                                        │
  110. └──────────────────────────────────────────────────────────────────────────────┘
  111. */
  112. DEFSELECT
  113.    'PostMe GCCMenuEnable'
  114.  
  115. DEFLOAD
  116.    'PostMe GCCMenuEnable'
  117. /*
  118. ┌───────────────────────────────────────────────────────────────────────────────┐
  119. │  Define GCC menu system                                                       │
  120. └───────────────────────────────────────────────────────────────────────────────┘
  121. */
  122. DEFC BuildGCCMenu =
  123.     UNIVERSAL defaultmenu
  124.  
  125.     BUILDSUBMENU defaultmenu, 33, '~GCC', GCC_MENU__MSG, 0,0
  126.     BUILDMENUITEM defaultmenu, 33, 3301, '~Open Project',
  127.                                'open_project'GCC_OPEN__MSG, 0,0
  128.     BUILDMENUITEM defaultmenu, 33, 3302, '~Edit Project',
  129.                                'edit_project'GCC_EDIT__MSG, 0,0
  130.     BUILDMENUITEM defaultmenu, 33, 3303, 'C~lose Project',
  131.                                'close_project'GCC_CLOSE__MSG, 0,0
  132.     BUILDMENUITEM defaultmenu, 33, 3304, \0, '', 4, 0
  133.     BUILDMENUITEM defaultmenu, 33, 3305, 'Set com~pile options  c-F11',
  134.                                'set_comp_options'GCC_COMP_OPT__MSG, 0,0
  135.     BUILDMENUITEM defaultmenu, 33, 3306, '~Compile current file  c-F12',
  136.                                'compile_file'GCC_COMP__MSG, 0,0
  137.     BUILDMENUITEM defaultmenu, 33, 3307, 'Set b~uild options     s-F11',
  138.                                'set_make_options'GCC_BUILD_OPT__MSG, 0,0
  139.     BUILDMENUITEM defaultmenu, 33, 3308, '~Build current project s-F12',
  140.                                'build_project'GCC_BUILD__MSG, 0,0
  141.     BUILDMENUITEM defaultmenu, 33, 3309, '~View results',
  142.                                'view_results'GCC_VIEW__MSG, 0,0
  143.     BUILDMENUITEM defaultmenu, 33, 3310, \0, '', 4, 0
  144.     BUILDMENUITEM defaultmenu, 33, 3311, '~Run Exe',
  145.                                'run_exe'GCC_RUN__MSG, 0,0
  146.     BUILDMENUITEM defaultmenu, 33, 3312, '~Debug Exe',
  147.                                'debug_exe'GCC_DEBUG__MSG, 0,0
  148.     BUILDMENUITEM defaultmenu, 33, 3313, \0, '', 4, 0
  149.     BUILDMENUITEM defaultmenu, 33, 3314, 'Debug ~Mode',
  150.                                'toggle_debug_mode'GCC_DEBUGMODE__MSG, 0,0
  151.     BUILDMENUITEM defaultmenu, 33, 3315, 'Auto ~Save',
  152.                                'toggle_autosave_mode'GCC_AUTOSAVE__MSG, 0,0
  153.     BUILDMENUITEM defaultmenu, 33, 3316, 'Verbose (~test) Mode',
  154.                                'toggle_verbose_mode'GCC_VERBOSE__MSG, 0,0
  155.  
  156.     SHOWMENU defaultmenu
  157.     'PostMe  GCCMenuEnable'
  158.  
  159. -- enable the GCC menu only if a c/cc/h-, error- or make-file is loaded -
  160. -- or if GCC_MENU_ALWAYS_ON is set
  161.  
  162. DEFC GCCMenuEnable =
  163.  COMPILE IF GCC_MENU_ALWAYS_ON = 1
  164.     gcc_enabled = 1
  165.  COMPILE ELSE
  166.     ext = FILETYPE()
  167.     gcc_enabled = WORDPOS(ext,'C CC CPP CXX H ERR EMX GCC MAK') > 0
  168.  COMPILE ENDIF
  169.  SetMenuAttribute(33, 16384, gcc_enabled)
  170.  RETURN
  171.