是否可以从Android.mk运行perl脚本

时间:2018-02-07 17:17:29

标签: android perl makefile

我只是想知道是否有可能从Android的make文件中运行perl脚本!我不熟悉它们如何使文件工作,并且理想情况下只想在make文件中添加几行以使其成为可能。如果有可能请告诉我如何?举个例子!

2 个答案:

答案 0 :(得分:2)

您是否希望在构建特定目标时运行perl命令,或者在首次运行make时是否要运行perl命令?

#some makefile

# the following will run when the makefile is being read
# regardless of what target(s) you're building.  The output
# is stored in some_var
# Note: if the perl program has side effects (generates a file, etc), then
# this is not recommended practice.
some_var := $(shell perl someparams 1)

# the following would be run if you run "make some_target", or
# just "make" as it's the first and therefore the default target
some_target:
     @echo building $@
     perl someparams 2

无论哪种方式,你都应该阅读关于makefile的初级读本。

答案 1 :(得分:0)

您可以从make运行任何命令perl只是另一个。