创建&QUOT构建环境; C"项目动态地选择在编译期间的文件夹 [英] Create a build environment for "C" project to dynamically select folders during compile time

查看:218
本文介绍了创建&QUOT构建环境; C"项目动态地选择在编译期间的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说我的文件夹结构是这样的..

Lets say my folder structure is something like this ..

+ - 应用 -
|结果
+ - MICRO_CONTROLLER_1结果
|结果
+ - MICRO_CONTROLLER_2结果
|结果
+ - MICRO_CONTROLLER_3结果

+-- Application
|
+-- MICRO_CONTROLLER_1
|
+-- MICRO_CONTROLLER_2
|
+-- MICRO_CONTROLLER_3

和我有设置为#定义SELECT_MICRO == MICRO_CONTROLLER_1编译开关(SELECT_MICRO),那么我的项目应建立在MICRO_CONTROLLER_1驱动程序文件的应用程序,如果同样的#define SELECT_MICRO == MICRO_CONTROLLER_2,那么应用程序应该建立与驱动程序文件的应用程序在MICRO_CONTROLLER_2

and i have a compile switch ( SELECT_MICRO) set to #define SELECT_MICRO == MICRO_CONTROLLER_1 , then my project should build application with driver files in MICRO_CONTROLLER_1 , similarly if #define SELECT_MICRO == MICRO_CONTROLLER_2 , then application should build application with driver files in MICRO_CONTROLLER_2

请让我知道如果有模板来实现以上。

Please let me know if there template to achieve the above.

推荐答案

您可以导出你想建立和供应路径的可执行文件夹的那个特定的路径。你可以得到进一步的信息。在这个线程。

You can export that particular path of the folder you want to build and supply the path to the executable. You can get further info. in this thread.

我怎么能在Makefile中添加目录到$ PATH?

或者干脆保持不同的Makefile文件,使不同的建造和使用make -f来运行特定的生成文件。

Or simply maintain different Makefiles to make different builds and use make -f to run that particular makefile.

我希望这是你最终要执行。

I hope this is what you finally want to perform.

这篇关于创建&QUOT构建环境; C"项目动态地选择在编译期间的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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