diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-03-18 10:51:36 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-03-18 10:51:36 +0000 |
commit | 4146104d0120ee60bde7ccd393f99ea2f6ebd5a2 (patch) | |
tree | 90b2278993ef5e8957d57fc62b32d808fb3ad44e /share | |
parent | b86f44ae8013c4c8fd7695930caf39fc8e5bac75 (diff) |
Recognize and treat files with .cpp extension like any other C++ file.
This will help me reduce some xenocara Makefiles and as millert@ pointed
out, .cpp has won over .C or .cxx ;)
Tested in a bulk by landry@, ok espie@, sthen@
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.lib.mk | 12 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 66f764cff4c..6d6db7c880e 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.lib.mk,v 1.68 2012/09/16 20:41:16 kettenis Exp $ +# $OpenBSD: bsd.lib.mk,v 1.69 2013/03/18 10:51:35 mpi Exp $ # $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $ # @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 @@ -25,7 +25,7 @@ SHLIB_MINOR=${minor} # .so used for PIC object files. # .m for objective c files. .SUFFIXES: -.SUFFIXES: .out .o .go .po .so .S .s .c .cc .C .cxx .f .y .l .m4 .m +.SUFFIXES: .out .o .go .po .so .S .s .c .cc .cpp .C .cxx .f .y .l .m4 .m .if defined(NOPIE) CFLAGS+= ${NOPIE_FLAGS} @@ -56,25 +56,25 @@ AFLAGS+= ${NOPIE_FLAGS} @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o -.cc.o .C.o .cxx.o: +.cc.o .cpp.o .C.o .cxx.o: @echo "${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o -.cc.go .C.go .cxx.go: +.cc.go .cpp.go .C.go .cxx.go: @echo "${COMPILE.cc} -g ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} -g ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o -.cc.po .C.po .cxx.po: +.cc.po .cpp.po .C.po .cxx.po: @echo "${COMPILE.cc} -p ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} -p ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o -.cc.so .C.so .cxx.so: +.cc.so .cpp.so .C.so .cxx.so: @echo "${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" @${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o @${LD} -X -r ${.TARGET}.o -o ${.TARGET} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index dad79caa35e..edefa0c0b39 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.prog.mk,v 1.56 2012/08/28 16:45:03 pascal Exp $ +# $OpenBSD: bsd.prog.mk,v 1.57 2013/03/18 10:51:35 mpi Exp $ # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 @@ -8,7 +8,7 @@ .include <bsd.own.mk> -.SUFFIXES: .out .o .c .cc .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 +.SUFFIXES: .out .o .c .cc .cpp .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 .if defined(LDSTATIC) || defined(NOPIE) CFLAGS+= ${NOPIE_FLAGS} @@ -87,7 +87,8 @@ _YACCINTM+=${SRCS:M*.y:.y=.c} . endif . if defined(OBJS) && !empty(OBJS) -. if !empty(SRCS:M*.C) || !empty(SRCS:M*.cc) || !empty(SRCS:M*.cxx) +. if !empty(SRCS:M*.C) || !empty(SRCS:M*.cc) || !empty(SRCS:M*.cpp) || \ + !empty(SRCS:M*.cxx) ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} ${CXX} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} . else |