OpenClovis / SAFplus-Availability-Scalability-Platform

Middleware that provides libraries, GUI, and code generator to design multi-node (clustered) applications that are highly available, redundant, and scalable. Provides sub-second node and application fault detection and failover, and useful application libraries including distributed hash tables (checkpoint), event, logging, and communications. Implements SA-Forum APIs where applicable. Used anywhere reliability is a must -- like telecom, wireless, defense and enterprise computing. Download stable release with installer from: ftp.openclovis.com
www.openclovis.com
GNU General Public License v2.0
19 stars 13 forks source link

problem with .C and .cpp files #66

Closed AndrewStoneOpenClovis closed 11 years ago

AndrewStoneOpenClovis commented 11 years ago

The issue is compiling c++ file of a component inside a sub-directory. I'm trying to do the following: create sub-directory under the component directory, put c++ file (either .C or .cpp, it doesn't matter), and in the component makefile to make the changes: BUILD_CPLUSPLUS=1 And SRC_FILES += $(wildcard /file.C)

It doesn't work ! the makefile tries to find the c++ file in the component directory and not in the sub-directory. This works perfectly for c files, the problem is only with c++ file. If I put the c++ file in the component directory (and not in sub directory) then there is no problem.


found the problem. It is in make-common.mk: At the end of the file you have: vpath %.c $(vpath_list) vpath %.cxx $(vpath_list)

And this line is missing for .C and .cpp. When I add those lines: vpath %.C $(vpath_list) vpath %.cpp $(vpath_list)

CangTranOC commented 11 years ago

Hi,

Please fix the following bugs in make-common.mk:

$(foreach lib,$(ALL_STATIC_LIB_NAMES), \

$(shell $(ECHO) "$(LIB_DIR)/$(lib).a: $(addprefix $(OBJ_DIR)/,$(subst .c,.o,$(subst .cpp,.o,$(notdir $(SRCFILES$(lib):.c=.o)))))" >> $(INC_DIR)/libs.mk\

&& $(ECHO) -e '\t$$(call cmd,ar)' >> $(INC_DIR)/libs.mk))

Actually there are several places in your make files that handle only .c and not .cpp . I guess you should go over all places and fix them. Also, I believe you should handle all possible file extensions such as .C, .cxx, .CPP or just decide what is the subset you support.

Thanks, Hilla.