Mail Archives: djgpp/1998/02/17/01:43:14
On 15 Feb 1998, Mike McLean wrote:
> characte.cc: characte.o
> gxx -c characte.cc
These rules are backwards. "foo: bar" means that `foo' is made from
`bar' (or, more generally, depends on it), not the other way around.
So you should say "characte.o: characte.cc".
Other related issues:
1) You should use `gcc' to compile, not `gxx'. The latter is
for linking C++ programs; if you use it for compilation (with
-c switch), it will print a warning which is harmless, but
annoying.
2) Actually, you don't need to write rules for generating .o
files from .cc files at all: Make already knows that. So all
you need is the first rule from your Makefile which shows how
to build the program from the object files. Make will figure
out the rest itself.
- Raw text -