[Top][All Lists]

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

Re: Question with gmake 3.80 and substitution references

From: Graham Nash
Subject: Re: Question with gmake 3.80 and substitution references
Date: Fri, 05 Sep 2003 09:30:30 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624

   .../junk.P EarRecorder.cpp Engagement.cpp
which is not what you want. I'm guessing you are looking for

Try filtering the variable first.


Jamulla, John D wrote:


I am using gmake 3.80 on Solaris 2.8. I'm having a problem with a simple
suffix replacement.

1. In a local makefile I tried to put the following line at the end of the
makefile, it doesn't work:
-include $(LIB_FILES:%.c=$(DEPEND_DIR)/%.P)

but the following line DOES work:
-include $(LIB_FILES:%.cpp=$(DEPEND_DIR)/%.P)

I have a variable in the same local makefile called LIB_FILES, it's set as
follows (before the above lines):
LIB_FILES    =  \
junk.c \
EarRecorder.cpp \

I wanted this to be the list of source files to compile, both C and C++
files would be in this list. I'll convert these to objects with the
following variable substitutions.

In the makefile, towards the end of it, I include another makefile called
Common_Make_Rules, here's the excerpt of the end of the local makefile:
# Include rules common to all make files
include ${TOPDIR}/build/Common_Make_Rules

# Include all dependency files
-include $(LIB_FILES:%.cpp=$(DEPEND_DIR)/%.P)
#-include $(LIB_FILES:%.c=$(DEPEND_DIR)/%.P)

which has the following in it:

LIB_OBJS             = $(LIB_FILES: %.c =$(OBJ_DIR)/%.o)

I expected this to take my source files listed in the LIB_FILES (with a .c
suffix) and replace the
.c with a .o. BUT, what I get instead is the original filenames, which means
it does NOT replace anything.

If I comment out the above line and use the line below instead, the same
thing happens, as long as I have the junk.c listed in the LIB_FILES above
(no replacements happen).

LIB_OBJS            += $(LIB_FILES: %.cpp=$(OBJ_DIR)/%.o)

If I remove the junk.c and use the above line which should convert .cpp's to
.o's it works just fine.

I'm really not sure why I'm having a problem with the .c lines above. The
.cpp ones work ok. I guess I'm missing something subtle?

I'm not on the mailing list so please Cc: me directly if you can help me.

John D. Jamulla - Senior Engineer
Northrop Grumman Corporation
Electronic Systems
Amherst Systems
Buffalo N.Y. 14221, (716) 631-0610
address@hidden, or address@hidden
<<John D. Jamulla (E-mail).vcf>>

Help-make mailing list

reply via email to

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