Can folks here with BAT file syntax knowledge suggest me how to improve my compilation bat files?
What i like to have is the following. I need the compiling file COMP.BAT to take compilation options depending on arguments. For example
C:> COMP.BAT n - when i want all files compiled with /NOCHECK option C:> COMP.BAT n z - when compile with /NOCHECK and /ZERIOSE option C:> COMP.BAT f - to compile with /FULL_DEBUG C:> COMP.BAT f u - with /FULL_DEBUG and /UNDEF
etcetc. You've got the idea.
Right now i do that only by using such syntax
C:>COMP.BAT f z
if (%1)(f) goto PATH_F if (%1)(u) goto PATH_U if (%1)(fu) goto PATH_FU .... if (%2)(z) goto PATH_z .....
where
- %1, %2 are first, second and so on arguments after the bat file name,
- PATH_F, PATH_U etc are the labels inside COMP.BAT where a bunch of files compiled with say /FULL_DEBUG like that
😛ATHF ftn95 F:\Folder1\_FMAIN11\CodeU.FOR /fixed /check /full_debug /zeroise /statistics /binary CodeW.obj >zCodeU ftn95 F:\Folder1\_FMAIN11\CodeV.FOR /fixed /check /full_debug /zeroise /statistics /binary CodeV.obj >zCodeV ftn95 F:\Folder1\_FMAIN11\CodeW.FOR /fixed /check /full_debug /zeroise /statistics /binary CodeU.obj >zCodeW .............. .............
or with /UNDEF switch
😛ATHFU ftn95 F:\Folder1\_FMAIN11\CodeU.FOR /fixed /check /full_debug /UNDEF /zeroise /statistics /binary CodeW.obj >zCodeU ............ ........... .........
Means i do things looooong way, programming everything in bat file while it would be easy just somehow (i do not know how) to do that like this (i am just guessing)
C:> COMP.BAT n z k
and inside of this bat file
FTN95 MYPROJ1.F95 #1 #3 FTN95 MYPROJ2.F95 #1 #2 #3 FTN95 MYPROJ3.F95 #1 #2 #3 #4 .......
where #1 #2 #3 etc are my options ( /FULL_DEBUG , /NOCHECK, /ZEROISE etc) and that would be all. 100 times less typing and 10000000 times less mess. Possible?