[Top][All Lists]

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

Target-specific Variable woes

From: Rinehart, Raleigh
Subject: Target-specific Variable woes
Date: Wed, 1 Oct 2008 16:38:02 -0500

I must be having a bad brain day as I’m having what would normally be a pretty simple issue to resolve.


I’m setting a target specific variable and then in that target I do a check to see if it is non-empty but the check always fails.


The variable is set like this: in a sub-module makefile.


$(local_lib) : RENPREFIX := device


The $(local_lib) target is defined like this:


$(local_lib): $(local_objs)

            @echo linking library $@ $(ARFLAGS)

ifneq (,$(RENPREFIX))

            @echo RENPREFIX for $@ = "$(RENPREFIX)"

            $(foreach lobj,$^,$(renobj))


            @$(AR) $(ARFLAGS) $(OUT)$@ $^

@$(MD) output/$(OS)/sharedlibs

            $(CP) $@ output/$(OS)/sharedlibs


Here is where the problem is the ifneq test never works like I expect, however if I use this test: $(if $(RENPREFIX),$(foreach lobj,$^,$(renobj))) then everything works like I expect.  So what am I doing wrong?  I suppose it doesn’t matter since $(if…) is working but I’d really like to figure out why the first method didn’t.


If it matters renobj is: renobj = $(shell $(RENOBJ) $(OBJCOPY) $(lobj) $(RENPREFIX))




reply via email to

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