summaryrefslogtreecommitdiff
path: root/share/mk
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
committersvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /share/mk
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/Makefile7
-rw-r--r--share/mk/bsd.README4
-rw-r--r--share/mk/bsd.dep.mk47
-rw-r--r--share/mk/bsd.doc.mk23
-rw-r--r--share/mk/bsd.lib.mk198
-rw-r--r--share/mk/bsd.man.mk3
-rw-r--r--share/mk/bsd.own.mk2
-rw-r--r--share/mk/bsd.prog.mk40
-rw-r--r--share/mk/bsd.subdir.mk3
-rw-r--r--share/mk/bsd.subdir_ports.mk184
-rw-r--r--share/mk/sys.mk12
11 files changed, 380 insertions, 143 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile
index ac05188323bc..4cd9f0bd35eb 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -1,7 +1,8 @@
-# @(#)Makefile 5.3 (Berkeley) 6/22/90
+# from: @(#)Makefile 5.3 (Berkeley) 6/22/90
+# $Id: Makefile,v 1.4 1994/02/13 18:14:57 jkh Exp $
-FILES= bsd.README bsd.doc.mk bsd.lib.mk bsd.man.mk bsd.own.mk \
- bsd.prog.mk bsd.subdir.mk sys.mk
+FILES= bsd.README bsd.dep.mk bsd.doc.mk bsd.lib.mk bsd.man.mk bsd.own.mk \
+ bsd.prog.mk bsd.subdir.mk sys.mk bsd.subdir_ports.mk
NOOBJ= noobj
all clean cleandir depend lint tags:
diff --git a/share/mk/bsd.README b/share/mk/bsd.README
index cfe2fdc7765a..2db42b425142 100644
--- a/share/mk/bsd.README
+++ b/share/mk/bsd.README
@@ -1,4 +1,5 @@
-# @(#)bsd.README 5.1 (Berkeley) 5/11/90
+# from:@(#)bsd.README 5.1 (Berkeley) 5/11/90
+# $Id: bsd.README,v 1.6 1994/01/31 06:10:29 rgrimes Exp $
This is the README file for the new make "include" files for the BSD
source tree. The files are installed in /usr/share/mk, and are, by
@@ -227,7 +228,6 @@ DPADD Additional dependencies for the program. Usually used for
LIBMP /usr/lib/libmp.a
LIBPC /usr/lib/libpc.a
LIBPLOT /usr/lib/libplot.a
- LIBRPC /usr/lib/sunrpc.a
LIBTELNET /usr/lib/libtelnet.a
LIBTERM /usr/lib/libterm.a
LIBUTIL /usr/lib/libutil.a
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
new file mode 100644
index 000000000000..3663abd22361
--- /dev/null
+++ b/share/mk/bsd.dep.mk
@@ -0,0 +1,47 @@
+# $Id: bsd.dep.mk,v 1.3.2.1 1994/03/07 01:53:47 rgrimes Exp $
+
+# some of the rules involve .h sources, so remove them from mkdep line
+.if !target(depend)
+depend: beforedepend .depend afterdepend
+.if defined(SRCS)
+.depend: ${SRCS}
+ rm -f .depend
+ files="${.ALLSRC:M*.[sS]}"; \
+ if [ "$$files" != "" ]; then \
+ mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${AINC} $$files; \
+ fi
+ files="${.ALLSRC:M*.c}"; \
+ if [ "$$files" != "" ]; then \
+ mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \
+ fi
+ files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
+ if [ "$$files" != " " ]; then \
+ mkdep -a ${MKDEP} ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[ID]*} $$files; \
+ fi
+.else
+.depend:
+.endif
+.if !target(beforedepend)
+beforedepend:
+.endif
+.if !target(afterdepend)
+afterdepend:
+.endif
+.endif
+
+.if !target(tags)
+.if defined(SRCS)
+tags: ${SRCS}
+ -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
+ sed "s;\${.CURDIR}/;;" > tags
+.else
+tags:
+.endif
+.endif
+
+.if defined(SRCS)
+clean:
+cleandir: cleandepend
+cleandepend:
+ rm -f .depend ${.CURDIR}/tags
+.endif
diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk
index 99089418741c..8d64918ddc74 100644
--- a/share/mk/bsd.doc.mk
+++ b/share/mk/bsd.doc.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
-# $Id: bsd.doc.mk,v 1.5 1993/10/11 03:48:05 rgrimes Exp $
+# $Id: bsd.doc.mk,v 1.6 1994/02/03 19:58:23 jkh Exp $
PRINTER?= ps
@@ -55,22 +55,25 @@ obj:
.endif
.endif
-clean cleandir:
+clean:
rm -f ${DOC}.* [eE]rrs mklog ${CLEANFILES}
- rm -rf obj
+
+cleandir:
+ rm -f ${DOC}.* [eE]rrs mklog ${CLEANFILES}
+ cd ${.CURDIR}; rm -rf obj
FILES?= ${SRCS}
install:
- @if [ ! -d "${DESTDIR}${BINDIR}/${DIR}" ]; then \
- /bin/rm -f ${DESTDIR}${BINDIR}/${DIR} ; \
- mkdir -p ${DESTDIR}${BINDIR}/${DIR} ; \
- chown root.wheel ${DESTDIR}${BINDIR}/${DIR} ; \
- chmod 755 ${DESTDIR}${BINDIR}/${DIR} ; \
+ @if [ ! -d "${DESTDIR}${BINDIR}/${VOLUME}" ]; then \
+ /bin/rm -f ${DESTDIR}${BINDIR}/${VOLUME} ; \
+ mkdir -p ${DESTDIR}${BINDIR}/${VOLUME} ; \
+ chown root.wheel ${DESTDIR}${BINDIR}/${VOLUME} ; \
+ chmod 755 ${DESTDIR}${BINDIR}/${VOLUME} ; \
else \
true ; \
fi
- ( cd ${.CURDIR} ; install ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
- Makefile ${FILES} ${EXTRA} ${DESTDIR}${BINDIR}/${DIR} )
+ install ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${DOC}.* \
+ ${DESTDIR}${BINDIR}/${VOLUME}
spell: ${SRCS}
(cd ${.CURDIR}; spell ${SRCS} ) | sort | \
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 3ec696a8c5c0..313b52e72d9a 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -1,72 +1,17 @@
-# @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
-#
-# $Log: bsd.lib.mk,v $
-# Revision 1.12 1993/10/08 12:19:22 rgrimes
-# This fix is from Chris Demetriou
-# You need a SUFFIX: line that has nothing on it so that the built-in
-# SUFFIX rules get cleared. This is why we did not build the c library
-# using the optimized assembler sources for the i386.
-#
-# You need to make clean in src/lib/libc and rebuild libc, then relink
-# the rest of the world for this fix to take effect.
-#
-# Revision 1.11 1993/08/15 01:27:28 nate
-# 1) Finishedup my DPSRCS fixes from way back. Now any .h files will
-# automatically be depended and stripped out of the SRCS line
-# (I also left the external definition as well, in case of non-src
-# dependencies)
-#
-# 2) Cleaned up some of the clean/cleandirs to have a more pleasing format
-# (rm -f on every line rather than line-continuations)
-#
-# 3) Added Charles Hannum's dependency fixes for a cleaner make depend that
-# works for both c/c++ files
-#
-# 4) Added default targets for (file.cc|cxx|C) -> file.o in the all
-# affected make macros. However, these as well as Charles c++
-# dependency fixes are commented out so that groff won't be broken.
-# I'll uncomment them after further testing on my box and seeing if
-# groff should be modified rather than relying on gcc2 doing the right
-# thing (subject to group vote)
-#
-# Revision 1.10 1993/08/11 03:15:20 alm
-# added rules .f.po (and .f.o) from Jonas.
-#
-# Revision 1.9 1993/08/05 18:45:53 nate
-# Removed the ranlib statements from before the install (since it's done
-# after the install as well), and changed ranlib -> ${RANLIB}
-#
-# Revision 1.8 1993/08/03 20:57:34 nate
-# Fixed macros so that you can do a
-# make maninstall at all times and have it not blow up
-#
-# Revision 1.7 1993/07/23 20:44:38 nate
-# Fixed a boo-boo and made the NOMAN environment variable work correctly with
-# both programs and libraries.
-#
-# Revision 1.6 1993/07/09 00:38:35 jkh
-# Removed $History$ line from hell (no leading #).
-#
-# Revision 1.5 1993/07/08 12:17:07 paul
-# Removed the core.* before disaster strikes.
-# I removed core as well since it's pretty redundant.
-#
-# Revision 1.4 1993/07/07 21:42:45 nate
-# Cleaned up header files and added core.* to clean directives
-#
-# Revision 1.3 1993/07/02 06:44:30 root
-# New manual page system
-#
-# Revision 1.2 1993/06/17 02:01:11 rgrimes
-# Make clean in src/lib/libc failed due to too many arguments to /bin/sh,
-# this was fixed for make cleandir in the patchkit, this fixes it for
-# make clean.
+# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
+# $Id: bsd.lib.mk,v 1.30 1994/02/09 16:23:21 ache Exp $
#
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
+.if exists(${.CURDIR}/shlib_version)
+SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major
+SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor
+.endif
+
+
LIBDIR?= /usr/lib
LINTLIBDIR?= /usr/libdata/lint
LIBGRP?= bin
@@ -82,12 +27,12 @@ BINMODE?= 555
.MAIN: all
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
-#.SUFFIXES: .out .o .po .s .c .cc .cxx .C .f .y .l
+# .so used for PIC object files
.SUFFIXES:
-.SUFFIXES: .out .o .po .s .c .f .y .l
+.SUFFIXES: .out .o .po .so .s .S .c .cc .cxx .m .C .f .y .l
.c.o:
- ${CC} ${CFLAGS} -c ${.IMPSRC}
+ ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -x -r ${.TARGET}
@mv a.out ${.TARGET}
@@ -96,26 +41,35 @@ BINMODE?= 555
@${LD} -X -r ${.TARGET}
@mv a.out ${.TARGET}
-#.cc.o .cxx.o .C.o:
-# ${CXX} ${CXXFLAGS} -c ${.IMPSRC}
-# @${LD} -x -r ${.TARGET}
-# @mv a.out ${.TARGET}
+.c.so:
+ ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-#.cc.po .C.po .cxx.o:
-# ${CXX} -p ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-# @${LD} -X -r ${.TARGET}
-# @mv a.out ${.TARGET}
+.cc.o .cxx.o .C.o:
+ ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
+.cc.po .C.po .cxx.o:
+ ${CXX} -p ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
+.cc.so .C.so:
+ ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
.f.o:
- ${FC} ${RFLAGS} -o ${.TARGET} -c ${.IMPSRC}
+ ${FC} ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@${LD} -x -r ${.TARGET}
@mv a.out ${.TARGET}
.f.po:
- ${FC} -p ${RFLAGS} -o ${.TARGET} -c ${.IMPSRC}
+ ${FC} -p ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@${LD} -X -r ${.TARGET}
@mv a.out ${.TARGET}
+.f.so:
+ ${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
+
.s.o:
${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
${AS} -o ${.TARGET}
@@ -128,12 +82,51 @@ BINMODE?= 555
@${LD} -X -r ${.TARGET}
@mv a.out ${.TARGET}
+.s.so:
+ ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
+ ${AS} -k -o ${.TARGET}
+
+.S.o:
+ ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
+ ${AS} -o ${.TARGET}
+
+.S.po:
+ ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
+ ${AS} -o ${.TARGET}
+
+.S.so:
+ ${CPP} -E -DPIC ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
+ ${AS} -k -o ${.TARGET}
+
+.m.po:
+ ${CC} ${CFLAGS} -p -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
+.m.o:
+ ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
.if !defined(NOPROFILE)
_LIBS=lib${LIB}.a lib${LIB}_p.a
.else
_LIBS=lib${LIB}.a
.endif
+.if !defined(NOPIC)
+.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
+_LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.if defined(INSTALL_PIC_ARCHIVE)
+_LIBS+=lib${LIB}_pic.a
+.endif
+.endif
+
+.if !defined(PICFLAG)
+PICFLAG=-fpic
+.endif
+
all: ${_LIBS} # llib-l${LIB}.ln
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
@@ -151,6 +144,20 @@ lib${LIB}_p.a:: ${POBJS}
@${AR} cTq lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD}
${RANLIB} lib${LIB}_p.a
+SOBJS+= ${OBJS:.o=.so}
+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}
+ @$(LD) -Bshareable \
+ -o lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+ ${SOBJS} ${LDADD}
+
+lib${LIB}_pic.a:: ${SOBJS}
+ @echo building special pic ${LIB} library
+ @rm -f lib${LIB}_pic.a
+ @${AR} cTq lib${LIB}_pic.a ${SOBJS} ${LDADD}
+ ${RANLIB} lib${LIB}_pic.a
+
llib-l${LIB}.ln: ${SRCS}
${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
@@ -159,6 +166,8 @@ clean:
rm -f a.out Errs errs mklog ${CLEANFILES} ${OBJS}
rm -f lib${LIB}.a llib-l${LIB}.ln
rm -f ${POBJS} profiled/*.o lib${LIB}_p.a
+ rm -f ${SOBJS} shared/*.o
+ rm -f lib${LIB}.so.*.* lib${LIB}_pic.a
.endif
.if !target(cleandir)
@@ -167,24 +176,16 @@ cleandir:
rm -f lib${LIB}.a llib-l${LIB}.ln
rm -f ${.CURDIR}/tags .depend
rm -f ${POBJS} profiled/*.o lib${LIB}_p.a
+ rm -f ${SOBJS} shared/*.o
+ rm -f lib${LIB}.so.*.* lib${LIB}_pic.a
cd ${.CURDIR}; rm -rf obj;
.endif
-.if !target(depend)
-depend: .depend
-.depend: ${SRCS}
- rm -f .depend
- files="${.ALLSRC:M*.c}"; \
- if [ "$$files" != "" ]; then \
- mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \
- fi
-# files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
-# if [ "$$files" != " " ]; then \
-# mkdep -a ${MKDEP} -+ ${CXXFLAGS:M-[ID]*} $$files; \
-# fi
+.if defined(SRCS)
+afterdepend:
@(TMP=/tmp/_depend$$$$; \
- sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po:/' < .depend > $$TMP; \
- mv $$TMP .depend)
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' < .depend > $$TMP; \
+ mv $$TMP .depend)
.endif
.if !target(install)
@@ -201,8 +202,17 @@ realinstall: beforeinstall
lib${LIB}_p.a ${DESTDIR}${LIBDIR}
${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.endif
-# install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-# llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
+.if !defined(NOPIC)
+.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
+ install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${DESTDIR}${LIBDIR}
+.endif
+.if defined(INSTALL_PIC_ARCHIVE)
+ install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
+ ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.endif
+.endif
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
@@ -246,7 +256,7 @@ obj:
.else
obj:
@cd ${.CURDIR}; rm -rf obj; \
- here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \
+ here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
echo "$$here -> $$dest"; ln -s $$dest obj; \
if test -d /usr/obj -a ! -d $$dest; then \
mkdir -p $$dest; \
@@ -255,3 +265,5 @@ obj:
fi;
.endif
.endif
+
+.include <bsd.dep.mk>
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index 8abe4d3c2dbe..dd5aee25e345 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -1,4 +1,5 @@
-# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
+# from: @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
+# $Id: bsd.man.mk,v 1.4 1994/01/31 06:10:33 rgrimes Exp $
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 78b9a468b343..fb7a348c4633 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -1,4 +1,4 @@
-# @(#)bsd.own.mk 0.1 (RGrimes) 4/4/93
+# $Id: bsd.own.mk,v 1.3 1994/01/31 06:10:35 rgrimes Exp $
BINGRP?= bin
BINOWN?= bin
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 0c569a83f9e0..80ab11fcf589 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -1,11 +1,11 @@
-# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
+# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
+# $Id: bsd.prog.mk,v 1.18 1994/01/31 06:10:37 rgrimes Exp $
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
-#.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s
-.SUFFIXES: .out .o .c .y .l .s
+.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
CFLAGS+=${COPTS}
@@ -32,12 +32,15 @@ LIBMP?= /usr/lib/libmp.a
LIBPC?= /usr/lib/libpc.a
LIBPLOT?= /usr/lib/libplot.a
LIBRESOLV?= /usr/lib/libresolv.a
-LIBRPC?= /usr/lib/librpc.a
LIBRPCSVC?= /usr/lib/librpcsvc.a
LIBTELNET?= /usr/lib/libtelnet.a
LIBTERM?= /usr/lib/libterm.a
LIBUTIL?= /usr/lib/libutil.a
+.if defined(NOSHARED)
+LDFLAGS+= -static
+.endif
+
.if defined(SHAREDSTRINGS)
CLEANFILES+=strings
.c.o:
@@ -45,10 +48,10 @@ CLEANFILES+=strings
@${CC} ${CFLAGS} -c x.c -o ${.TARGET}
@rm -f x.c
-#.cc.o .cxx.o .C.o:
-# ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
-# @mv -f x.c x.cc
-# @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
+.cc.o .cxx.o .C.o:
+ ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
+ @mv -f x.c x.cc
+ @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
.endif
@@ -116,23 +119,6 @@ cleandir: _PROGSUBDIR
cd ${.CURDIR}; rm -rf obj;
.endif
-# some of the rules involve .h sources, so remove them from mkdep line
-.if !target(depend)
-depend: .depend _PROGSUBDIR
-.depend: ${DPSRCS} ${SRCS}
-.if defined(PROG)
- rm -f .depend
- files="${.ALLSRC:M*.c}"; \
- if [ "$$files" != "" ]; then \
- mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \
- fi
-# files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
-# if [ "$$files" != " " ]; then \
-# mkdep -a ${MKDEP} -+ ${CXXFLAGS:M-[ID]*} $$files; \
-# fi
-.endif
-.endif
-
.if !target(install)
.if !target(beforeinstall)
beforeinstall:
@@ -185,7 +171,7 @@ obj: _PROGSUBDIR
.else
obj: _PROGSUBDIR
@cd ${.CURDIR}; rm -rf obj; \
- here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \
+ here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \
echo "$$here -> $$dest"; ln -s $$dest obj; \
if test -d /usr/obj -a ! -d $$dest; then \
mkdir -p $$dest; \
@@ -208,3 +194,5 @@ tags: ${SRCS} _PROGSUBDIR
.elif !target(maninstall)
maninstall:
.endif
+
+.include <bsd.dep.mk>
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index d5e35a19d4e1..ef4108296fca 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -1,4 +1,5 @@
-# @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
+# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
+# $Id: bsd.subdir.mk,v 1.5 1994/01/31 06:10:40 rgrimes Exp $
.MAIN: all
diff --git a/share/mk/bsd.subdir_ports.mk b/share/mk/bsd.subdir_ports.mk
new file mode 100644
index 000000000000..4bbcc3fe0c9d
--- /dev/null
+++ b/share/mk/bsd.subdir_ports.mk
@@ -0,0 +1,184 @@
+# bsd.subdir_ports.mk Thu Feb 17 17:26:04 MEZ 1994 by Julian Stacey <stacey@guug.de>
+# Copyright Julian Stacey, Munich Dec. 93, Free Software, No Liability.
+# For details see `Legalities' in /sys/Makefile.
+
+# This make include file was inspired by bsd.subdir.mk.
+# Some differences:
+# - Additional to SUBDIR, has been added G_SUBDIR,
+# G_SUBDIR directories re made with gmake rather than make.
+# - This make include file is tolerant of missing directories.
+# ( many people will only have partially populated ports trees )
+# This behaviour is very different from from bsd.subdir.mk,
+# that assumes all directories are present (even games).
+# (When bsd.subdir.mk fails to find a directory the cd fails,
+# the make saturates the cpu, recursive makes end in a series
+# of `cannot fork`s, also ruining performance for other users.
+
+# This commentary supplements ./bsd.README
+# Notes by Julian Stacey <stacey@guug.de> regarding :
+# bsd.prog.mk dependency _PROGSUBDIR: &
+# bsd.subdir.mk dependency _SUBDIRUSE: .
+# bsd.subdir_ports.mk dependency _SUBDIRUSE: .
+#
+# Name Description Example
+# DIRPRFX source tree prefix bin/ (when in bin/cat)
+# MACHINE i386
+# .TARGET all
+# .CURDIR current source directory
+# (though nate had expected it be what obj points to)
+# ref 940126_2031_39.nate
+# entry dependency currently being made all
+# edir evaluated next directory, libcsu.i386
+#
+# The {} in ---{> & <}--- are there so the % key in vi can be used,
+# thus allowing easy matching within long make logs.
+# The >< in ---{> & <}--- are retained for ornament.
+# The --- in ---{> & <}--- are retained both for ornament, &
+# to contribute to the uniqueness of forward & backward search keys.
+# The brackets () allow subsequent subsidiary makes to ignore possible
+# error results from previous sibling makes.
+# A "cd ${.CURDIR} ;" after the subsidiary make is not needed, as nothing
+# else happens inside the sub shell invoked by the ( ),
+# it has thus been omitted to assist shell interpreter speed.
+
+MFLAGS += -i # to be removed when ports tree error free
+# used to be MFLAGS ?= -i but something was always defining
+# MFLAGS, so -i was never seen.
+GMAKE = gmake
+MAKE ?= make
+MAKE_CMD = ${MAKE} ${MFLAGS}
+GMAKE_CMD = ${GMAKE} ${MFLAGS}
+AVOID ?= "AVOID set in bsd.subdir_ports.mk avoids broken packages."
+
+# Define WAIT_OK if you are prepared for the make to hang
+# on an open window awaiting a response.
+
+# You cant win with DESTDIR, once all packages use DESTDIR, no problem,
+# till then its a 4 way choice between throwing all stuff in
+# - ${DESTDIR}/usr/local,
+# - ${DESTDIR}/usr/gnu,
+# - ${DESTDIR}/
+# - wherever the package Makefile thinks it wants to put it.
+.if defined(DESTDIR)
+DESTDIR := ${DESTDIR}/usr/local
+.else
+DESTDIR = /usr/local
+.endif
+
+BINDIR?= ${DESTDIR}/bin
+# maybe BINDIR & DESTDIR interfere on some packages
+LIBDIR?= ${DESTDIR}/lib
+# maybe useful to have a default LIBDIR ?
+
+# Labels _SUBDIRUSE & ${SUBDIR} supercede labels in bsd.subdir.mk,
+
+DIR_EXIST = -e
+# DIR_EXIST -e rather than -d, as it may be a sym link to a directory
+FILE_EXIST = -r
+# FILE_EXIST not -f as it might be a sym link to a local
+# work_in_progress_Makefile
+
+_SUBDIRUSE: .USE
+ @# echo Starting directories that use BSD ${MAKE}
+ @for entry in ${SUBDIR} ; do \
+ ( \
+ if test ${DIR_EXIST} ${.CURDIR}/$${entry}.${MACHINE} ; then \
+ echo "Starting machine specific" > /dev/null ; \
+ edir=$${entry}.${MACHINE} ; \
+ else \
+ echo "Starting generic" > /dev/null ; \
+ edir=$${entry} ; \
+ fi ;\
+ echo -n "---{> $${edir}: " ;\
+ if test ${FILE_EXIST} ${.CURDIR}/$${edir}/Makefile ; then \
+ cmd="${MAKE_CMD} \
+ ${.TARGET:realinstall=install} \
+ DIRPRFX=${DIRPRFX}$${edir}/"; \
+ echo "$$cmd"; \
+ cd ${.CURDIR}/$${edir} ; \
+ $$cmd ; \
+ else \
+ echo "Warning missing directory or Makefile." ;\
+ fi ;\
+ echo "<}--- $${edir}" ;\
+ ) \
+ done
+ @# echo Finished BSD ${MAKE} directories, Starting ${GMAKE} directories.
+ @for entry in ${G_SUBDIR}; do \
+ ( \
+ if test ${DIR_EXIST} ${.CURDIR}/$${entry}.${MACHINE} ; then \
+ echo "Starting machine specific" > /dev/null ; \
+ edir=$${entry}.${MACHINE} ; \
+ else \
+ echo "Starting generic" > /dev/null ; \
+ edir=$${entry} ; \
+ fi ;\
+ echo -n "---{> $${edir}: " ;\
+ if test ${FILE_EXIST} ${.CURDIR}/$${edir}/Makefile ; then \
+ cmd="${GMAKE_CMD} MAKE=${GMAKE} \
+ ${.TARGET:realinstall=install} \
+ DIRPRFX=${DIRPRFX}$${edir}/"; \
+ echo "$$cmd"; \
+ cd ${.CURDIR}/$${edir} ; \
+ $$cmd ; \
+ else \
+ echo "Warning missing directory or Makefile." ;\
+ fi ;\
+ echo "<}--- $${edir}" ;\
+ ) \
+ done
+ @# echo Finished ${GMAKE} directories.
+
+${SUBDIR}::
+ @# echo Starting directories that use BSD ${MAKE}
+ if test ${DIR_EXIST} ${.CURDIR}/${.TARGET}.${MACHINE} ; then \
+ echo "Starting machine specific" > /dev/null ; \
+ edir=${.CURDIR}/${.TARGET}.${MACHINE};\
+ else \
+ edir=${.CURDIR}/${.TARGET};\
+ echo "Starting generic" > /dev/null ; \
+ fi ;\
+ echo -n "---{> $${edir}: " ;\
+ if test ${FILE_EXIST} ${.CURDIR}/$${edir}/Makefile ; then \
+ cmd="${MAKE_CMD} -f $${edir}/Makefile all";\
+ echo "$$cmd"; \
+ cd ${.CURDIR}/$${edir} ; \
+ $$cmd ; \
+ else \
+ echo "Warning missing directory or Makefile." ;\
+ fi ;\
+ echo "<}--- $${edir}" ;\
+
+${G_SUBDIR}::
+ @# echo Starting directories that use BSD ${MAKE}
+ if test ${DIR_EXIST} ${.CURDIR}/${.TARGET}.${MACHINE} ; then \
+ echo "Starting machine specific" > /dev/null ; \
+ edir=${.CURDIR}/${.TARGET}.${MACHINE};\
+ else \
+ edir=${.CURDIR}/${.TARGET};\
+ echo "Starting generic" > /dev/null ; \
+ fi ;\
+ echo -n "---{> $${edir}: " ;\
+ if test ${FILE_EXIST} ${.CURDIR}/$${edir}/Makefile ; then \
+ cmd="${GMAKE_CMD} MAKE=${GMAKE} -f $${edir}/Makefile all";\
+ echo "$$cmd"; \
+ cd ${.CURDIR}/$${edir} ; \
+ $$cmd ; \
+ else \
+ echo "Warning missing directory or Makefile." ;\
+ fi ;\
+ echo "<}--- $${edir}" ;\
+
+.include <bsd.subdir.mk>
+
+.if !target(pkg)
+pkg: _SUBDIRUSE
+.endif
+
+.if !target(world)
+world: _SUBDIRUSE
+# note if we append `all' after `_SUBDIRUSE'
+# then with several levels of SUBDIR makes, we'd get far too many `make all's
+.endif
+
+# End Of File
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 41710fb8e157..71d12562ed44 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -1,9 +1,9 @@
-# @(#)sys.mk 5.11 (Berkeley) 3/13/91
+# from: @(#)sys.mk 5.11 (Berkeley) 3/13/91
+# $Id: sys.mk,v 1.5 1994/02/04 03:19:16 wollman Exp $
-unix= We run UNIX.
+unix= We run FreeBSD, not UNIX.
-#.SUFFIXES: .out .a .ln .o .c .cc .cxx .C .F .f .e .r .y .l .s .cl .p .h
-.SUFFIXES: .out .a .ln .o .c .F .f .e .r .y .l .s .cl .p .h
+.SUFFIXES: .out .a .ln .o .c .cc .cxx .C .F .f .e .r .y .l .s .cl .p .h
.LIBS: .a
@@ -51,8 +51,8 @@ YFLAGS=-d
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-#.cc.o .cxx.o .C.o:
-# ${CXX} ${CXXFLAGS} -c ${.IMPSRC}
+.cc.o .cxx.o .C.o:
+ ${CXX} ${CXXFLAGS} -c ${.IMPSRC}
.p.o:
${PC} ${PFLAGS} -c ${.IMPSRC}