创建构建环境项目在编译期间动态选择文件夹

创建构建环境项目在编译期间动态选择文件夹

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

问题描述

说我的文件夹结构是这样的。



+ - 应用程序

|

+ - MICRO_CONTROLLER_1

|

+ - MICRO_CONTROLLER_2

|

+ - MICRO_CONTROLLER_3

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

解决方案

您可以导出要构建的文件夹的特定路径,并提供可执行文件的路径。您可以获得更多信息。在这个线程中。





或者只是保持不同的Makefile来创建不同的构建,并使用make -f运行那个特定的makefile。



我希望这是你最后想要执行的。


Lets say my folder structure is something like this ..

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

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.

How I could add dir to $PATH in Makefile?

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.

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

08-18 16:58