$(LIB_FILES:%.c=$(DEPEND_DIR)/%.P) generates .../junk.P EarRecorder.cpp Engagement.cpp which is not what you want. I'm guessing you are looking for .../junk.P
Try filtering the variable first.
--g
Jamulla, John D wrote:
Hello,
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 \ Engagement.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 # DO NOT DELETE
# 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
[EMAIL PROTECTED], or [EMAIL PROTECTED]
<<John D. Jamulla (E-mail).vcf>>
------------------------------------------------------------------------
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make
_______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make
