On Sat, Sep 03, 2016 at 10:42:51PM +0100, Patrick Wildt wrote:
> Hi,
>
> the LLVM project apparently uses the .cpp extension for all their C++
> files. We already handle .cpp in sys.mk, but make depend does not
> handle .cpp at all. This means that on "make depend" no .depend file
> will be generated if there are only .cpp source files. But as SRCS is
> set it will still expect an .depend file and throw an error. Simply
> pick up .cpp files to fix this.
>
> Patrick
mikeb@ helped me fix the 80 character issues, so this would be the
updated diff:
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 55f75b0..8a62326 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -20,8 +20,9 @@ realdepend: _SUBDIRUSE
echo mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
fi
- @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
- if [ "$$files" != " " ]; then \
+ @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp}"; \
+ files="$$files ${.ALLSRC:M*.cxx}"; \
+ if [ "$$files" != " " ]; then \
echo mkdep -a ${MKDEP} ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
mkdep -a ${MKDEP} ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
fi