|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote:
> Invisible <voi### [at] dev null> wrote:
> > The solution, as I just discovered, is to name the files *.cpp rather
> > than *.c++; this apparently enables Make's implicit rules to fire.
> Not a good solution because you are not getting warnings nor
> optimizations.
Btw, if you haven't followed the ensuing flamewar in this thread, let me
repeat a nice trick with gnu make here. If you want to be able to just
write "make programname" and have 'make' compile the program, but you want
it to use some compiler options such as warnings and optimizations, create
a makefile in the directory where the source codes are and put this line
in it (nothing else is needed):
CXXFLAGS=-Wall -O3
Now when you write "make programname", it will give those options to the
compiler.
If you would want a simple "make" to compile all the programs, make the
makefile like this:
CXXFLAGS=-Wall -O3
all: program1 program2 program3
Or if you don't want to always having to add the name of a new program
to the makefile, you can use this instead:
CXXFLAGS=-Wall -O3
SOURCES=$(wildcard *.cpp)
all: $(SOURCES:.cpp=)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |