From 680f5e79ae06d9d63ae284a61703de677b872dd1 Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 15 May 1998 09:30:13 +0000 Subject: Support Objective C almost as well as C++. Notes: - We no longer use -fgnu-runtime in bsd.lib.mk, since it is the default and bsd.lib.mk is the wrong place to override it. - Gnu C doesn't have a special compiler driver for Objective C like it does for C++. The defaults are suitable for Gnu C. Use `OBJCLIBS=' in /etc/make.conf for POC. --- share/mk/bsd.prog.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'share/mk/bsd.prog.mk') diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 12b380e..d6bf6af 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.71 1998/05/06 15:01:18 bde Exp $ +# $Id: bsd.prog.mk,v 1.72 1998/05/08 06:31:05 bde Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" @@ -8,7 +8,7 @@ # Default executable format BINFORMAT?= aout -.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S +.SUFFIXES: .out .o .c .cc .cxx .C .m .y .l .s .S CFLAGS+=${COPTS} ${DEBUG_FLAGS} .if defined(DESTDIR) @@ -27,6 +27,12 @@ LDFLAGS+= -static .if defined(PROG) .if defined(SRCS) +# If there are Objective C sources, link with Objective C libraries. +.if ${SRCS:M*.m} != "" +OBJCLIBS?= -lobjc +LDADD+= ${OBJCLIBS} +.endif + OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ${PROG}: ${OBJS} -- cgit v1.1