Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple source file in command line?

Status
Not open for further replies.

hughLg

Programmer
Joined
Feb 18, 2002
Messages
136
Location
MY
I need to include more source file in compilation like:

bcc32 file1.cpp file2.cpp file3.cpp main.cpp

Now I don't like to type so many file names there very time I compile. Any solution?

Do I need to create a new compiler, linker, or maker configuration file? If yes, how?
 
Why don't u write a program which encapsulates the name of each file? (like a project file).

--- LastCyborg ---
 
I'm using Borland C++ free command line, how to create a project file like that?
 
Write a Makefile. I dunno if Borland's Make has any significant differences from this, but in *nix (and assuming the command you wrote is all you need), you'd just write:
Code:
all:
	bcc32 file1.cpp file2.cpp file3.cpp main.cpp
in a file named "Makefile" or "makefile" (check Borland's documentation to see which one it wants).

Then, to run it, you'd just type "make" on the command line in the directory contining the makefile and the source files.

Of course, you might as well just use a batch file if that's all you want to do; if you're going to use a makefile, you should go ahead and put dependency tracking in, too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top