home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmmk100.zip / PMMAKE.INF (.txt) < prev    next >
OS/2 Help File  |  1995-12-21  |  39KB  |  1,160 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About PM Make ΓòÉΓòÉΓòÉ
  3.  
  4.  PM Make Utility for OS/2 
  5.  
  6. Created by Peter Koller, La vieille Maison d'Anglais, Trebuon, 29530 Plonevez 
  7. du Faou, France. (...more...) 
  8.  
  9. About La Maison d'Anglais 
  10.  
  11. La Maison d'Anglais pictured above is a 17th century (169?) weavers cottage of 
  12. either English or Flemish (Angles) origin. The products originating therein are 
  13. the products of Peter Koller, a dedicated Hardware and Software engineer of 
  14. more than 18 years experience in the design of computers, their software, and 
  15. their interface to the real world. 
  16.  
  17. PM Make is a programmers project builder with a number of features.- 
  18.  
  19.      Built in project backup and restore. 
  20.  
  21.      User menus defined in the makefile can set compiler, etc., options. 
  22.  
  23.      Can include 'global' makefiles as headers. 
  24.  
  25.      Can stop on error. 
  26.  
  27.      Allows review of error messages. 
  28.  
  29.      Force make according to compiler or linker options or make all. 
  30.  
  31.      Can make .exe, .hlp, .dll, etc... all in one build. 
  32.  
  33.      Background build with 'pop up on error' mode. 
  34.  
  35.      Will work in multiple directories. 
  36.  
  37.      Fast. 
  38.  
  39.      Applicable to any third party compilers, linkers, or other tools. 
  40.  
  41.  PM Make evaluation copy is a fully functional product for you to enjoy for 30 
  42.  days. After that, Please Register.... 
  43.  
  44.  Other products available 
  45.  
  46.  Program Editor 
  47.  
  48.  PM Based editor with.- 
  49.  
  50.      LOADS of minor features plus... 
  51.  
  52.      Customisable edit functions (scripts). 
  53.  
  54.      Background Exec to Parse. Test/Make your programs before exiting the 
  55.       editor. 
  56.  
  57.      Works with most compilers. 
  58.  
  59.      Customizable goto error keys position you at the error. 
  60.  
  61.      Extensively MultiThreaded. 
  62.  
  63.      Smooth Scrolling. 
  64.  
  65.      Now at V1.20 eg.- Well Tested. 
  66.  
  67.      Good General Purpose Editor, esp. large files. 
  68.  
  69.      Fast, Reliable, Safe. 
  70.  
  71.  Enquiries concerning the production of new products, or the inclusion of this 
  72.  product into new products, or the inclusion of features from this product into 
  73.  new products are very welcome. 
  74.  
  75.   See Also:- 
  76.  
  77.       Installation. 
  78.       (c) Copyright 
  79.  
  80.  Note:  This product is designed for use with third party products. These third 
  81.  party products have their own copyright. This product does not confer any 
  82.  rights to you in respect of a third party. 
  83.  
  84.  
  85. ΓòÉΓòÉΓòÉ 2. Installation ΓòÉΓòÉΓòÉ
  86.  
  87.  Installation Instructions 
  88.  
  89. You must use the Install utility provided if you wish to 
  90.  
  91.      Install PM Make. 
  92.      Uninstall PM Make. 
  93.      Register PM Make. 
  94.  
  95.  If you are merely registering, you can uncheck all the buttons before 
  96.  proceeding. The minimum files installed are pmmake.exe, pmmake.hlp, and 
  97.  register.doc. 
  98.  
  99.  That's it !! Enjoy. 
  100.  
  101.  To uninstall PM Make run install.exe and select Uninstall, the press Install. 
  102.  Be sure the path and help path is entered correctly before uninstalling. Only 
  103.  those files supplied in the original package will be deleted. You must delete 
  104.  any Objects or Folders by hand. 
  105.  
  106.  
  107. ΓòÉΓòÉΓòÉ 3. (c)copyright ΓòÉΓòÉΓòÉ
  108.  
  109. This program is the (c) copyright of 
  110.  
  111.       Peter Koller, 
  112.       La vieille Maison d'Anglais, 
  113.       Trebuon, 
  114.       29530, Plonevez du Faou, 
  115.       FRANCE. 
  116.  
  117.  All Rights Reserved. 
  118.  
  119.  Note:  This copyright includes the whole product, including the makefile 
  120.  language format, the installation program, and all documentation associated 
  121.  with the product. 
  122.  
  123.    1. You may use the program only on a single machine at any one time.If you 
  124.       have purchased a multiple copy, you may use an according number of copies 
  125.       simultaneously. 
  126.  
  127.    2. You may copy the program into machine readable or printed form for backup 
  128.       or data compression purposes. You may not reverse engineer or disassemble 
  129.       the program. 
  130.  
  131.    3. You may give this copy to others. You may also charge the end user 
  132.       reasonable costs incurred by your distribution of this product. Please 
  133.       ensure you distribute the entire package as shown below. 
  134.  
  135.    4. This product is Shareware. You Must be registered if you continue to use 
  136.       this product after you have evaluated it. Unregistered software will time 
  137.       out after one month. 
  138.  
  139.    5. If you have a Customer Registration Code (CRN), you must not disclose it 
  140.       to anyone. Please quote the number shown in the statistics dialog, rather 
  141.       than the full CRN, when seeking technical support. 
  142.  
  143.  The Author accepts no liability for fitness of purpose, or damages caused 
  144.  whether incidental, or consequential, by the use of this product, howsoever 
  145.  caused. This product is Sold As Seen. In those countries where this statement 
  146.  conflicts with your statutory rights your statutory rights shall remain 
  147.  unaffected. 
  148.  
  149.  This product consists of 
  150.  
  151.  load.cmd            Run OS/2 unpack** to convert... 
  152.  pmmk_p.ack          this file into...- 
  153.  
  154.  install.exe         The program install utility. 
  155.  pmpfold.cmd         REXX folder creation, used by install.exe 
  156.  pmmake.exe          The executable file. 
  157.  pmmake.hlp          This help File. 
  158.  pmmake.inf          This help File in .inf format. 
  159.  register.doc        The product registration sheet. 
  160.  read.me             Late breaking information. 
  161.  make.inc            Example Make include file 
  162.  makefile            Example Makefile 
  163.  uninstal.doc        How to remove (uninstall) PM Make 
  164.  
  165.  Note:  ** IBM unpack (c) IBM. Registered trademarks of International Business 
  166.  Machines Corporation 
  167.  
  168.  
  169. ΓòÉΓòÉΓòÉ 4. File Menu ΓòÉΓòÉΓòÉ
  170.  
  171.  This menu enables you to open a makefile. Makefiles can come in several parts. 
  172.  
  173.      An include file specified on the Command Line. This file is always loaded 
  174.       first if specified. 
  175.      A make file. You can also drag and drop make files onto PM Make. If an 
  176.       include file is specified on the Command Line, it is always loaded, and 
  177.       always loaded first. 
  178.      Any number of other files you may wish to append to the makefile. If you 
  179.       open a new make file, the appended files are not reloaded automatically. 
  180.       Appended files are added to the end of the makefile. 
  181.  
  182.  
  183. ΓòÉΓòÉΓòÉ 4.1. Open a Makefile ΓòÉΓòÉΓòÉ
  184.  
  185. Select open and you will see a standard file dialog. After you have pressed Ok, 
  186. an Include file is loaded (if specified on the Command Line) before the 
  187. selected file is opened. 
  188.  
  189. You can also drag and drop make files onto PM Make. If an include file is 
  190. specified on the Command Line, it is loaded before the selected file is opened. 
  191.  
  192. If an include file is specified the resultant makefile in memory is the 
  193. includefile with the makefile appended. 
  194.  
  195.  
  196. ΓòÉΓòÉΓòÉ 4.2. Append to a Makefile ΓòÉΓòÉΓòÉ
  197.  
  198. Any other files you may wish to append to the makefile. If you open a new make 
  199. file, the appended files are not reloaded automatically. Appended files are 
  200. added to the end of the makefile. 
  201.  
  202.  
  203. ΓòÉΓòÉΓòÉ 5. Command Line Usage ΓòÉΓòÉΓòÉ
  204.  
  205. pmmake (options) filename 
  206.  
  207. eg pmmake /id:\make\make.inc /s /r /x mymake.mak 
  208.  
  209. If you have a number of different objects for PM Make, you can put different 
  210. options into the parameters field of each object. To find out more about the 
  211. different things that can be achieved by object settings, look at the OS/2 
  212. system documentation. 
  213.  
  214. These are the options available. 
  215.  
  216.       /a ...causes a make all. The makefile is run automatically. 
  217.  
  218.       /r ...causes a make update. The makefile is run automatically. 
  219.  
  220.       /t ...causes a test make.  The makefile is NOT run automatically. include 
  221.       /r or /a. 
  222.  
  223.       /s ...run minimised (silent mode). Restores to default size on error. 
  224.  
  225.       /x ...auto exit. exit when done. Will not exit if there is an error. 
  226.  
  227.       /i ...include file is always loaded first. This option is usually 
  228.       present. 
  229.  
  230.  Errors 
  231.  
  232.  Use a batch command as shown below to cause an error exit during make.- 
  233.  
  234.   if errorlevel 1 exit
  235.  
  236.  When you specify actions, you can use the full range of OS/2 batch commands 
  237.  available. 
  238.  
  239.  Examples 
  240.  
  241.      pmmake /id:\make\make.inc /t /a makefile 
  242.  
  243.  Test runs a make all on make.inc + makefile. 
  244.  
  245.      pmmake /id:\make\make.inc /s /r  /x makefile 
  246.  
  247.  Runs make.inc + makefile and exits if no errors were found. Runs minimised. 
  248.  
  249.       Note:  There is no space between options and their contents. Using /x, 
  250.       /X, -x, and -X, (where x is an example option) are all equivalent. 
  251.  
  252.  
  253. ΓòÉΓòÉΓòÉ 6. Edit Menu ΓòÉΓòÉΓòÉ
  254.  
  255. This menu is used to.- 
  256.  
  257.       Undo the last action. 
  258.  
  259.       Cut a Selected area to the clipboard 
  260.  
  261.       Copy a Selected area to the clipboard 
  262.  
  263.       Paste from the clipboard over a selected area. 
  264.  
  265.       Clear a Selected area. (ERASE it !!) 
  266.  
  267.  
  268. ΓòÉΓòÉΓòÉ 6.1. Undoing Changes ΓòÉΓòÉΓòÉ
  269.  
  270. Select Undo from the Edit menu or type alt+backspace to undo the last action. 
  271.  
  272. You Cannot undo two different actions. eg. if you type something and then 
  273. delete a char and then type something else, only the last bit of typing is 
  274. undone. 
  275.  
  276.  
  277. ΓòÉΓòÉΓòÉ 6.2. Cutting out blocks ΓòÉΓòÉΓòÉ
  278.  
  279. First select a piece of text to hilite it. 
  280.  
  281. Select Cut from the Edit menu or press shift+del to copy the selected text to 
  282. the clipboard and delete the hilited area. 
  283.  
  284. See also 
  285.  
  286.       Copy a Selected area to the clipboard 
  287.  
  288.       Paste from the clipboard over a selected area. 
  289.  
  290.       Clear a Selected area. (ERASE it !!) 
  291.  
  292.  
  293. ΓòÉΓòÉΓòÉ 6.3. Copying blocks ΓòÉΓòÉΓòÉ
  294.  
  295. First select a piece of text to hilite it. 
  296.  
  297. Select Copy from the Edit menu or press ctrl+ins to copy the selected text to 
  298. the clipboard, this does not delete the hilited area. 
  299.  
  300. See also 
  301.  
  302.       Cut a Selected area to the clipboard 
  303.  
  304.       Paste from the clipboard over a selected area. 
  305.  
  306.       Clear a Selected area. (ERASE it !!) 
  307.  
  308.  
  309. ΓòÉΓòÉΓòÉ 6.4. Pasting blocks ΓòÉΓòÉΓòÉ
  310.  
  311. Select Paste from the Edit menu or press shift+ins to delete any area that may 
  312. be hilited and then copy any text in the clipboard into the file at the 
  313. position previously occupied by the hilited area (eg. at the cursor position). 
  314.  
  315. See also 
  316.  
  317.       Cut a Selected area to the clipboard 
  318.  
  319.       Copy a Selected area to the clipboard 
  320.  
  321.       Clear a Selected area. (ERASE it !!) 
  322.  
  323.  
  324. ΓòÉΓòÉΓòÉ 6.5. Clearing selected text ΓòÉΓòÉΓòÉ
  325.  
  326. First select a piece of text to hilite it. 
  327.  
  328. Select Clear from the Edit menu or press del to delete the hilited area. 
  329.  
  330. Data is not copied to the clipboard. 
  331.  
  332. See also 
  333.  
  334.       Cut a Selected area to the clipboard 
  335.  
  336.       Copy a Selected area to the clipboard 
  337.  
  338.       Paste from the clipboard over a selected area. 
  339.  
  340.  
  341. ΓòÉΓòÉΓòÉ 6.6. Selecting Text ΓòÉΓòÉΓòÉ
  342.  
  343. To select a block of text.... 
  344.  
  345.    1. Position the cursor at the start or end of the block you wish to select. 
  346.    2. Hold down the left mouse button and move the mouse over the area 
  347.       required. 
  348.  
  349.  OR 
  350.  
  351.    1. Position the cursor at the start or end of the block you wish to select. 
  352.    2. Hold down the Shift Key and use the cursor movement (arrow, home, end, 
  353.       etc.) Keys. 
  354.  
  355.  Note:  The Selected block will be hilited. 
  356.  
  357.  Because ctrl+ins (copy) and shift+ins (paste) as well as selecting text works 
  358.  in any entry field, you can copy a string to the clipboard and then into the 
  359.  entryfield desired. 
  360.  
  361.  
  362. ΓòÉΓòÉΓòÉ 7. Project Menu ΓòÉΓòÉΓòÉ
  363.  
  364. This menu is used to.- 
  365.  
  366.       Backup the project files. 
  367.  
  368.       Restore the project files. 
  369.  
  370.       Query Dependencies within the project. 
  371.  
  372.       Test Make the project. 
  373.  
  374.       Make Update the project. 
  375.  
  376.       Make All the project. 
  377.  
  378.  
  379. ΓòÉΓòÉΓòÉ 7.1. Backup ΓòÉΓòÉΓòÉ
  380.  
  381. Before you begin.- 
  382.  
  383.    1. Make sure you have a formatted disk in your backup drive (if applicable) 
  384.    2. Run a test backup first!!! This will test your makefile and give you an 
  385.       idea of space requirements. Make sure all the required files are going to 
  386.       be backed up. 
  387.    3. Do NOT interrupt a backup once started. 
  388.    4. You may need to set the following commands in your makefile 
  389.           ^projectroot() 
  390.           ^filepath() 
  391.           ^files() 
  392.  
  393.  Make sure that you also backup such items as the makefile and docs. Here is an 
  394.  example. 
  395.  
  396.  ^projectroot(d:\projects\myproj); 
  397.  ^filepath(..\docs); 
  398.  ^files() 
  399.    { 
  400.      makefile 
  401.      read.me 
  402.      internal.doc 
  403.    } 
  404.  
  405.  All the remaining files are extracted from the make profiles, so that if PM 
  406.  Make can make your project it can also back it up. 
  407.  
  408.  During backup the file sizes and free space on your backup drive are 
  409.  displayed. If there is an older version of the file on disk, this is taken 
  410.  into account as free space. This means that often the space required to save a 
  411.  file is less than the file size shown. If there is insufficient space, PM Make 
  412.  will prompt for a new disk up to three times before giving up. This is true 
  413.  even if you are backing up to a hard disk. 
  414.  
  415.  It pays to keep two backups of your project. 
  416.  
  417.  
  418. ΓòÉΓòÉΓòÉ 7.2. Restore ΓòÉΓòÉΓòÉ
  419.  
  420. Restore is used to recover files from the backup drive. For restore to work, 
  421. the makefile must be loaded and the backup disk must contain the files in the 
  422. right places. For this reason, you should only try and restore from disk's 
  423. backed up with PM Make. 
  424.  
  425. Warning 
  426.  
  427. Restore will happily copy old backup files over new files. Be sure that you 
  428. really want to restore a particular file from your backup. Test Restore first. 
  429. You can.- 
  430.  
  431.      Restore All files. 
  432.      Restore Source files. 
  433.      Select the files to restore. 
  434.  
  435.  The list box is updated whenever you click on the restore all or restore 
  436.  source radio buttons. 
  437.  
  438.  If you decide to select the files to restore, you can select multiple files 
  439.  from the list box by dragging, by using ctrl and clicking, or by using shift 
  440.  and clicking. A little experimentation will reveal all. 
  441.  
  442.  Restore will restore the files into the directories specified in your make 
  443.  file. If these directories do not exist, they will be created. 
  444.  
  445.  
  446. ΓòÉΓòÉΓòÉ 7.3. Testing the Makefile ΓòÉΓòÉΓòÉ
  447.  
  448. When you have loaded your make file and before you make (compile and link) your 
  449. project, you ought to run a test make. Test make shows you the batch/command 
  450. file that will be created when you run make. If you wish to see what a 
  451. batchfile for make all looks like, you can do it from the command line. 
  452.  
  453. eg.- 
  454.  
  455. pmmake /t /a ...any other options... makefile 
  456.  
  457. More realistically.- 
  458.  
  459. pmmake /id:\make\make.inc /t /a d:\project\myproj\mymake.mak 
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ 7.4. Make ΓòÉΓòÉΓòÉ
  463.  
  464. Make will create a batch file to update your project and will then run the 
  465. batch file. 
  466.  
  467. You can update a number of exe's, dll's, hlp's, etc at the same time. 
  468.  
  469.  
  470. ΓòÉΓòÉΓòÉ 7.5. Make All ΓòÉΓòÉΓòÉ
  471.  
  472. Make all will rebuild your project from scratch. Every make is performed. 
  473.  
  474. You can start a make all and then minimize PM Make. If your PC is up to it, you 
  475. can then do something else. Note that compilation is very power hungry. 
  476.  
  477. If you attempt to run two PM Make's at the same time you will get a mutual 
  478. exclusion error message asking you to try later. 
  479.  
  480.  
  481. ΓòÉΓòÉΓòÉ 7.6. Query Dependencies ΓòÉΓòÉΓòÉ
  482.  
  483. Select a file from the dropdown listbox marked 'This File', and PM Make will 
  484. search the makefile to find all the output files that depend upon this file. 
  485.  
  486. This is of most use for header files as an aid to rationalising large projects. 
  487. Often, a header of little consequence is included in every file, whereas a 
  488. little judicious subdividing of headers can reduce compile times drastically. 
  489.  
  490. Bear in mind that if you have a ^get() function, or a $Variable in your ^make() 
  491. function to define a filename, the results may well depend on user menu 
  492. selections. 
  493.  
  494.  
  495. ΓòÉΓòÉΓòÉ 8. Options Menu ΓòÉΓòÉΓòÉ
  496.  
  497. No options are automatically saved. It is up to you to 'customize' PM Make as 
  498. you wish. You can use uninstall to clear all saved options. 
  499.  
  500.  
  501. ΓòÉΓòÉΓòÉ 8.1. Saving the window size ΓòÉΓòÉΓòÉ
  502.  
  503. You can save the size of the PM Make window. You cannot save it's position. 
  504.  
  505. PM Make will then always startup with the saved window size. 
  506.  
  507.  
  508. ΓòÉΓòÉΓòÉ 8.2. Saving the backup options ΓòÉΓòÉΓòÉ
  509.  
  510. The options saved are the state of the CheckButtons in both backup and restore 
  511. dialogs, as well as the Backup Path. 
  512.  
  513.  
  514. ΓòÉΓòÉΓòÉ 8.3. Statistics ΓòÉΓòÉΓòÉ
  515.  
  516. This dialog shows current PM Make memory usage. Enjoy! 
  517.  
  518. Note:  Allocated space may be wildly different from used space. This may be 
  519. because of allocation block size, guard memory, and cleared (no longer used) 
  520. workareas. 
  521.  
  522.  
  523. ΓòÉΓòÉΓòÉ 9. User Menus ΓòÉΓòÉΓòÉ
  524.  
  525. This is where you will find user created dialogs. These dialogs are specified 
  526. in the makefile. 
  527.  
  528.  
  529. ΓòÉΓòÉΓòÉ 10. Help Menu ΓòÉΓòÉΓòÉ
  530.  
  531. Help is provided by this menu. You may use F1 to get help at any time. 
  532.  
  533.  
  534. ΓòÉΓòÉΓòÉ 10.1. Keys Help ΓòÉΓòÉΓòÉ
  535.  
  536. The only relevant key not shown on the menu's is ESC. 
  537.  
  538. This key will TRY and stop a make, backup etc. There is no guarantee that it 
  539. will succeed. This is because separate sessions can refuse to be killed. 
  540.  
  541. The recommended approach is to Test Everything first! 
  542.  
  543.  
  544. ΓòÉΓòÉΓòÉ 11. Introducing PM Makefiles ΓòÉΓòÉΓòÉ
  545.  
  546. This chapter introduces makefiles for PM Make, and shows you how to construct 
  547. your own. For further information see also Makefile function syntax 
  548.  
  549. A number of compilers, linkers etc will produce output files in the directory 
  550. in which they are run. Linkers often link large numbers of objects together, if 
  551. each one had to have a full path attached things quickly get out of hand. 
  552.  
  553. Often the options for compilation, linking and testing are interrelated. 
  554. Changing a compiler option has repercussions on which files need to be 
  555. re-built. 
  556.  
  557. It is for the above reasons that PM Make uses it's own makefile format. This 
  558. format allows you to change directories, change compilation and linker options, 
  559. force particular files to make, and backup any changes. 
  560.  
  561. In short.- 
  562.  
  563.    1. Change Directories. 
  564.  
  565.         a. ^workpath() 
  566.  
  567.  Allows you to run different makes in different directories 
  568.  
  569.    2. Change Compilation and linker options. 
  570.  
  571.         a. ^actions() 
  572.  
  573.         b. ^vars() 
  574.  
  575.         c. ^menu() 
  576.  
  577.         d. ^get() 
  578.  
  579.  See Also PM Make Include file 
  580.  
  581.    3. Forcing Makes 
  582.  
  583.         a. ^make() 
  584.  
  585.  For example ^make(..\build\main.obj, $Compile, ^get($ForceID,1,0);){main.c;} 
  586.  
  587.    4. Backup and Restore 
  588.  
  589.         a. ^projectroot() 
  590.  
  591.         b. ^filepath() 
  592.  
  593.         c. ^files() 
  594.  
  595.  See Also Backup. 
  596.  
  597.  
  598. ΓòÉΓòÉΓòÉ 11.1. Internal Operation ΓòÉΓòÉΓòÉ
  599.  
  600.  This section describes how PM Make handles makefiles. 
  601.  
  602.  This is useful to know if you are having problems. PM Make does not read 
  603.  makefiles in one hit but in two passes. The first pass being on open, the 
  604.  others depending on what is wanted. 
  605.  
  606.  
  607. ΓòÉΓòÉΓòÉ 11.1.1. Open ΓòÉΓòÉΓòÉ
  608.  
  609. When the makefile is opened PM Make reads the include file if there is one, 
  610. then appends makefile and sets up a series of string buffers for.- 
  611.  
  612.      ^actions() 
  613.  
  614.      ^vars() 
  615.  
  616.      ^menu() 
  617.  
  618.  If the user appends another file, the operation is repeated. 
  619.  
  620.  The only vars evaluated are those associated with menu's. If ^get() is used in 
  621.  ^menu(), then the associated menuitem must be declared first. 
  622.  
  623.  
  624. ΓòÉΓòÉΓòÉ 11.1.2. Make ΓòÉΓòÉΓòÉ
  625.  
  626. On Test Make, Make, or Make All, the following functions are run.- 
  627.  
  628.      ^workpath() 
  629.  
  630.      ^make() 
  631.  
  632.      ^out() 
  633.  
  634.  At this stage all vars and ^get()'s used are evaluated. 
  635.  
  636.  For Make and Make All, PM Make opens a file in the directory specified by the 
  637.  TMP environment variable. You must declare TMP in config.sys. 
  638.  
  639.  eg.- 
  640.  
  641.   SET TMP=C:\tmp
  642.  
  643.  The filename of this file is pmmk~~~~.cmd. This file is then run using 
  644.  DosStartSession. 
  645.  
  646.  A mutual exclusion semaphore prevents other copies of PM Make attemping to 
  647.  make at the same time. 
  648.  
  649.  
  650. ΓòÉΓòÉΓòÉ 11.1.3. Backup and Restore ΓòÉΓòÉΓòÉ
  651.  
  652. On Backup and restore the following functions are run.- 
  653.  
  654.      ^projectroot() 
  655.  
  656.      ^filepath() 
  657.  
  658.      ^workpath() ...runs ^filepath() 
  659.  
  660.      ^make() ...runs internal version of ^files() 
  661.  
  662.      ^files() 
  663.  
  664.  This builds a table of either the source files or all the files in memory. 
  665.  
  666.  If ^projectroot() is not specified then all files are backed up to the backup 
  667.  path. 
  668.  
  669.  Backup and restore use this memory table to determine which files to copy. 
  670.  
  671.  Copying is done using the ordinary copy command (with /v for verify). 
  672.  
  673.  
  674. ΓòÉΓòÉΓòÉ 11.2. A Minimal makefile ΓòÉΓòÉΓòÉ
  675.  
  676. Here is a minimal makefile for pmmake.... 
  677.  
  678. "A comment is usually in quotes and always OUTSIDE the functions"
  679. ^actions()
  680.     {
  681.         Compile =
  682.                 icc /Fo$*.obj /C /Ss $*.c
  683.             ;
  684.         Link =
  685.                 ilink /out:$*.exe /optf /BASE:65536 /ALIGN:16 $*.obj cppos30.lib $*.def
  686.                 rc $*.res $*.exe
  687.             ;
  688.         Resource = rc -r -x $*.rc;
  689.         Help = ipfc $*.ipf;
  690.     }
  691. ^workpath(d:\program\pmmake\csource);
  692. ^make(..\build\about.obj,$Compile, 0)
  693.     {
  694.         about.c;
  695.         about.h;
  696.         pmmake.hr;
  697.     }
  698.  
  699. "... A number of makes have been deleted for clarity ..."
  700.  
  701. ^make(..\build\runcmd.obj,$Compile, 0)
  702.     {
  703.         runcmd.c;
  704.         runcmd.h;
  705.         mainvars.h;
  706.         message.h;
  707.         pmmake.hr;
  708.     }
  709. ^workpath(d:\program\pmmake\dialogs);
  710. ^make(pmmake.res,$Resource, 0)
  711.     {
  712.         pmmake.rc;
  713.         ..\csource\pmmake.hr;
  714.         ..\csource\help.hp;
  715.         help.dlg;
  716.         about.dlg;
  717.         pmuser.dlg;
  718.         pmmake.ico;
  719.     }
  720. ^workpath(d:\program\pmmake\build);
  721. ^make(..\pmmake.exe,$Link, 0)
  722.     {
  723.         ..\dialogs\pmmake.res;
  724.         about.obj;
  725.         backup.obj;
  726.         cmdline.obj;
  727.         debug.obj;
  728.         dialog.obj;
  729.         fileio.obj;
  730.         help.obj;
  731.         message.obj;
  732.         mkparse.obj;
  733.         pmmake.obj;
  734.         runcmd.obj;
  735.         ..\pmmake.def;
  736.     }
  737. ^workpath(d:\program\pmmake\ipfhelp);
  738. ^make(pmmake.hlp, $Help, 0)
  739.     {
  740.         pmmake.ipf;
  741.     }
  742.  
  743. There is a complete copy of the makefile and includefile for PM Make supplied. 
  744. In addition to the above, this contains menu's for a number of options, 
  745. conditional makes etc. You may use these files for the basis of your own 
  746. project. 
  747.  
  748.  
  749. ΓòÉΓòÉΓòÉ 11.3. PM Make Include file ΓòÉΓòÉΓòÉ
  750.  
  751. This example is a working include file for PM Make. It sets up a number of 
  752. menu's and variables. Though rather complex, it shows what can be achieved. If 
  753. you own IBM's VisualAge** or C Set++** this will help get you started. 
  754.  
  755. Note:  **(c)IBM. Registered trademarks of International Business Machines 
  756. Corporation. 
  757.  
  758. " *****************************************************************************
  759. *                            ICC Make Include File
  760. *
  761. *                            (c) Peter Koller 1995
  762. *
  763. * ICC, ILINK, RC, IPFC, etc. are all (c)IBM.
  764. ******************************************************************************"
  765.  
  766. "********************* Generic Menu's ******************************"
  767. ^vars()
  768.     {
  769.         FALSE           =   0;
  770.         TRUE            =   1;
  771.         MENU_GENERAL_ID =  100;
  772.             ERREXIT_ID  =  101;
  773.  
  774.         MENU_COMP_ID    =  200;
  775.             LIST_ID     =  201;
  776.             DEBG_ID     =  202;
  777.             OPT_ID      =  203;
  778.             FINT_ID     =  204;
  779.             FFLT_ID     =  205;
  780.             MLIB_ID     =  206;
  781.             DYNA_ID     =  207;
  782.             DLL_ID      =  208;
  783.  
  784.         MENU_LINK_ID    =  300;
  785.             L_EXEP_ID   =  301;
  786.             L_MAP_ID    =  302;
  787.             L_OPTL_ID   =  303;
  788.  
  789.     }
  790. ^menu($MENU_GENERAL_ID,"General Options")
  791.     {
  792.         ($ERREXIT_ID, "Exit on Error", $TRUE);
  793.     }
  794. ^menu($MENU_COMP_ID,"Compiler Options")
  795.     {
  796.         ($LIST_ID, "Generate Listing", $FALSE);
  797.         ($DEBG_ID, "Select Debug Mode", $FALSE);
  798.         ($OPT_ID, "Optimize", $TRUE);
  799.         ($FINT_ID,"Fast Integer Maths", $TRUE);
  800.         ($FFLT_ID,"Fast Floating Point Maths", $TRUE);
  801.         ($MLIB_ID,"Use Multithread Library", $TRUE);
  802.         ($DYNA_ID, "Use Dynamic Linking", $FALSE);
  803.         ($DLL_ID, "Make a DLL", $FALSE);
  804.     }
  805. ^menu($MENU_LINK_ID,"Linker Options")
  806.     {
  807.         ($L_EXEP_ID,"Pack (compress) File",$TRUE);
  808.         ($L_MAP_ID,"Create map file",$FALSE);
  809.         ($L_OPTL_ID,"Remove unused functions",$TRUE);
  810.     }
  811. ^vars()
  812.     {
  813.         C_GEN = "/C /Ss";
  814.         C_OPT = ^get($OPT_ID,"/O",);
  815.         C_INT = ^get($FINT_ID,"/Gi",);
  816.         C_FLT = ^get($FFLT_ID,"/Gf",);
  817.         C_LIB = ^get($MLIB_ID,"/Gm",);
  818.         C_DBG = ^get($DEBG_ID,"/Ti",);
  819.         C_LST = ^get($LIST_ID,"/L",);
  820.         C_DYN = ^get($DYNA_ID,"/Gd",);
  821.         C_DLL = ^get($DLL_ID,"/Ge-",);
  822.         L_OPT = ^get($L_OPTL_ID,"/optf",);
  823.         L_MAP = ^get($L_MAP_ID,"/m",);
  824.         L_EXP = ^get($L_EXEP_ID,"/e",);
  825.         L_DBG = ^get($DEBG_ID,"/de /db",);
  826.         L_DLL = ^get($DLL_ID,"/dll","/exec");
  827.         L_GEN = "/BASE:65536 /ALIGN:16";
  828.         L_LIB = ^get($MLIB_ID,"cppom30.lib","cppos30.lib");
  829.         ERR_LEV = ^get($ERREXIT_ID,"@if errorlevel 1 exit",);
  830.     }
  831.  
  832. ^actions()
  833.     {
  834.         Compile =
  835.                 @echo ╨┐╨┐╨┐
  836.                 @echo ╨╛╨╛╨╛ Compiling $*.c ╨┐╨┐╨┐
  837.                 @echo ╨┐╨┐╨┐
  838.                 icc /Fo$*.obj $C_GEN $C_OPT $C_INT $C_FLT $C_LIB $C_DBG $C_LST $C_DYN $C_DLL $*.c
  839.                 $ERR_LEV
  840.             ;
  841.         Link =
  842.                 @echo ╨┐╨┐╨┐
  843.                 @echo ╨╛╨╛╨╛ Building $*.exe ╨┐╨┐╨┐
  844.                 @echo ╨┐╨┐╨┐
  845.                 ilink /out:$*.exe $L_GEN $L_OPT $L_MAP $L_EXP $L_DBG $L_DLL $*.obj $L_LIB $*.def
  846.                 $ERR_LEV
  847.                 rc $*.res $*.exe
  848.                 $ERR_LEV
  849.             ;
  850.         Resource =
  851.                 @echo ╨┐╨┐╨┐
  852.                 @echo ╨╛╨╛╨╛ Running resource compiler on $*.rc ╨┐╨┐╨┐
  853.                 @echo ╨┐╨┐╨┐
  854.                 rc -r -x $*.rc
  855.                 $ERR_LEV
  856.             ;
  857.         Help =
  858.                 @echo ╨┐╨┐╨┐
  859.                 @echo ╨╛╨╛╨╛ Building $*.hlp ╨┐╨┐╨┐
  860.                 @echo ╨┐╨┐╨┐
  861.                 ipfc $*.ipf
  862.                 $ERR_LEV
  863.             ;
  864.     }
  865.  
  866.  
  867. ΓòÉΓòÉΓòÉ 12. Makefile function syntax ΓòÉΓòÉΓòÉ
  868.  
  869. This chapter gives the syntax definition of each function. 
  870.  
  871.      ^actions() 
  872.  
  873.      ^filepath() 
  874.  
  875.      ^files() 
  876.  
  877.      ^get() 
  878.  
  879.      ^make() 
  880.  
  881.      ^menu() 
  882.  
  883.      ^out() 
  884.  
  885.      ^projectroot() 
  886.  
  887.      ^vars() 
  888.  
  889.      ^workpath() 
  890.  
  891.  
  892. ΓòÉΓòÉΓòÉ 12.1. ^actions() ΓòÉΓòÉΓòÉ
  893.  
  894. Syntax 
  895.  
  896.       ^actions() 
  897.         { 
  898.           action = Text or "Text" ^get(..,..,..){} $Variable $*.ext; 
  899.         } 
  900.  Action text may contain.- 
  901.  
  902.      Variables in the form $Variable 
  903.      The ^get() function if not terminated in ; ...unless the last item. 
  904.      $*. filename substitution variables. These are not normal filename 
  905.       wildcards but '$*.' followed by a file extention with NO OTHER wildcards 
  906.  
  907.  Action text may not contain.- 
  908.  
  909.      Semicolon ; unless in quotes or to terminate. 
  910.      Other Actions 
  911.      Functions other that ^get() 
  912.  
  913.  Action names must be unique and not be substrings of other actions or 
  914.  variables. 
  915.  
  916.  The action function is run on makefile load. The action text is not evaluated 
  917.  by this function and may contain undeclared variables. 
  918.  
  919.  Actions are only used by ^make(). 
  920.  
  921.  $*. substitution on making.- if more that one match is found eg a.obj, and 
  922.  b.obj.- '$*.obj' will become 'a.obj b.obj'. 
  923.  
  924.   ^actions()
  925.       {
  926.           QuickCompilation = icc $*.c;
  927.       }
  928.  
  929.  
  930. ΓòÉΓòÉΓòÉ 12.2. ^filepath() ΓòÉΓòÉΓòÉ
  931.  
  932. Syntax 
  933.  
  934.       ^filepath(path); 
  935.  
  936.  The first time you use ^filepath(), ^workpath(), or ^projectroot() it should 
  937.  contain a fully unqualified path such as c:\path\mypath. All these functions 
  938.  set the workpath of PM Make. 
  939.  
  940.  Unlike ^workpath(), ^filepath() does not output change directory information 
  941.  to the make batch file. 
  942.  
  943.   ^filepath(..\docs);
  944.  
  945.  
  946. ΓòÉΓòÉΓòÉ 12.3. ^files() ΓòÉΓòÉΓòÉ
  947.  
  948. Syntax 
  949.  
  950.       ^files() 
  951.         { 
  952.           filename; 
  953.           filename; 
  954.           etc...; 
  955.         } 
  956.  
  957.  ^files() is used to declare files such as documents and the makefile itself. 
  958.  Used for backup and restore. 
  959.  
  960.  Often used in conjunction with ^filepath(). Alternatively the full filename 
  961.  and path can be used. 
  962.  
  963.  
  964. ΓòÉΓòÉΓòÉ 12.4. ^get() ΓòÉΓòÉΓòÉ
  965.  
  966. Syntax 
  967.  
  968.       ^get(ItemID,"true","false"); ...or {} 
  969.  
  970.  ^get() may contain ^get() or $Variable. ^get() will return a value according 
  971.  to the ButtonCheckstate of the menuitem ItemID. (see ^menu) 
  972.  
  973.  Test your knowledge of Boolean algebra by using ^get() within ^get(). 
  974.  
  975.      Anding two ^get()'s 
  976.  
  977.             ^get(Item_one_id,^get(Item_two_id,"true","not true"){},"not true");
  978.  
  979.      Oring two ^get()'s 
  980.  
  981.             ^get(Item_one_id,"true",^get(Item_two_id,"true","not true"){});
  982.  
  983.  
  984. ΓòÉΓòÉΓòÉ 12.5. ^make() ΓòÉΓòÉΓòÉ
  985.  
  986. Syntax 
  987.  
  988.       ^make(resultfilename, $Action, ForcedMakeFlag) 
  989.         { 
  990.           filename; 
  991.           filename; 
  992.           etc...; 
  993.         } 
  994.  
  995.  ^make() may contain ^get() or $Variable. file names may contain paths, It is 
  996.  usual to declare a ^workpath() at least at the beginning of the makefile and 
  997.  then use short filenames (it's less typing). 
  998.  
  999.  ^make() is run in order. You cannot link first and then compile. Usually you 
  1000.  compile each object, and then build the resource file, the message file, and 
  1001.  then link the lot at the end. After that, you can compile the help file, an 
  1002.  entirely different project or subproject and so on. 
  1003.  
  1004.  
  1005. ΓòÉΓòÉΓòÉ 12.6. ^menu() ΓòÉΓòÉΓòÉ
  1006.  
  1007. Syntax 
  1008.  
  1009.       ^menu(MenuID, "Menu Title Text") 
  1010.         { 
  1011.           (ItemID, "First  Item Text", ButtonCheckstate); 
  1012.           (ItemID, "Second Item Text", ButtonCheckstate); 
  1013.           (ItemID, "Third  Item Text", ButtonCheckstate); 
  1014.           (ItemID, "Fourth Item Text", ButtonCheckstate); 
  1015.         } 
  1016.  
  1017.  All ID's must be unique. ButtonCheckstate.- 0 = Not Checked; 1 = Checked. 
  1018.  
  1019.  Used to build a user menu. You may use variable substitution and ^get() but 
  1020.  beware that such expressions are evaluated and must be valid. 
  1021.  
  1022.  
  1023. ΓòÉΓòÉΓòÉ 12.7. ^out() ΓòÉΓòÉΓòÉ
  1024.  
  1025. Syntax 
  1026.  
  1027.       ^out() 
  1028.         { 
  1029.           Text 
  1030.         } 
  1031.  
  1032.  Used to output text to a make batchfile. Text may contain ^get(); or $vars or 
  1033.  quoted strings "hello". 
  1034.  
  1035.  Semicolons ; are output. Leading whitespace is stripped. All ^get()'s and 
  1036.  $vars are evaluated. 
  1037.  
  1038.  
  1039. ΓòÉΓòÉΓòÉ 12.8. ^projectroot() ΓòÉΓòÉΓòÉ
  1040.  
  1041. Syntax 
  1042.  
  1043.       ^projectroot(path); 
  1044.  
  1045.  The first time you use ^filepath(), ^workpath(), or ^projectroot() it should 
  1046.  contain a fully unqualified path such as c:\path\mypath. All these functions 
  1047.  set the workpath of PM Make. 
  1048.  
  1049.  ^projectroot() is used specifically for backup and restore. You may only use 
  1050.  this function once. 
  1051.  
  1052.  ^projectroot() is used to create subdirectories in your backup. eg.- 
  1053.  
  1054.  Assume projectroot is c:\projects\myproj and the backup path is A: 
  1055.  c:\projects\myproj maps to A: 
  1056.  c:\projects\myproj\csource maps to A:\csource 
  1057.  c:\projects\myproj\docs maps to A:\docs 
  1058.  c:\icons\myicons maps to A: 
  1059.  
  1060.  
  1061. ΓòÉΓòÉΓòÉ 12.9. ^vars() ΓòÉΓòÉΓòÉ
  1062.  
  1063. Syntax 
  1064.  
  1065.       ^vars() 
  1066.         { 
  1067.           Variable = Text or "Text" ^get(..,..,..){} $Variable; 
  1068.         } 
  1069.  Variable text may contain.- 
  1070.  
  1071.      Other variables in the form $Variable 
  1072.      The ^get() function if not terminated in ; ...unless the last item. 
  1073.  
  1074.  Variable text may not contain.- 
  1075.  
  1076.      Semicolon ; unless in quotes or to terminate. 
  1077.      Other Actions 
  1078.      Functions other that ^get() 
  1079.  
  1080.  Variable names must be unique and not be substrings of other actions or 
  1081.  variables. 
  1082.  
  1083.  The vars function is run on makefile load. The variable text is not evaluated 
  1084.  by this function and may contain undeclared variables. 
  1085.  
  1086.  If variables are used for the menu function they must be declared before the 
  1087.  menu function, as this function will evaluate the variable. The menu function 
  1088.  is run on makefile load. 
  1089.  
  1090.  
  1091. ΓòÉΓòÉΓòÉ 12.10. ^workpath() ΓòÉΓòÉΓòÉ
  1092.  
  1093. Syntax 
  1094.  
  1095.       ^workpath(path); 
  1096.  
  1097.  The first time you use ^filepath(), ^workpath(), or ^projectroot() it should 
  1098.  contain a fully unqualified path such as c:\path\mypath. All these functions 
  1099.  set the workpath of PM Make. 
  1100.  
  1101.  Unlike ^filepath(), ^workpath() outputs change directory information to the 
  1102.  make batch file. 
  1103.  
  1104.  ^workpath() is usually called just before a ^make() eg.- 
  1105.  
  1106.  ^workpath(c:\project\csource); 
  1107.  ^make(..\build\myprog.obj, $Compile, 0) 
  1108.    { 
  1109.      myproj.cpp 
  1110.    } 
  1111.  
  1112.  
  1113. ΓòÉΓòÉΓòÉ 12.11. General syntax ΓòÉΓòÉΓòÉ
  1114.  
  1115. Generic function 
  1116.  
  1117. ^function(){}
  1118.  
  1119. or 
  1120.  
  1121. ^function();
  1122.  
  1123. There is no standard for arguments in curly{} brackets. 
  1124.  
  1125. In round() brackets each argument is single and separated from its neighbor by 
  1126. a comma (whitespace is ignored). 
  1127. ^function(argument1, argument2, argument3){} 
  1128.  
  1129. Quoted strings 
  1130.  
  1131. "This is a quoted string"
  1132. "
  1133.   This is also a quoted string.
  1134.   Quoted strings are often used outside
  1135.   functions to make comments.
  1136. "
  1137.  
  1138. Quoted strings can be used in functions to denote text that is not evaluated 
  1139.  
  1140. ^vars()
  1141.     {
  1142.         Message = "Hello World!";
  1143.     }
  1144. ^out()
  1145.     {
  1146.         "$Message = "$Message
  1147.     }
  1148.  
  1149. This example outputs.- 
  1150. $Message = Hello World! 
  1151.  
  1152. Comments 
  1153.  
  1154. Anything outside a function is a comment. All functions start with a caret '^'. 
  1155. You can use quotation marks ".." to comment out unwanted functions. 
  1156.  
  1157. You do not need to put comments in quotes, but it may nevertheless be a good 
  1158. idea. Beware that it is very easy to forget a quote and very hard to debug as 
  1159. the whole file can be inadvertently commented out. PM Make will stop at the 
  1160. last unmatched quote, not necessarily where the error is.