Index: head/share/mk/bsd.dep.mk =================================================================== --- head/share/mk/bsd.dep.mk (revision 36672) +++ head/share/mk/bsd.dep.mk (revision 36673) @@ -1,142 +1,143 @@ -# $Id: bsd.dep.mk,v 1.23 1998/05/15 09:30:11 bde Exp $ +# $Id: bsd.dep.mk,v 1.24 1998/05/15 09:34:48 bde Exp $ # # The include file handles Makefile dependencies. # # # +++ variables +++ # # DEPENDFILE dependencies file [.depend] # # MKDEP Options for ${MKDEPCMD} [not set] # # MKDEPCMD Makefile dependency list program [mkdep] # # SRCS List of source files (c, c++, assembler) # # # +++ targets +++ # # cleandepend: # Remove depend and tags file # # depend: # Make the dependencies for the source files, and store # them in the file ${DEPENDFILE}. # # tags: # Create a (GLOBAL) gtags file for the source files. # If HTML is defined, htags is also run after gtags. MKDEPCMD?= mkdep DEPENDFILE?= .depend .if defined(SRCS) CLEANFILES?= .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:S/.l/.c/} ${_LC}: ${_LSRC} ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} CLEANFILES:= ${CLEANFILES} ${_LC} .endfor .endfor .for _YSRC in ${SRCS:M*.y:N*/*} .for _YC in ${_YSRC:S/.y/.c/} SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} CLEANFILES:= ${CLEANFILES} ${_YC} .if ${YFLAGS:M-d} != "" && ${SRCS:My.tab.h} .ORDER: ${_YC} y.tab.h ${_YC} y.tab.h: ${_YSRC} ${YACC} ${YFLAGS} ${.ALLSRC} cp y.tab.c ${_YC} SRCS:= ${SRCS} y.tab.h CLEANFILES:= ${CLEANFILES} y.tab.c y.tab.h .elif ${YFLAGS:M-d} != "" .for _YH in ${_YC:S/.c/.h/} .ORDER: ${_YC} ${_YH} ${_YC} ${_YH}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} SRCS:= ${SRCS} ${_YH} CLEANFILES:= ${CLEANFILES} ${_YH} .endfor .else ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif .endfor .endfor .endif .if !target(depend) .if defined(SRCS) depend: beforedepend ${DEPENDFILE} afterdepend _SUBDIR # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. ${DEPENDFILE}: ${SRCS} rm -f ${DEPENDFILE} .if ${SRCS:M*.[sS]} != "" ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ ${AINC} \ ${.ALLSRC:M*.[sS]} .endif .if ${SRCS:M*.c} != "" ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ ${.ALLSRC:M*.c} .endif -.if ${SRCS:M*.cc} != "" || ${SRCS:M*.C} != "" || ${SRCS:M*.cxx} != "" +.if ${SRCS:M*.cc} != "" || ${SRCS:M*.C} != "" || ${SRCS:M*.cpp} != "" || \ + ${SRCS:M*.cxx} != "" ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*} \ - ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx} + ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx} .endif .if ${SRCS:M*.m} != "" ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${OBJCFLAGS:M-nostdinc*} ${OBJCFLAGS:M-[BID]*} \ ${OBJCFLAGS:M-Wno-import*} \ ${.ALLSRC:M*.m} .endif .if target(_EXTRADEPEND) cd ${.CURDIR}; ${MAKE} _EXTRADEPEND .endif .ORDER: ${DEPENDFILE} afterdepend .else depend: beforedepend afterdepend _SUBDIR .endif .if !target(beforedepend) beforedepend: .else .ORDER: beforedepend ${DEPENDFILE} .ORDER: beforedepend afterdepend .endif .if !target(afterdepend) afterdepend: .endif .endif .if defined(NOTAGS) tags: .endif .if !target(tags) tags: ${SRCS} _SUBDIR @cd ${.CURDIR} && gtags ${GTAGSFLAGS} ${.OBJDIR} .if defined(HTML) @cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR} .endif .endif .if !target(cleandepend) cleandepend: _SUBDIR .if defined(SRCS) rm -f ${DEPENDFILE} ${.OBJDIR}/GRTAGS ${.OBJDIR}/GSYMS ${.OBJDIR}/GTAGS .if defined(HTML) rm -rf ${.OBJDIR}/HTML .endif .endif .endif Index: head/share/mk/bsd.lib.mk =================================================================== --- head/share/mk/bsd.lib.mk (revision 36672) +++ head/share/mk/bsd.lib.mk (revision 36673) @@ -1,328 +1,328 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $Id: bsd.lib.mk,v 1.72 1998/05/15 09:34:48 bde Exp $ +# $Id: bsd.lib.mk,v 1.73 1998/06/04 15:15:38 peter Exp $ # .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif # Default executable format .if ${MACHINE} == "alpha" BINFORMAT?= elf .else BINFORMAT?= aout .endif .if exists(${.CURDIR}/shlib_version) SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major .if ${BINFORMAT} == aout SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor .endif .endif .if !defined(NOPIC) && ${BINFORMAT} == elf SONAME?= lib${LIB}.so.${SHLIB_MAJOR} .endif .if defined(DESTDIR) CFLAGS+= -I${DESTDIR}/usr/include CXXINCLUDES+= -I${DESTDIR}/usr/include/g++ .endif .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} .endif .if !defined(DEBUG_FLAGS) STRIP?= -s .endif .if ${BINFORMAT} != aout || make(checkdpadd) .include .endif .MAIN: all # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries # .so used for PIC object files .SUFFIXES: -.SUFFIXES: .out .o .po .so .s .S .c .cc .cxx .m .C .f .y .l +.SUFFIXES: .out .o .po .so .s .S .c .cc .cpp .cxx .m .C .f .y .l .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .c.po: ${CC} -pg ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -X -r ${.TARGET} .c.so: ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} -.cc.o .C.o .cxx.o: +.cc.o .C.o .cpp.o .cxx.o: ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} -.cc.po .C.po .cxx.po: +.cc.po .C.po .cpp.po .cxx.po: ${CXX} -pg ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -X -r ${.TARGET} -.cc.so .C.so .cxx.so: +.cc.so .C.so .cpp.so .cxx.so: ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .f.o: ${FC} ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} @${LD} -O ${.TARGET} -x -r ${.TARGET} .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} @${LD} -O ${.TARGET} -X -r ${.TARGET} .f.so: ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} @${LD} -O ${.TARGET} -x -r ${.TARGET} .m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .m.po: ${OBJC} ${OBJCFLAGS} -pg -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -X -r ${.TARGET} .m.so: ${OBJC} ${PICFLAG} -DPIC ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .s.o: ${CC} -x assembler-with-cpp ${CFLAGS:M-[BID]*} ${AINC} -c \ ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .s.po: ${CC} -x assembler-with-cpp -DPROF ${CFLAGS:M-[BID]*} ${AINC} -c \ ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -X -r ${.TARGET} .s.so: ${CC} -x assembler-with-cpp -fpic -DPIC ${CFLAGS:M-[BID]*} ${AINC} -c \ ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .S.o: ${CC} ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .S.po: ${CC} -DPROF ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -X -r ${.TARGET} .S.so: ${CC} -fpic -DPIC ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET} @${LD} -O ${.TARGET} -x -r ${.TARGET} .if !defined(INTERNALLIB) || defined(INTERNALSTATICLIB) .if !defined(NOPROFILE) && !defined(INTERNALLIB) _LIBS=lib${LIB}.a lib${LIB}_p.a .else _LIBS=lib${LIB}.a .endif .endif .if !defined(NOPIC) .if ${BINFORMAT} == aout .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} .endif .else .if defined(SHLIB_MAJOR) _LIBS+=lib${LIB}.so.${SHLIB_MAJOR} .endif .endif .if defined(INSTALL_PIC_ARCHIVE) _LIBS+=lib${LIB}_pic.a .endif .endif .if !defined(PICFLAG) PICFLAG=-fpic .endif all: objwarn ${_LIBS} all-man _SUBDIR # llib-l${LIB}.ln OBJS+= ${SRCS:N*.h:R:S/$/.o/g} lib${LIB}.a:: ${OBJS} @${ECHO} building standard ${LIB} library @rm -f lib${LIB}.a @${AR} cq lib${LIB}.a `lorder ${OBJS} | tsort -q` ${ARADD} ${RANLIB} lib${LIB}.a .if !defined(NOPROFILE) POBJS+= ${OBJS:.o=.po} lib${LIB}_p.a:: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f lib${LIB}_p.a @${AR} cq lib${LIB}_p.a `lorder ${POBJS} | tsort -q` ${ARADD} ${RANLIB} lib${LIB}_p.a .endif .if defined(DESTDIR) LDDESTDIRENV?= LIBRARY_PATH=${DESTDIR}${SHLIBDIR}:${DESTDIR}${LIBDIR} .endif .if !defined(NOPIC) SOBJS+= ${OBJS:.o=.so} .if ${BINFORMAT} == aout lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: ${SOBJS} @${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}.${SHLIB_MINOR}\) @rm -f lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} @${LDDESTDIRENV} ${CC} -shared -Wl,-x -Wl,-assert -Wl,pure-text \ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ `lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD} .else lib${LIB}.so.${SHLIB_MAJOR}: ${SOBJS} @${ECHO} building shared ${LIB} library \(version ${SHLIB_MAJOR}\) @rm -f lib${LIB}.so.${SHLIB_MAJOR} @${LDDESTDIRENV} ${CC} -shared -Wl,-x \ -o lib${LIB}.so.${SHLIB_MAJOR} -Wl,-soname,${SONAME} \ `lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD} .endif lib${LIB}_pic.a:: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f lib${LIB}_pic.a @${AR} cq lib${LIB}_pic.a ${SOBJS} ${ARADD} ${RANLIB} lib${LIB}_pic.a .endif llib-l${LIB}.ln: ${SRCS} ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c} .if !target(clean) clean: _SUBDIR rm -f a.out ${OBJS} ${CLEANFILES} rm -f lib${LIB}.a # llib-l${LIB}.ln rm -f ${POBJS} lib${LIB}_p.a .if defined(SOBJS) && !empty(SOBJS) rm -f ${SOBJS} .endif rm -f lib${LIB}.so.*.* lib${LIB}_pic.a .if defined(CLEANDIRS) && !empty(CLEANDIRS) rm -rf ${CLEANDIRS} .endif .endif _EXTRADEPEND: @TMP=_depend$$$$; \ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < ${DEPENDFILE} \ > $$TMP; \ mv $$TMP ${DEPENDFILE} .if !defined(NOEXTRADEPEND) && !defined(NOPIC) .if ${BINFORMAT} == aout echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \ `${LDDESTDIRENV} ${CC} -shared -Wl,-f ${LDDESTDIR} ${LDADD}` \ >> ${DEPENDFILE} .else .if defined(DPADD) && !empty(DPADD) echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \ ${DPADD} >> ${DEPENDFILE} .endif .endif .endif .if !target(install) .if !target(beforeinstall) beforeinstall: .endif .if defined(PRECIOUSLIB) SHLINSTALLFLAGS+= -fschg .endif realinstall: beforeinstall .if !defined(INTERNALLIB) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR} .if !defined(NOPROFILE) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR} .endif .endif .if !defined(NOPIC) .if ${BINFORMAT} == aout .if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} ${SHLINSTALLFLAGS} \ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ ${DESTDIR}${SHLIBDIR} .endif .else .if defined(SHLIB_MAJOR) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} ${SHLINSTALLFLAGS} \ lib${LIB}.so.${SHLIB_MAJOR} \ ${DESTDIR}${SHLIBDIR} ln ${LN_FLAGS} -sf lib${LIB}.so.${SHLIB_MAJOR} \ ${DESTDIR}${SHLIBDIR}/lib${LIB}.so .endif .endif .if defined(INSTALL_PIC_ARCHIVE) ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR} .endif .endif .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ l=${DESTDIR}$$1; \ shift; \ t=${DESTDIR}$$1; \ shift; \ ${ECHO} $$t -\> $$l; \ rm -f $$t; \ ln ${LN_FLAGS} $$l $$t; \ done; true .endif install: afterinstall _SUBDIR .if !defined(NOMAN) afterinstall: realinstall maninstall .else afterinstall: realinstall .endif .endif .if !target(regress) regress: .endif DISTRIBUTION?= bin .if !target(distribute) distribute: _SUBDIR .for dist in ${DISTRIBUTION} cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies .endfor .endif .if !target(lint) lint: .endif .if !defined(NOMAN) .include .elif !target(maninstall) maninstall: all-man: .endif .include .if !exists(${DEPENDFILE}) ${OBJS} ${POBJS} ${SOBJS}: ${SRCS:M*.h} .endif .include Index: head/share/mk/bsd.prog.mk =================================================================== --- head/share/mk/bsd.prog.mk (revision 36672) +++ head/share/mk/bsd.prog.mk (revision 36673) @@ -1,168 +1,168 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.73 1998/05/15 09:30:12 bde Exp $ +# $Id: bsd.prog.mk,v 1.74 1998/05/15 09:34:48 bde Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif # Default executable format BINFORMAT?= aout -.SUFFIXES: .out .o .c .cc .cxx .C .m .y .l .s .S +.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .s .S CFLAGS+=${COPTS} ${DEBUG_FLAGS} .if defined(DESTDIR) CFLAGS+= -I${DESTDIR}/usr/include CXXINCLUDES+= -I${DESTDIR}/usr/include/g++ .endif .if !defined(DEBUG_FLAGS) STRIP?= -s .endif .if defined(NOSHARED) && ( ${NOSHARED} != "no" && ${NOSHARED} != "NO" ) LDFLAGS+= -static .endif .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} ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD} .else !defined(SRCS) .if !target(${PROG}) SRCS= ${PROG}.c # Always make an intermediate object file because: # - it saves time rebuilding when only the library has changed # - the name of the object gets put into the executable symbol table instead of # the name of a variable temporary object. # - it's useful to keep objects around for crunching. OBJS= ${PROG}.o ${PROG}: ${OBJS} ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD} .endif .endif .if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ !defined(MAN7) && !defined(MAN8) && !defined(NOMAN) MAN1= ${PROG}.1 .endif .endif .MAIN: all all: objwarn ${PROG} all-man _SUBDIR CLEANFILES+= ${PROG} ${OBJS} .if defined(PROG) && !defined(NOEXTRADEPEND) _EXTRADEPEND: .if ${BINFORMAT} == aout echo ${PROG}: `${CC} -Wl,-f ${CFLAGS} ${LDFLAGS} ${LDDESTDIR} \ ${LDADD:S/^/-Wl,/}` >> ${DEPENDFILE} .else .if defined(DPADD) && !empty(DPADD) echo ${PROG}: ${DPADD} >> ${DEPENDFILE} .endif .endif .endif .if !target(install) .if !target(beforeinstall) beforeinstall: .endif realinstall: beforeinstall .if defined(PROG) ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR} .endif .if defined(HIDEGAME) (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \ chown games:bin ${PROG}) .endif .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ l=${DESTDIR}$$1; \ shift; \ t=${DESTDIR}$$1; \ shift; \ ${ECHO} $$t -\> $$l; \ rm -f $$t; \ ln ${LN_FLAGS} $$l $$t; \ done; true .endif install: afterinstall _SUBDIR .if !defined(NOMAN) afterinstall: realinstall maninstall .else afterinstall: realinstall .endif .endif DISTRIBUTION?= bin .if !target(distribute) distribute: _SUBDIR .for dist in ${DISTRIBUTION} cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies .endfor .endif .if !target(lint) lint: ${SRCS} _SUBDIR .if defined(PROG) @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1 .endif .endif .if defined(NOTAGS) tags: .endif .if !target(tags) tags: ${SRCS} _SUBDIR .if defined(PROG) @cd ${.CURDIR} && gtags ${GTAGSFLAGS} ${.OBJDIR} .if defined(HTML) @cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR} .endif .endif .endif .if !defined(NOMAN) .include .elif !target(maninstall) maninstall: all-man: .endif .if !target(regress) regress: .endif .if ${BINFORMAT} != aout || make(checkdpadd) .include .endif .include .if defined(PROG) && !exists(${DEPENDFILE}) ${OBJS}: ${SRCS:M*.h} .endif .include Index: head/share/mk/sys.mk =================================================================== --- head/share/mk/sys.mk (revision 36672) +++ head/share/mk/sys.mk (revision 36673) @@ -1,255 +1,255 @@ # from: @(#)sys.mk 8.2 (Berkeley) 3/21/94 -# $Id: sys.mk,v 1.35 1998/06/03 08:51:39 jb Exp $ +# $Id: sys.mk,v 1.36 1998/06/03 22:07:26 jb Exp $ unix ?= We run FreeBSD, not UNIX. # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall # process the makefile as specified by the Posix 1003.2 specification. # make(1) sets the special macro %POSIX in this case (to the actual # value "1003.2", for what it's worth). # # The rules below use this macro to distinguish between Posix-compliant # and default behaviour. .if defined(%POSIX) .SUFFIXES: .o .c .y .l .a .sh .f .else -.SUFFIXES: .out .a .ln .o .c .cc .cxx .C .m .F .f .e .r .y .l .S .s .cl .p .h .sh +.SUFFIXES: .out .a .ln .o .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .s .cl .p .h .sh .endif .LIBS: .a X11BASE ?= /usr/X11R6 AR ?= ar .if defined(%POSIX) ARFLAGS ?= -rv .else ARFLAGS ?= rl .endif RANLIB ?= ranlib AS ?= as AFLAGS ?= .if defined(%POSIX) CC ?= c89 .else CC ?= cc .endif CFLAGS ?= -O -pipe CXX ?= c++ CXXFLAGS ?= ${CXXINCLUDES} ${CFLAGS} CPP ?= cpp .if ${.MAKEFLAGS:M-s} == "" ECHO ?= echo ECHODIR ?= echo .else ECHO ?= true .if ${.MAKEFLAGS:M-s} == "-s" ECHODIR ?= echo .else ECHODIR ?= true .endif .endif .if defined(%POSIX) FC ?= fort77 FFLAGS ?= -O 1 .else FC ?= f77 FFLAGS ?= -O .endif EFLAGS ?= INSTALL ?= install LEX ?= lex LFLAGS ?= LD ?= ld LDFLAGS ?= LINT ?= lint LINTFLAGS ?= -chapbx MAKE ?= make OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import PC ?= pc PFLAGS ?= RC ?= f77 RFLAGS ?= SHELL ?= sh YACC ?= yacc .if defined(%POSIX) YFLAGS ?= .else YFLAGS ?= -d .endif # FreeBSD/i386 as traditionally been built with a version of make # which knows MACHINE, but not MACHINE_ARCH. When building on other # architectures, assume that the version of make being used has an # explicit MACHINE_ARCH setting and treat a missing MACHINE_ARCH # as an i386 architecture. MACHINE_ARCH?= i386 # Default executable format .if ${MACHINE_ARCH} == "alpha" BINFORMAT ?= elf .else BINFORMAT ?= aout .endif # For tags rule. GTAGSFLAGS= -o HTAGSFLAGS= .if defined(%POSIX) # Posix 1003.2 mandated rules # # Quoted directly from the Posix 1003.2 draft, only the macros # $@, $< and $* have been replaced by ${.TARGET}, ${.IMPSRC}, and # ${.PREFIX}, resp. # SINGLE SUFFIX RULES .c: ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} .f: ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} .sh: cp ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} # DOUBLE SUFFIX RULES .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} .f.o: ${FC} ${FFLAGS} -c ${.IMPSRC} .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c rm -f y.tab.c mv y.tab.o ${.TARGET} .l.o: ${LEX} ${LFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c lex.yy.c rm -f lex.yy.c mv lex.yy.o ${.TARGET} .y.c: ${YACC} ${YFLAGS} ${.IMPSRC} mv y.tab.c ${.TARGET} .l.c: ${LEX} ${LFLAGS} ${.IMPSRC} mv lex.yy.c ${.TARGET} .c.a: ${CC} ${CFLAGS} -c ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o rm -f ${.PREFIX}.o .f.a: ${FC} ${FFLAGS} -c ${.IMPSRC} ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o rm -f ${.PREFIX}.o .else # non-Posix rule set .c: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} .sh: cp -p ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} -.cc.o .cxx.o .C.o: +.cc.o .cpp.o .cxx.o .C.o: ${CXX} ${CXXFLAGS} -c ${.IMPSRC} .m.o: ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} .p.o: ${PC} ${PFLAGS} -c ${.IMPSRC} .e.o .r.o .F.o .f.o: ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} .S.o: ${CC} ${CFLAGS} -c ${.IMPSRC} .s.o: ${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC} # XXX not -j safe .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET} rm -f y.tab.c .l.o: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET} rm -f ${.PREFIX}.tmp.c # XXX not -j safe .y.c: ${YACC} ${YFLAGS} ${.IMPSRC} mv y.tab.c ${.TARGET} .l.c: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET} .s.out .c.out .o.out: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} .f.out .F.out .r.out .e.out: ${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \ ${LDLIBS} -o ${.TARGET} rm -f ${.PREFIX}.o # XXX not -j safe .y.out: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET} rm -f y.tab.c .l.out: ${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c ${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET} rm -f ${.PREFIX}.tmp.c .endif .include .if exists(/etc/make.conf) .include .endif # Architectures that use NetBSD syscalls: .if ${MACHINE_ARCH} == "alpha" CFLAGS += -D__NETBSD_SYSCALLS .endif