做类似工具来支持自动删除临时文件和正则表达式模式规则吗? [英] Make like tool that supports automatic deletion of temp files and regular expression pattern rules?

查看:60
本文介绍了做类似工具来支持自动删除临时文件和正则表达式模式规则吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索支持(除了常用的make功能之外)的make like build工具:

I am searching a make like build tool that supports (besides usual make features):

  1. 自动删除临时创建的文件(例如在GNU make中)
  2. 规则模式中的正则表达式(例如在 Cook
  1. Automatic deletion of temporary created files (like in GNU make for example)
  2. Regular expressions in rule patterns (like e.g. in Cook

关于1: 默认情况下,GNU make会删除临时文件.例如,具有以下规则:

About 1: By default GNU make deletes temporary files. For example have these rules:

%.c: %.y
          some-comand

%.o: %.c
          some-comand

如果您有文件foo.y并调用make foo.o,则必须首先创建foo.c,然后再创建foo.o的make衍生物.准备就绪后,删除临时文件foo.c.

If you have a file foo.y and call make foo.o then make derives that is has to create first foo.c and then foo.o. After it is ready it delete the temporary file foo.c.

库克不支持此操作.

关于2: 使仅支持后缀模式样式规则.例如这样的(等效符号):

About 2: Make just support suffix pattern style rules. For example like this (equivalent notations):

%.o: %.c
          some-comand

.c.o: 一些命令

.c.o: some-comand

在模式规则中允许使用正则表达式当然更强大.伪代码示例:

Allowing regular expressions in rules of patterns is of course more powerful. Pseudo-code examples:

foo.+bar.o: foo.+bar.c
          some-comand

foo\1bar.o: foo(.+)bar.c
          some-comand

如果需要例如fooXXXbar.o并且fooYYYbar.c存在(或知道如何创建),则第一条规则匹配(并执行命令).第二条规则,例如如果需要fooXXXbar.o并匹配,并且知道如何创建它fooXXXbar.c存在.

The first rule matches (and its command is executed) if for example fooXXXbar.o is needed and fooYYYbar.c exists (or make knows how to create it. The second rule matches, if for example fooXXXbar.o is needed and fooXXXbar.c exists.

您知道支持这些功能的内部版本吗?

Do you know a build that supports these features?

推荐答案

GNU Make显然有1个,需要2个(

GNU Make obviously has 1, and needs 2 (its maintainers seem to agree), but there isn't a full design for it, let alone a patch.

您可以使用$(call),$(eval)甚至$(shell)之类的功能在GNU make中模拟此功能, 和/或生成辅助Makefile并包括它们,但是结果很难读取.

You can emulate this functionality in GNU make by using functions such as $(call), $(eval) or even $(shell), and/or generating auxiliary Makefiles and including them, but the results are quite hard to read.

这篇关于做类似工具来支持自动删除临时文件和正则表达式模式规则吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆