1 20 21 package cpmake; 22 23 import java.io.*; 24 25 class DirectoryRule implements Rule 26 { 27 private String m_target; 28 private String [] m_prerequisites; 29 private boolean m_echo; 30 private CPMake m_make; 31 32 public DirectoryRule(CPMake make, String target, String [] prerequisites, boolean echo) 33 { 34 m_target = target; 35 m_prerequisites = prerequisites; 36 m_echo = echo; 37 m_make = make; 38 } 39 40 public boolean matchTarget(String target) 41 { 42 return (m_target.equals(target)); 43 } 44 45 public String [] getPrerequisites(String target) 46 { 47 return (m_prerequisites); 48 } 49 50 public String getScriptCall() 51 { 52 return (null); 53 } 54 55 public boolean verify() 56 { 57 return (true); 58 } 59 60 public boolean hasAction() 61 { 62 return (true); 63 } 64 65 public void callAction(String target) 66 { 67 if (m_echo) 68 System.out.println("Creating "+target); 69 File f = new File(m_make.getWorkingDirectory(), target); 70 f.mkdirs(); 71 } 72 } 73 | Popular Tags |