- if src_exists (F.chop_extension devel ^ ".ma") then
- let path = F.chop_extension path in
- let str = F.concat "cic:" path ^ "/" in
- O.srcs := US.add (U.uri_of_string str) !O.srcs
-
-let rec scan_entry base devel path =
- if F.check_suffix path ".con.ng" then add_obj path else
- if F.check_suffix path ".ind.ng" then add_obj path else
- if F.check_suffix path ".var.ng" then add_obj path else
- if F.check_suffix path ".ng" then add_src devel path else
- if src_exists devel || src_exists (devel ^ ".ma") then
- let files = Y.readdir (F.concat base path) in
- let map base file = scan_entry base (F.concat devel file) (F.concat path file) in
- A.iter (map base) files
+ let path = F.chop_extension path in
+ let str = F.concat "cic:" path ^ "/" in
+ O.srcs := US.add (U.uri_of_string str) !O.srcs;
+ E.mac (script devel)
+
+let add_remove base path =
+ O.remove := F.concat base path :: !O.remove
+
+let rec scan_entry inner base devel path =
+(* Printf.eprintf "%b %s %s%!\n" inner devel path; *)
+ if is_obj base path && inner then add_obj path else
+ if is_src base path && is_script devel then add_src devel path else
+ if is_dir base path && is_script devel then scan_dir true base devel path else
+ if is_dir base path && src_exists devel then scan_dir false base devel path else
+ add_remove base path
+
+and scan_dir inner base devel path =
+ let files = Y.readdir (F.concat base path) in
+ let map base file = scan_entry inner base (F.concat devel file) (F.concat path file) in
+ A.iter (map base) files