OpenVINOTM,给你看得见的未来!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 在torn2下创建多project的超级工程

共1条 1/1 1 跳转至

在torn2下创建多project的超级工程

菜鸟
2003-01-16 19:25:00    评分
下文讲述如何克服TornadoII工程管理的缺点 创建包括多个工程的超级工程 我有本文的示例代码, 有要的告诉我, 也可在网上找:) ==================================================== Multiple Projects This is an instruction on how to overcome one of the shortcomings of the TornadoII Project Facility: How can I link multiple Projects together to make one single SuperProject. The setup may seem like too much work, but once it is done, it does not have to be changed unless another project or build. The idea is to have a super project which includes other projects. The project file structure is as follows: \myProject\superProject /* the super project directory */ \myProject\projectN /* n project directories */ \myProject\super_link /* a magic file to make a super project */ \myProject\superProject\super.mk /* another super project magic file */ The directory and file names for superProject, projectN, and workspace may be anything you want. However, whatever you change the name of superProject to, the file and directory names must match. Also, the build specification names must match for all projectN and superProject. The method for taking existing files and adding them to the project is as follows: 1. Fire up Tornado II 2. Create the workspace and superProject: File Open Workspace New Create downloadable application modules for VxWorks Name: superProject Location: \target\proj\superProject Workspace Add to a New or Existing workspace \target\proj\MyWorkspace.wsp A Toolchain: (select one) In the Files tab of the workspace Select superProject Right click to Add Files Add superProject.c (this file may be empty, but must exist) Right click to calculate Dependencies 3. Create each projectN File New project New Create downloadable application modules for VxWorks Name: projectN Location: \target\proj\projectN Workspace Add to current workspace A Toolchain: (select one) 4. Add files to each projectN In the Files tab of the workspace Select projectN Right click to Add Files When all of the files have been added, right click on projectN to calculate Dependencies. 5. Modify build for superProject In the Builds tab of the workspace double click on superProject Builds In the Macros tab: Change the name field to: SUB_PROJS Change the value field to: project1 project2 ... projectN Click Add/Set Click Apply In the Rules tab Click New/Edit Target: -include Dependencies: ../super.mk Uncheck Invoke this rule before building project Click OK Click New/Edit Target: superProject.out Dependencies: Super Uncheck Invoke this rule before building project Click OK Make sure superProject.out is the visible Rule Click Apply Click OK 6. Modify each build for projectN In the Builds tab of the workspace double click on projectN Builds In the Macros tab change the name field to: include ../../super_link # Erase the value field Click Add/Set Click Apply Click OK 7. The Miracle Copy the file super.mk into the superProject directory. \myProject\superProject\super.mk /* another super project magic file */ Copy the file super_link into the directory above the projectN directories: \myProject\super_link /* a magic file to make a super project */ 8. Build In the Files tab Right click on each projectN (do these first) Select Rebuild All Right click on superProject (do this last) Select Rebuild All You can now download superProject.out. Files may be added to any projectN or superProject without having to change any of the build specifications. Building the superProject executes each projectN make. This will recompile any projectN file that has been changed. You can still build and download each projectN separately. You can add additional builds to each projectN (for different architectures or the simulator). You can also have more than one superProject build. The only restriction is that there must be the same build name in each projectN (e.g. SIMNTgnu). Remember to add the Macros and Rules for each build if it is to be part of the superProject. An example of this can be found here. It consists of 5 subprojects, each containing one file containing one function. It's supposed to be logical: project1 one contains file1, which contains a function called 'f1' printing "Function 1". Sorry, I know it is not very highly sophisticated, but it works. The superProject has the above described file 'superProject' containing one function 'super', which calls the functions of project1 to projet5. To control if it works, just compile all projects, then download subproject.out and run sp super. Now you should see the printouts of the functions of all subprojects.



关键词: torn2     创建     project     超级     工程     su    

共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]