Changeset 4593 for trunk/tools
- Timestamp:
- Nov 15, 2000, 1:20:44 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/vslick/genproject.cmd
r4361 r4593 1 /* $Id: genproject.cmd,v 1. 4 2000-10-02 04:08:49bird Exp $1 /* $Id: genproject.cmd,v 1.5 2000-11-15 00:20:44 bird Exp $ 2 2 * 3 3 * This script generates a Visual Slick project of the source and include 4 4 * files found in the directory tree starting at the current directory. 5 5 * 6 * Copyright (c) 1999 knut st. osmundsen6 * Copyright (c) 1999-2000 knut st. osmundsen 7 7 * 8 8 * Project Odin Software License can be found in LICENSE.TXT … … 16 16 sIncludes = ''; 17 17 sProjFile = ''; 18 fFullDir = 1; 19 fRecursive = 0; 18 20 19 21 sArgs.0 = 0; … … 50 52 /* option */ 51 53 chArg = substr(sArg, 2, 1); 52 sArg = s ubstr(sArg, 3);54 sArg = strip(substr(sArg, 3)); 53 55 select 54 56 when chArg = 'I' | chArg = 'i' then do 55 sIncludes = sIncludes||sArg; 57 if (sArg <> '' & substr(sArg, length(sArg), 1) <> ';') then 58 sincludes = sIncludes || sArg || ';'; 59 else 60 sIncludes = sIncludes || sArg; 61 end 62 63 when chArg = 'f' | chArg = 'F' then do 64 fFullDir = 1; 65 end 66 67 when chArg = 'r' | chArg = 'R' then do 68 fFullDir = 0; 56 69 end 57 70 58 71 when chArg = 'h' | chArg = '?' | sArg = '-help' then do 59 72 call syntax; 73 end 74 75 when chArg = 's' | chArg = 'S' then do 76 fRecursive = 1; 60 77 end 61 78 … … 89 106 call lineout sProjFile, 'MACRO=odin32_setcurrentdir();\nodin32_maketagfile();\n' 90 107 call lineout sProjFile, 'FILTEREXPANSION=1 1 0 0 1' 91 call lineout sProjFile, 'compile=concur|capture|clear|:Compile:&Compile,nmake %n.obj'108 call lineout sProjFile, 'compile=concur|capture|clear|:Compile:&Compile,nmake .\bin\debug\%n.obj' 92 109 call lineout sProjFile, 'make=concur|capture|clear|:Build:&Build,nmake' 93 call lineout sProjFile, 'rebuild=concur|capture|clear|:Rebuild:&Rebuild,nmake /A'110 call lineout sProjFile, 'rebuild=concur|capture|clear|:Rebuild:&Rebuild,nmake -a' 94 111 call lineout sProjFile, 'debug=:Debug:&Debug,' 95 112 call lineout sProjFile, 'execute=:Execute:E&xecute,' … … 104 121 105 122 call lineout sProjFile, '[FILES]' 106 call processDirTree sProjFile, directory(), directory() ;123 call processDirTree sProjFile, directory(), directory(), fRecursive, fFullDir; 107 124 call lineout sProjFile, '[ASSOCIATION]' 108 125 call lineout sProjFile, '[STATE]' … … 129 146 130 147 syntax: procedure 131 say 'syntax: genproject.cmd <project filename> [-I<include directories>]' 132 say '' 133 say 'Copyright (c) 1999 knut st. osmundsen' 148 say 'Syntax: genproject.cmd <project filename> [-I<include directories>]' 149 say ' switches: -s Recursivly scan subdirectories too.' 150 say ' (default: Current dir only)' 151 say ' -f Full filenames. (default)' 152 say ' -r Relative filenames. (default: -f)' 153 say ' -I<dir or dirlist> Include directories.' 154 say 'Copyright (c) 1999-2000 knut st. osmundsen' 134 155 exit (1); 135 156 136 157 /* processes an directory tree */ 137 158 processDirTree: procedure 138 parse arg sProjFile, sDirectory, sRoot 159 parse arg sProjFile, sDirectory, sRoot, fRecursive, fFullDir 139 160 140 161 rc = SysFileTree(sDirectory'\*', sFiles, 'FO'); … … 142 163 do i = 1 to sFiles.0 143 164 if filterFile(sFiles.i) then 144 call lineout sProjFile, substr(sFiles.i, length(sRoot)+2) 145 end 146 end 147 148 rc = SysFileTree(sDirectory'\*', sDirs, 'DO'); 149 if rc == 0 then do 150 do i = 1 to sDirs.0 151 if filterDirectory(sDirs.i) then 152 call processDirTree sProjFile, sDirs.i, sRoot 165 do 166 if (fFullDir) then 167 call lineout sProjFile, sFiles.i; 168 else 169 call lineout sProjFile, substr(sFiles.i, length(sRoot)+2); 170 end 171 end 172 end 173 174 if (fRecursive) then 175 do 176 rc = SysFileTree(sDirectory'\*', sDirs, 'DO'); 177 if rc == 0 then do 178 do i = 1 to sDirs.0 179 if filterDirectory(sDirs.i) then 180 call processDirTree sProjFile, sDirs.i, sRoot, fRecursive, fFullDir 181 end 153 182 end 154 183 end
Note:
See TracChangeset
for help on using the changeset viewer.