help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with compiling dependent objects


From: Garrett Cooper
Subject: Re: Issues with compiling dependent objects
Date: Wed, 28 May 2008 11:39:57 -0700

On Wed, May 28, 2008 at 10:02 AM, Garrett Cooper <address@hidden> wrote:
Hi again,

      I'm having issues with compiling .a / .la (library archives), with dependent objects (.o). For whatever reason I can't get the .a / .la archive to be created unless the dirname for the library archive and the objects are the same.

# Makefile

# $(CURDIR) is $(srcdir)/lib/ltp
LIB_TARGET        := $(srcdir)/lib/libltp.a
MAKE_DEPS       := $(patsubst %.c,%.o,$(wildcard *.c))
MAKE_TARGETS := $(LIB_TARGET)
$(LIB_TARGET): $(MAKE_TARGET)

# ------

# Master rule:
%.a:
      ar -rc $@ $^

So the essential rule set should be:

%.o: %.c

$(srcdir)/lib/libltp.a: $(patsubst %.c,%.o,$(wildcard $(srcdir)/lib/ltp/*.c))
      ar -rc $@ $^

But make refuses to do:
%.o: %.c

I even inserted the implicit rule and make refuses to connect the dots...

Furthermore, I just inserted $(CURDIR) in front of $(wildcard ...), and it still refuses to do the right thing.

Isn't this supposed to be evaluated automatically to the expected answer of .c -> .o?

Thanks,
-Garrett

Ok, apparently some monkey removed the implicit rules from execution. How do I get these back?
-Garrett

reply via email to

[Prev in Thread] Current Thread [Next in Thread]