POV-Ray : Newsgroups : povray.off-topic : Unix shell : Re: Unix shell Server Time
3 Sep 2024 21:18:23 EDT (-0400)
  Re: Unix shell  
From: Warp
Date: 1 Feb 2011 11:48:13
Message: <4d48394d@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Invisible <voi### [at] devnull> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.