Generate c source code dependence with c compiler and flags

It's wrong to invoke the c++ compiler with c++ flags

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2536daa764275221ca530fd5abfc7568af921570
This commit is contained in:
Xiang Xiao 2021-07-06 14:03:57 +08:00 committed by Xiang Xiao
parent 931a873d04
commit 9b7fe15bfb

View File

@ -216,11 +216,8 @@ register::
endif
.depend: Makefile $(wildcard $(foreach SRC, $(SRCS), $(addsuffix /$(SRC), $(subst :, ,$(VPATH))))) $(DEPCONFIG)
ifeq ($(filter %$(CXXEXT),$(SRCS)),)
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(filter-out Makefile,$(filter-out $(DEPCONFIG),$^)) >Make.dep
else
$(Q) $(MKDEP) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(filter-out Makefile,$(filter-out $(DEPCONFIG),$^)) >Make.dep
endif
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(filter-out %$(CXXEXT) Makefile $(DEPCONFIG),$^) >Make.dep
$(Q) $(MKDEP) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(filter-out %.c Makefile $(DEPCONFIG),$^) >>Make.dep
$(Q) touch $@
depend:: .depend