diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-05-22 15:01:50 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-05-24 05:58:43 -0600 |
| commit | e12e7af8b9d125a2dbd247dcd71896e4a6873d5a (patch) | |
| tree | c770617039e518b6539b179ac96d98b2d71b817b | |
| parent | 3ac78307acfb919271587c3638a20f644f524658 (diff) | |
mk: implement support for meson, ninja
| -rw-r--r-- | mk/meson.mk | 23 | ||||
| -rw-r--r-- | mk/tools.mk | 2 | ||||
| -rw-r--r-- | mk/top.mk | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/mk/meson.mk b/mk/meson.mk new file mode 100644 index 0000000..991dc79 --- /dev/null +++ b/mk/meson.mk @@ -0,0 +1,23 @@ +ninja_dir = $(obj)/ninja/$(1) + +define hooks/meson + define obj_rules + meson_stamp := $$(call ninja_dir,$(1))/meson.stamp + ninja_stamp := $$(call ninja_dir,$(1))/ninja.stamp + + $$(call require_core_objs,$(1),meson_objs): $$(ninja_stamp) + + $$(ninja_stamp): $$(meson_stamp) + $$(call run,NINJA,$(1)) $$(NINJA) -C $$(call ninja_dir,$(1)) install + @touch $$@ + + $$(meson_stamp): | $$(obj) + $$(meson_stamp): $$(call meson_src,$(1)) $$(obj_deps) + $$(call run,MESON,$(1)) $$(MESON) setup \ + $$(call require_core_paths,$(1),meson_src) $$(call ninja_dir,$(1)) \ + $$(core_info/$(1)/meson_args) + @touch $$@ + endef + + $$(eval $$(call add_obj_rules,$(1))) +endef diff --git a/mk/tools.mk b/mk/tools.mk index 5decb78..c01c2de 100644 --- a/mk/tools.mk +++ b/mk/tools.mk @@ -1,6 +1,8 @@ define find_tools_lazy $(call find_command_lazy,cocotb-config,COCOTB_CONFIG) $(call find_command_lazy,genhtml,GENHTML) + $(call find_command_lazy,meson,MESON) + $(call find_command_lazy,ninja,NINJA) $(call find_command_lazy,peakrdl,PEAKRDL) $(call find_command_lazy,pkg-config,PKG_CONFIG) $(call find_command_lazy,python3,PYTHON3) @@ -32,6 +32,7 @@ include mk/cocotb.mk include mk/cores.mk include mk/cov.mk include mk/makehex.mk +include mk/meson.mk include mk/obj.mk include mk/objcopy.mk include mk/output.mk |
