ADD Toggle builds on and off
4 files changed, 71 insertions(+), 40 deletions(-)

M README.org
M files/pds.mk.tmpl
M pds.mk
M src/pds/pds.ml
M README.org +1 -0
@@ 195,6 195,7 @@ install = false
 | extra_makefile_lines | string list | []        | Extra lines to add to the generated Makefile                                                      |
 | compile_deps         | string list | []        | List of builds that need to be built prior to this build but are not automatically linked against |
 | meta_linkopts        | string      | ""        | Link options to go into the META file.                                                            |
+| build                | bool        | true      | Whether or not to build the project or test                                                       |
 
 The following values can be overridden:
 

          
M files/pds.mk.tmpl +20 -15
@@ 5,25 5,30 @@ 
 .PHONY: $(projects_clean_release) $(projects_clean_debug) $(projects_clean_profile)
 .PHONY: $(tests_clean_release) $(tests_clean_debug) $(tests_clean_profile)
 
-PROJECTS=@#projects@@name@ @/projects@
-TESTS=@#tests@@name@ @/tests@
+RELEASE_PROJECTS=@#release_projects@@?build@@name@@/build@ @/release_projects@
+DEBUG_PROJECTS=@#debug_projects@@?build@@name@@/build@ @/debug_projects@
+PROFILE_PROJECTS=@#profile_projects@@?build@@name@@/build@ @/profile_projects@
 
-projects_release = $(PROJECTS:%=release_%)
-projects_debug = $(PROJECTS:%=debug_%)
-projects_profile = $(PROJECTS:%=profile_%)
-projects_install = $(PROJECTS:%=install_%)
+RELEASE_TESTS=@#release_tests@@?build@@name@@/build@ @/release_tests@
+DEBUG_TESTS=@#debug_tests@@?build@@name@@/build@ @/debug_tests@
+PROFILE_TESTS=@#profile_tests@@?build@@name@@/build@ @/profile_tests@
+
+projects_release = $(RELEASE_PROJECTS:%=release_%)
+projects_debug = $(DEBUG_PROJECTS:%=debug_%)
+projects_profile = $(PROFILE_PROJECTS:%=profile_%)
+projects_install = $(RELEASE_PROJECTS:%=install_%)
 projects_docs = $(PROJECTS:%=docs_%)
 projects_remove = $(PROJECTS:%=remove_%)
-projects_clean_release = $(PROJECTS:%=clean-release_%)
-projects_clean_debug = $(PROJECTS:%=clean-debug_%)
-projects_clean_profile = $(PROJECTS:%=clean-profile_%)
+projects_clean_release = $(RELEASE_PROJECTS:%=clean-release_%)
+projects_clean_debug = $(DEBUG_PROJECTS:%=clean-debug_%)
+projects_clean_profile = $(PROFILE_PROJECTS:%=clean-profile_%)
 
-tests_release = $(TESTS:%=test-release_%)
-tests_debug = $(TESTS:%=test-debug_%)
-tests_profile = $(TESTS:%=test-profile_%)
-tests_clean_release = $(TESTS:%=test-clean-release_%)
-tests_clean_debug = $(TESTS:%=test-clean-debug_%)
-tests_clean_profile = $(TESTS:%=test-clean-profile_%)
+tests_release = $(RELEASE_TESTS:%=test-release_%)
+tests_debug = $(DEBUG_TESTS:%=test-debug_%)
+tests_profile = $(PROFILE_TESTS:%=test-profile_%)
+tests_clean_release = $(RELEASE_TESTS:%=test-clean-release_%)
+tests_clean_debug = $(DEBUG_TESTS:%=test-clean-debug_%)
+tests_clean_profile = $(PROFILE_TESTS:%=test-clean-profile_%)
 
 all: release
 

          
M pds.mk +20 -15
@@ 5,25 5,30 @@ 
 .PHONY: $(projects_clean_release) $(projects_clean_debug) $(projects_clean_profile)
 .PHONY: $(tests_clean_release) $(tests_clean_debug) $(tests_clean_profile)
 
-PROJECTS=pds pds_template snabela 
-TESTS=
+RELEASE_PROJECTS=pds pds_template snabela 
+DEBUG_PROJECTS=pds pds_template snabela 
+PROFILE_PROJECTS=pds pds_template snabela 
 
-projects_release = $(PROJECTS:%=release_%)
-projects_debug = $(PROJECTS:%=debug_%)
-projects_profile = $(PROJECTS:%=profile_%)
-projects_install = $(PROJECTS:%=install_%)
+RELEASE_TESTS=
+DEBUG_TESTS=
+PROFILE_TESTS=
+
+projects_release = $(RELEASE_PROJECTS:%=release_%)
+projects_debug = $(DEBUG_PROJECTS:%=debug_%)
+projects_profile = $(PROFILE_PROJECTS:%=profile_%)
+projects_install = $(RELEASE_PROJECTS:%=install_%)
 projects_docs = $(PROJECTS:%=docs_%)
 projects_remove = $(PROJECTS:%=remove_%)
-projects_clean_release = $(PROJECTS:%=clean-release_%)
-projects_clean_debug = $(PROJECTS:%=clean-debug_%)
-projects_clean_profile = $(PROJECTS:%=clean-profile_%)
+projects_clean_release = $(RELEASE_PROJECTS:%=clean-release_%)
+projects_clean_debug = $(DEBUG_PROJECTS:%=clean-debug_%)
+projects_clean_profile = $(PROFILE_PROJECTS:%=clean-profile_%)
 
-tests_release = $(TESTS:%=test-release_%)
-tests_debug = $(TESTS:%=test-debug_%)
-tests_profile = $(TESTS:%=test-profile_%)
-tests_clean_release = $(TESTS:%=test-clean-release_%)
-tests_clean_debug = $(TESTS:%=test-clean-debug_%)
-tests_clean_profile = $(TESTS:%=test-clean-profile_%)
+tests_release = $(RELEASE_TESTS:%=test-release_%)
+tests_debug = $(DEBUG_TESTS:%=test-debug_%)
+tests_profile = $(PROFILE_TESTS:%=test-profile_%)
+tests_clean_release = $(RELEASE_TESTS:%=test-clean-release_%)
+tests_clean_debug = $(DEBUG_TESTS:%=test-clean-debug_%)
+tests_clean_profile = $(PROFILE_TESTS:%=test-clean-profile_%)
 
 all: release
 

          
M src/pds/pds.ml +30 -10
@@ 615,6 615,20 @@ let make_pds_mk_tests_kv lookup tests =
     tests
     []
 
+let compute_projects ?(test = false) lookup builds =
+  List.map
+    (fun n ->
+       let build =
+         value_opt
+           ~default:true
+           (Lookup.bool ~test lookup n "build")
+       in
+       Snabela.Kv.(Map.of_list
+                     [ ("name", string n)
+                     ; ("build", bool build)
+                     ]))
+    (Build_set.elements builds)
+
 (*
  * pds.mk orchestrate running tests and building.  This contains all of the
  * dependency information between builds, which order they should be built in,

          
@@ 635,20 649,26 @@ let emit_pds_mk builds_conf selector =
     let lookup = Lookup.({ build_type = "profile"; selector; builds_conf }) in
     (make_pds_mk_builds_kv lookup builds, make_pds_mk_tests_kv lookup tests)
   in
-  let projects =
-    List.map
-      (fun n -> Snabela.Kv.(Map.of_list [("name", string n)]))
-      (Build_set.elements builds)
+  let (release_projects, release_tests) =
+    let lookup = Lookup.({ build_type = "release"; selector; builds_conf }) in
+    (compute_projects lookup builds, compute_projects ~test:true lookup tests)
   in
-  let tests =
-    List.map
-      (fun n -> Snabela.Kv.(Map.of_list [("name", string n)]))
-      (Build_set.elements tests)
+  let (debug_projects, debug_tests) =
+    let lookup = Lookup.({ build_type = "debug"; selector; builds_conf }) in
+    (compute_projects lookup builds, compute_projects ~test:true lookup tests)
+  in
+  let (profile_projects, profile_tests) =
+    let lookup = Lookup.({ build_type = "profile"; selector; builds_conf }) in
+    (compute_projects lookup builds, compute_projects ~test:true lookup tests)
   in
   let kv =
     Snabela.Kv.(Map.of_list
-                  [ ("projects", list projects)
-                  ; ("tests", list tests)
+                  [ ("release_projects", list release_projects)
+                  ; ("debug_projects", list debug_projects)
+                  ; ("profile_projects", list profile_projects)
+                  ; ("release_tests", list release_tests)
+                  ; ("debug_tests", list debug_tests)
+                  ; ("profile_tests", list profile_tests)
                   ; ("release_builds", list release_builds)
                   ; ("debug_builds", list debug_builds)
                   ; ("profile_builds", list profile_builds)