Re: GCC compiler
- From: "Michael Marsh" <michael.a.marsh@xxxxxxxxx>
- Date: Sun, 29 Apr 2007 10:29:51 -0400
On 4/29/07, Cédric Lucantis <omer@xxxxxxxxxx> wrote:
Le dimanche 29 avril 2007 04:56, Micha Feigin a écrit:
> On Sat, 28 Apr 2007 22:20:08 -0300
> "Iuri Sampaio" <iuri.sampaio@xxxxxxxxx> wrote:
> > $(BIN): $(OBJS)
> >
> > $(CC) $(CFLAGS) -o $(BIN) $(OBJS) $(LIBS)
> >
Not really an answer, but this is wrong too, you should have something like
this instead:
OBJS = rotation.o
BIN = rotation
$(BIN): $(OBJS)
$(CC) -o $@ $^ $(LIBS)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
but with only one source file it doesn't really matter
This rule for %.o is, I believe, identical to the implicit rule. I
always use something like:
SOURCES := rotation.c
or
SOURCES := $(wildcard *.c)
LDFLAGS += $(LIBS)
OBJS := $(patsubst %.c,%.o,$(SOURCES))
BINS := $(patsubst %.o,%,$(OBJS))
default : rotation
or
default : $(BINS)
% : %.o
<tab>$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
If I'm using GNU make, I hardly ever use "=" instead of ":=", unless I
really want to define a macro. You're a lot more likely to get what
you expect most of the time, and you can use "+=".
--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com
http://36pints.blogspot.com
- Follow-Ups:
- Re: GCC compiler
- From: John L Fjellstad
- Re: GCC compiler
- References:
- GCC compiler
- From: Iuri Sampaio
- Re: GCC compiler
- From: Micha Feigin
- Re: GCC compiler
- From: Cédric Lucantis
- GCC compiler
- Prev by Date: Re: RAM 95% used
- Next by Date: Re: ams.sty not found after updating to texlive
- Previous by thread: Re: GCC compiler
- Next by thread: Re: GCC compiler
- Index(es):