Hi Greg,
Thanks for your reply.
Sorry it was a typo. I tried to copy paste from the file and missed some parts. Here
is the exact implementation.
# Rules to make a dependency file from a C or C++ or ASM source file:
#
define makecxxdeps
$(strip $(subst $(_space_)\,$(_space_),$(shell $(GCC) -M $(_SDE_GCC_CXXOPTIONS) $<)))
endef
define makecdeps
$(strip $(subst $(_space_)\,$(_space_),$(shell $(GCC) -M $(_SDE_GCC_COPTIONS) $<)))
endef
define makeasmdeps
$(strip $(subst $(_space_)\,$(_space_),$(shell $(GCC) -M $(_SDE_GCC_AOPTIONS) $<)))
endef
define dependencies
$(patsubst %.o:,$(@:.d=.$(_SDE_O)):,\
$(if $(filter %.c,$<),$(makecdeps),\
$(if $(filter %.cpp,$<),$(makecxxdeps)\
$(if $(filter %.s %.S %.asm,$<),$(makeasmdeps)\
))))
endef
define run_deps
$(_SDE_ECHO)$(ECHO) Making dependencies for $(notdir $<) ...; \
if [ ! -d $(dir $@) ]; then $(MKDIR) -p $(dir $@); fi; \
$(ECHO) '$@ \'>$@
@$(if $(findstring :,$(dependencies)), $(foreach file,$(dependencies),$(ECHO) '$(file)
\'>>$@ ;),$(ECHO) ': \'>>$@ ;)
@if [ ! -s $@ ]; then $(RM) -Rf $@; fi
endef
%.d: %.cpp
$(run_deps)
%.d: %.c
$(run_deps)
%.d: %.s
$(run_deps)
%.d: %.S
$(run_deps)
%.d: %.asm
$(run_deps)
regards,
bhaskar
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make