remo
remo

Reputation: 3484

Compile files with certain pattern names in ANT

I need to compile a set of files say they have a pattern "*_modules.F" (fortran files). Using ant, I have a PCC compiler set up on the machine to compile such files. How would I be able to do it via ant scripts, So far I have

       <exec dir="ModuleDir" executable="PCC">
            <arg line="1_module.F"/>
       </exec>

The above would work for a single module, how can get it to work for all the module with the pattern "*_modules.F"? Any ideas?

Upvotes: 1

Views: 177

Answers (1)

J&#246;rn Horstmann
J&#246;rn Horstmann

Reputation: 34044

This can be done using the apply ant task which takes a fileset as a parameter. Without the "parallel" attribute the executable would be invoked separately for each input file.

<apply executable="PCC" parallel="true">
    <fileset dir="." includes="*_modules.F"/>
</apply>

Upvotes: 2

Related Questions