RE: kbuild & C++

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

 



Hi Sam,

>> How can I compile this code with kbuild? The C++ support
>> (I have tested with 2.6.11) of kbuild seems to be incomplete /
>> not working.
> Since you did not send any sample code shall I assume this was not a
> serious request?

it is of course a serious request.

At the moment we are using some additional rules for kbuild.
They have worked for a previous project of our customer and I
hope they will work for this project, too.

-------------------------------------------------------------------

include $(SRC_ROOT)comps/Kbuild.includes

EXTRA_CPPFLAGS += -fno-exceptions -fno-rtti \
                  $(INCLUDE_DIRS)
EXTRA_CFLAGS += $(INCLUDE_DIRS)


%.o: %.cpp FORCE
	$(call cmd,force_checksrc)
	$(call if_changed_rule,cc_o_cpp)


quiet_cmd_cc_o_cpp = C++ $(quiet_modtag)  $@


ifndef CONFIG_MODVERSIONS
cmd_cc_o_cpp = $(CXX) $(cpp_flags) -c -o $@ $<
else
cmd_cc_o_cpp = $(CXX) $(cpp_flags) -c -o $(@D)/.tmp_$(@F) $<
endif



define rule_cc_o_cpp
        $(if $($(quiet)cmd_checksrc),echo '  $($(quiet)cmd_checksrc)';)
\
        $(cmd_checksrc)
\
        $(if $($(quiet)cmd_cc_o_cpp),echo '  $($(quiet)cmd_cc_o_cpp)';)
\
        $(cmd_cc_o_cpp);
\
        $(cmd_modversions)
\
        scripts/basic/fixdep $(depfile) $@ '$(cmd_cc_o_cpp)' >
$(@D)/.$(@F).tmp;  \
        rm -f $(depfile);
\
        mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
endef

-------------------------------------------------------------------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux