English 中文(简体)
利用项目目录结构的跳板
原标题:using rake with project directory structure
  • 时间:2010-07-08 15:48:25
  •  标签:
  • c++
  • rake

我一直在研究“ake”在我们的 CI系统中建造文字(与C++建造的项目)。 我一直以简单易懂的世界应用来看待能够做些什么。 直到我决定把.档案放在一个包括文件夹的夹中,以及将文件编成弧夹为止。 Rake找到了电筒档案,但没有包括头盔档案。 类似档案结构:

src/main.cpp
src/greet.cpp
include/greet.h

rake script was as follows:


require  rake/clean 
require  rake/loaders/makefile 

APPLICATION =  hello.exe 
C_FILES = FileList[ src/*.cpp ]
HDR_FILES = FileList[ include/*.h ]
ALL_FILES = [C_FILES] + HDR_FILES
O_FILES = C_FILES.sub(/.cpp$/,  .o )

file  .depend.mf  do
  sh "makedepend -f- --  -- #{ALL_FILES} > .depend.mf"
end

import ".depend.mf"

file APPLICATION => O_FILES do |t|
  sh "gcc #{O_FILES} -o #{t.name}"
end

rule ".o" => [".cpp"] do |t|
  sh "gcc -c -o #{t.name} #{t.source}"
end

C_FILES.each do |src|
  file src.ext(".o") => src
end

CLEAN.include("**/*.o")
CLEAN.include(APPLICATION)
CLEAN.include(".depend.mf")

task :default => APPLICATION

任何帮助都会受到高度赞赏。

最佳回答

此行:ALL_FILES = [C_FILES] + HDR_FILES 缩略语

档案管理员只是一个跳板阵列,为我们提供,但它只是一个阵列,处于顶端,因此我们可以使用所有标准阵列操作员。

<代码> << 运营商将在C_FILES阵列的末尾附上HDR_FILES阵列的所有物项。

使用<代码>+的操作员将HDR_FILES阵列作为单项内容添加到C_FILES阵列的末尾,从而形成一系列阵列。

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签