Thanks, here's what I came up with in case someone is searching some day: #------------ new section for kbuild .cmd requirement ------------- cpp_build_opts=`cat $(FLAGS)` # called by existing Makedisk.build gen_symversions cmd_gensymtypes_cc = $(CPP) -D__GENKSYMS__ $(cpp_build_opts) $(CC_FLAGS) $< | $(genksyms) # command to build using g++_ quiet_cmd_cc_o_cc = g++ $(quiet_modtag) $@ cmd_cc_o_cc = g++ $(cpp_build_opts) $(CC_FLAGS) -fno-builtin -nostdlib -std=c++0x -fno-exceptions -fno-rtti -Wall -c -o $@ $< ifdef CONFIG_MODVERSIONS # setup call for build rules cmd_gen_symversions_cc = $(call gen_symversions,cc) endif # multiple items to do on build of .cc file define rule_cc_o_cc $(call cmd_and_fixdep,cc_o_cc) $(call cmd,gen_symversions_cc) endef # pattern for compiling the c++ parts (required for cpp file building) %.o: %.cc $(FLAGS) FORCE $(info doing [$@]) $(call if_changed_rule,cc_o_cc) #--------------- end kbuild .cmd requirement build --------------- On Fri, Feb 2, 2024 at 1:04 AM Nicolas Schier <n.schier@xxxxxx> wrote: > > On Thu, Feb 01, 2024 at 09:51:34PM -0800, David F. wrote: > > Any help would be appreciated on how to create the *.o.cmd file for .cpp files? > > Neither tested nor evaluated in-depth: > You might want to have a look at scripts/Makefile.build and > scripts/Kbuild.include. If you are able to include the relevant kbuild > parts in your Makefile, you could try to supply a cmd_cc_o_cc definition > and use it with if_changed macro. > > Kind regards, > Nicolas