2013-06-24 52 views
0

我有以下的源目錄結構的Makefile:複製從源目錄的Perl/Python文件到構建目錄

src: 
    dir1: c++ files, Makefile 
    dir2: perl/python scripts, Makefile 


build: 
    bin: 
     binary-executables 
     bin-subdir: I want my perl/python files to be copied during the build process. 

而且,當我做了make install,將bin-subdir被默認複製到install/bin或我有以指定?

+1

這取決於你的makefile文件中的內容,尤其是在'install'目標及其任何先決條件或子目標下。 – twalberg

+0

你說得對。我習慣了CMake,並預計有些事情默認會發生。 –

回答

1

基本上,當您運行make X時,您告訴Make在您的Makefile中找到目標X。所以如果你沒有install:的目標,沒有什麼會發生。所有這些都取決於Makefiles中的內容。如果你想將你的perl/python文件複製到build目錄中,一種方法是編寫一個運行* sh命令的Makefile目標,如mv dir2/*.pyc build; mv dir2/*.pl build,並且要求該目標位於Makefile中的其他位置。如果你需要一個好的Makefile教程,here's one that I started with.

+0

謝謝,這很有見地。 –

相關問題