本文介绍了Automake变量整理Makefile.am的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个目录/ src包含我的所有源文件,和/ bin在运行make命令后存储所有二进制文件。该目录如下所示:I have a directory /src containing all of my source files, and /bin to store all binary after running make command. The directory is something like below:/BuildDirectory- - /src- - /bin- - configure- - Makefile.am- - configure.ac- - ...现在在Makefile.am中,我必须指定:Now in Makefile.am, I have to specified:bin_PROGRAMS = bin/x bin/y bin/z bin/k ...bin_x_SOURCES = src/x.cppbin_y_SOURCES = src/y.cppbin_z_SOURCES = src/z.cpp 例如我只是指定:Is there any variable that can help to get rid of all "bin/" and "src/" ?For example I just specify:$BIN = bin$SRC = src他们会在正确的文件夹中查找正确的文件,并将其编译到正确的位置。And they will look for the correct files in correct folders and compile it to the correct places.感谢推荐答案您可以利用远程建设。将此makefile放在bin目录中:You could take advantage of remote building. Place this makefile in the bin dir:VPATH = ../srcbin_PROGRAMS = x y z k ...x_SOURCES = x.cppy_SOURCES = y.cppz_SOURCES = z.cpp现在用以下替换当前的Makefile.am:Now replace the current Makefile.am with this one:SUBDIRS = bin现在调整configure.ac也可以生成bin / MakefileNow tweak your configure.ac to also generate bin/MakefileAC_CONFIG_FILES([Makefile bin/Makefile])你应该为生命而设。 这篇关于Automake变量整理Makefile.am的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-23 10:24
查看更多