简体   繁体   中英

Run Borland turbo c++ 10 IDE project from command line

I'm trying to integrate a legacy borland turbo c++ project into jenkins task and I need to be able to compile the project from command line.

Is there any way to get the compiler CLI information from the project so that I could make a batch file that compiles it?

SO: Windows 7

You can get the commands being invoked by C++ Builder by exporting a makefile for the project.

  1. Under menu goto Project -> Export a Makefile .
  2. Once exported open a cmd.exe shell to the generated makefile's location.
  3. Run the makefile with borland's make.exe tool:

    make -B -K -n -f" projectMakefileGoesHere "

    • -B will traverse all the dependencies ignoring age.
    • -K will keep any temp response files used during the build.
    • -n do a dry-run printing the commands that would've been called in an actual build.

The link commands will be in the MAKE0xxx.@@@ response file where " x " is a number assigned by make.

For later versions of C++ Builder, the .cbproj project is actually a msbuild project file. You can use msbuild to print the build commands used for the project. eg.

msbuild " project.cbproj " -p:Configuration=Debug -clp:ShowCommandLine -v:n

Unfortunately, msbuild doesn't have a dry-run option so it'll end up building the project. Another idea is to create a simple logging program that replaces bcc32.exe compiler and ilink32.exe linker. With this, you can see exactly what options and switches are being passed to the tools.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM