lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit c7570b8fc168601bcd596624b04d0b17c6d0f508
parent d064f905593ebd2a691f0029d733021e8bc03576
Author: Duncaen <mail@duncano.de>
Date:   Wed,  8 Mar 2017 19:21:22 +0100

mk: add MAKEOBJDIR support

Diffstat:
Makefile | 6++----
bin/Makefile | 7++++---
bin/cat/Makefile | 4+++-
bin/chmod/Makefile | 4+++-
bin/cp/Makefile | 4+++-
bin/date/Makefile | 4+++-
bin/dd/Makefile | 4+++-
bin/df/Makefile | 4+++-
bin/domainname/Makefile | 4+++-
bin/echo/Makefile | 4+++-
bin/ed/Makefile | 4+++-
bin/expr/Makefile | 4+++-
bin/hostname/Makefile | 4+++-
bin/kill/Makefile | 4+++-
bin/ln/Makefile | 4+++-
bin/ls/Makefile | 4+++-
bin/md5/Makefile | 4+++-
bin/mkdir/Makefile | 4+++-
bin/mv/Makefile | 4+++-
bin/pax/Makefile | 4+++-
bin/pwd/Makefile | 4+++-
bin/rm/Makefile | 4+++-
bin/rmdir/Makefile | 4+++-
bin/sleep/Makefile | 4+++-
bin/stty/Makefile | 4+++-
bin/sync/Makefile | 4+++-
bin/test/Makefile | 4+++-
lib/Makefile | 5+++--
lib/libopenbsd/Makefile.inc | 32++++++++++++++++++++++++++++++++
lib/libopenbsd/crypt/Makefile.inc | 7+++++++
lib/libopenbsd/gen/Makefile.inc | 10++++++++++
lib/libopenbsd/net/Makefile.inc | 8++++++++
lib/libopenbsd/stdio/Makefile.inc | 12++++++++++++
lib/libopenbsd/stdlib/Makefile.inc | 9+++++++++
lib/libopenbsd/string/Makefile.inc | 18++++++++++++++++++
lib/libopenbsd/sys/Makefile.inc | 16++++++++++++++++
lib/libutil/Makefile | 5++++-
mk/bsd.lib.mk | 21++++++++++-----------
mk/bsd.own.mk | 44++++++++++++++++++++++++++++++++++++++++++++
mk/bsd.prog.mk | 56+++++++++++++++++++++++++++++++++++++++-----------------
mk/bsd.regress.mk | 2+-
mk/bsd.subdir.mk | 53+++++++++++++++++++++++++++++++++++++++--------------
regress/Makefile | 5+++--
regress/bin/Makefile | 6+++---
regress/bin/cat/Makefile | 2+-
regress/bin/chmod/Makefile | 2+-
regress/bin/ln/Makefile | 2+-
regress/bin/md5/Makefile | 2+-
regress/bin/pax/Makefile | 2+-
regress/bin/test/Makefile | 2+-
regress/sbin/Makefile | 5++---
regress/usr.bin/Makefile | 9+++++----
regress/usr.bin/basename/Makefile | 2+-
regress/usr.bin/bc/Makefile | 2+-
regress/usr.bin/calendar/Makefile | 2+-
regress/usr.bin/colrm/Makefile | 2+-
regress/usr.bin/column/Makefile | 2+-
regress/usr.bin/cut/Makefile | 2+-
regress/usr.bin/dc/Makefile | 2+-
regress/usr.bin/diff/Makefile | 2+-
regress/usr.bin/diff3/Makefile | 2+-
regress/usr.bin/dirname/Makefile | 2+-
regress/usr.bin/file/Makefile | 2+-
regress/usr.bin/fmt/Makefile | 2+-
regress/usr.bin/fold/Makefile | 2+-
regress/usr.bin/grep/Makefile | 2+-
regress/usr.bin/jot/Makefile | 2+-
regress/usr.bin/tail/Makefile | 2+-
regress/usr.bin/tsort/Makefile | 2+-
regress/usr.bin/ul/Makefile | 2+-
regress/usr.bin/wc/Makefile | 2+-
regress/usr.bin/xargs/Makefile | 2+-
regress/usr.sbin/Makefile | 6+++---
sbin/Makefile | 6+++---
sbin/mknod/Makefile | 4+++-
usr.bin/Makefile | 19++++++++++---------
usr.bin/apply/Makefile | 4+++-
usr.bin/awk/Makefile | 5++++-
usr.bin/basename/Makefile | 4+++-
usr.bin/bc/Makefile | 6+++++-
usr.bin/biff/Makefile | 4+++-
usr.bin/cal/Makefile | 4+++-
usr.bin/calendar/Makefile | 4+++-
usr.bin/cmp/Makefile | 4+++-
usr.bin/col/Makefile | 4+++-
usr.bin/colrm/Makefile | 4+++-
usr.bin/column/Makefile | 4+++-
usr.bin/comm/Makefile | 4+++-
usr.bin/cu/Makefile | 4+++-
usr.bin/cut/Makefile | 4+++-
usr.bin/dc/Makefile | 5+++--
usr.bin/diff/Makefile | 4+++-
usr.bin/diff3/Makefile | 4+++-
usr.bin/dirname/Makefile | 4+++-
usr.bin/du/Makefile | 4+++-
usr.bin/env/Makefile | 4+++-
usr.bin/expand/Makefile | 4+++-
usr.bin/false/Makefile | 4+++-
usr.bin/file/Makefile | 4+++-
usr.bin/fmt/Makefile | 4+++-
usr.bin/fold/Makefile | 4+++-
usr.bin/getopt/Makefile | 4+++-
usr.bin/grep/Makefile | 4+++-
usr.bin/head/Makefile | 4+++-
usr.bin/hexdump/Makefile | 4+++-
usr.bin/id/Makefile | 4+++-
usr.bin/indent/Makefile | 4+++-
usr.bin/join/Makefile | 4+++-
usr.bin/jot/Makefile | 4+++-
usr.bin/lam/Makefile | 4+++-
usr.bin/lndir/Makefile | 4+++-
usr.bin/logger/Makefile | 4+++-
usr.bin/logname/Makefile | 4+++-
usr.bin/look/Makefile | 4+++-
usr.bin/mktemp/Makefile | 4+++-
usr.bin/newsyslog/Makefile | 4+++-
usr.bin/nice/Makefile | 4+++-
usr.bin/nl/Makefile | 4+++-
usr.bin/nohup/Makefile | 4+++-
usr.bin/paste/Makefile | 4+++-
usr.bin/patch/Makefile | 4+++-
usr.bin/printenv/Makefile | 4+++-
usr.bin/printf/Makefile | 4+++-
usr.bin/readlink/Makefile | 4+++-
usr.bin/renice/Makefile | 4+++-
usr.bin/rev/Makefile | 4+++-
usr.bin/rs/Makefile | 4+++-
usr.bin/sdiff/Makefile | 4+++-
usr.bin/sed/Makefile | 4+++-
usr.bin/shar/Makefile | 4+++-
usr.bin/sort/Makefile | 4+++-
usr.bin/split/Makefile | 6++++--
usr.bin/stat/Makefile | 4+++-
usr.bin/tee/Makefile | 4+++-
usr.bin/time/Makefile | 4+++-
usr.bin/touch/Makefile | 4+++-
usr.bin/tr/Makefile | 4+++-
usr.bin/true/Makefile | 4+++-
usr.bin/tsort/Makefile | 4+++-
usr.bin/tty/Makefile | 4+++-
usr.bin/uname/Makefile | 4+++-
usr.bin/unexpand/Makefile | 4+++-
usr.bin/uniq/Makefile | 4+++-
usr.bin/unvis/Makefile | 4+++-
usr.bin/uudecode/Makefile | 4+++-
usr.bin/uuencode/Makefile | 4+++-
usr.bin/vis/Makefile | 4+++-
usr.bin/wc/Makefile | 4+++-
usr.bin/what/Makefile | 4+++-
usr.bin/which/Makefile | 5++++-
usr.bin/xinstall/Makefile | 4+++-
usr.sbin/Makefile | 6+++---
usr.sbin/mtree/Makefile | 4+++-
usr.sbin/rdate/Makefile | 4+++-
154 files changed, 630 insertions(+), 214 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,9 +1,7 @@ -export TOPDIR := $(shell pwd) - -SUBDIR = lib bin sbin usr.bin usr.sbin +SUBDIR= lib bin sbin usr.bin usr.sbin ifeq (clean,$(filter clean,$(MAKECMDGOALS))) -SUBDIR += regress +SUBDIR+=regress endif all: diff --git a/bin/Makefile b/bin/Makefile @@ -1,3 +1,4 @@ -SUBDIR = cat chmod cp date dd df domainname echo ed expr hostname kill ln ls \ - md5 mkdir mv pax pwd rm rmdir sleep stty sync test -include bsd.subdir.mk +TOPDIR?=.. +SUBDIR= cat chmod cp date dd df domainname echo ed expr hostname kill ln ls \ + md5 mkdir mv pax pwd rm rmdir sleep stty sync test +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/bin/cat/Makefile b/bin/cat/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.4 2017/02/19 00:46:57 jca Exp $ +.TOPDIR?=../.. + PROG= cat -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/chmod/Makefile b/bin/chmod/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.7 2001/09/06 18:52:55 mickey Exp $ +.TOPDIR?=../.. + PROG= chmod CFLAGS+=-DSUPPORT_DOT MAN= chmod.1 chgrp.1 chown.8 chflags.1 @@ -15,4 +17,4 @@ LINKS= ${BINDIR}/chmod ${BINDIR}/chgrp \ # ln -sf ../../bin/chmod chflags) -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/cp/Makefile b/bin/cp/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:34:47 deraadt Exp $ +.TOPDIR?=../.. + PROG= cp SRCS= cp.c utils.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/date/Makefile b/bin/date/Makefile @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.4 2011/07/07 21:00:59 deraadt Exp $ +.TOPDIR?=../.. + PROG= date SRCS= date.c DPADD+= ${LIBUTIL} LDADD+= -lutil -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/dd/Makefile b/bin/dd/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.5 1998/05/29 04:34:20 rahnds Exp $ +.TOPDIR?=../.. + PROG= dd SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/df/Makefile b/bin/df/Makefile @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.8 2003/05/26 18:02:32 ian Exp $ +.TOPDIR?=../.. + PROG= df SRCS= df.c LDADD= -lutil DPADD= ${LIBUTIL} -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/domainname/Makefile b/bin/domainname/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:34:59 deraadt Exp $ +.TOPDIR?=../.. + PROG= domainname -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/echo/Makefile b/bin/echo/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:02 deraadt Exp $ +.TOPDIR?=../.. + PROG= echo -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/ed/Makefile b/bin/ed/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.11 2014/05/24 01:35:55 daniel Exp $ +.TOPDIR?=../.. + PROG= ed CFLAGS+=-DBACKWARDS SRCS= buf.c glbl.c io.c main.c re.c sub.c undo.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/expr/Makefile b/bin/expr/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:07 deraadt Exp $ +.TOPDIR?=../.. + PROG= expr SRCS= expr.c CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/hostname/Makefile b/bin/hostname/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:09 deraadt Exp $ +.TOPDIR?=../.. + PROG= hostname -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/kill/Makefile b/bin/kill/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:12 deraadt Exp $ +.TOPDIR?=../.. + PROG= kill -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/ln/Makefile b/bin/ln/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:15 deraadt Exp $ +.TOPDIR?=../.. + PROG= ln MAN= ln.1 symlink.7 -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/ls/Makefile b/bin/ls/Makefile @@ -1,9 +1,11 @@ # $OpenBSD: Makefile,v 1.8 2015/12/01 18:36:13 schwarze Exp $ +.TOPDIR?=../.. + PROG= ls SRCS= cmp.c ls.c main.c print.c util.c utf8.c DPADD= ${LIBUTIL} LDADD= -lutil CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/md5/Makefile b/bin/md5/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.15 2016/03/30 06:38:40 jmc Exp $ +.TOPDIR?=../.. + PROG= md5 SRCS= crc.c md5.c MAN= cksum.1 md5.1 @@ -11,4 +13,4 @@ LINKS= ${BINDIR}/md5 ${BINDIR}/sha1 \ CPPFLAGS+= -I${.CURDIR} -D_GNU_SOURCE COPTS+= -Wall -Wconversion -Wmissing-prototypes -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/mkdir/Makefile b/bin/mkdir/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:20 deraadt Exp $ +.TOPDIR?=../.. + PROG= mkdir -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/mv/Makefile b/bin/mv/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.5 2016/02/01 22:38:01 gsoares Exp $ +.TOPDIR?=../.. + PROG= mv SRCS= mv.c cp.c rm.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/pax/Makefile b/bin/pax/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.11 2014/01/08 04:58:36 guenther Exp $ +.TOPDIR?=../.. + PROG= pax SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c\ gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c tables.c\ @@ -7,4 +9,4 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c\ MAN= pax.1 tar.1 cpio.1 LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/pwd/Makefile b/bin/pwd/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:35 deraadt Exp $ +.TOPDIR?=../.. + PROG= pwd -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/rm/Makefile b/bin/rm/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:40 deraadt Exp $ +.TOPDIR?=../.. + PROG= rm -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/rmdir/Makefile b/bin/rmdir/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:45 deraadt Exp $ +.TOPDIR?=../.. + PROG= rmdir -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/sleep/Makefile b/bin/sleep/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:48 deraadt Exp $ +.TOPDIR?=../.. + PROG= sleep -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/stty/Makefile b/bin/stty/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:50 deraadt Exp $ +.TOPDIR?=../.. + PROG= stty SRCS= cchar.c gfmt.c key.c modes.c print.c stty.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/sync/Makefile b/bin/sync/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:35:53 deraadt Exp $ +.TOPDIR?=../.. + PROG= sync MAN= sync.8 -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/bin/test/Makefile b/bin/test/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.5 2016/03/30 06:38:40 jmc Exp $ +.TOPDIR?=../.. + PROG= test SRCS= test.c LINKS= ${BINDIR}/test ${BINDIR}/[ -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/lib/Makefile b/lib/Makefile @@ -1,2 +1,3 @@ -SUBDIR = libopenbsd libutil -include bsd.subdir.mk +TOPDIR?=.. +SUBDIR= libopenbsd libutil +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/lib/libopenbsd/Makefile.inc b/lib/libopenbsd/Makefile.inc @@ -0,0 +1,32 @@ +# $OpenBSD: Makefile.inc,v 1.29 2016/05/07 19:05:21 guenther Exp $ +# +# This file contains make rules used to build libc +# + +ifndef LIBCSRCDIR +all: + @echo "need to define LIBCSRCDIR" >&2; exit 1 +endif + +CFLAGS+=-I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/hidden -D__LIBC__ \ + -Werror-implicit-function-declaration -include namespace.h + +#.if ${COMPILER_VERSION:L} != "gcc3" +CFLAGS+=-Werror=deprecated-declarations +#.endif + +# Include link-time warnings about unsafe API uses (ie. strcpy) +CFLAGS+=-DAPIWARN + +include ${LIBCSRCDIR}/gen/Makefile.inc +include ${LIBCSRCDIR}/crypt/Makefile.inc +include ${LIBCSRCDIR}/hash/Makefile.inc +include ${LIBCSRCDIR}/net/Makefile.inc + +include ${LIBCSRCDIR}/regex/Makefile.inc +include ${LIBCSRCDIR}/stdio/Makefile.inc +include ${LIBCSRCDIR}/stdlib/Makefile.inc +include ${LIBCSRCDIR}/string/Makefile.inc +include ${LIBCSRCDIR}/sys/Makefile.inc + +${OBJS} ${GOBJS} ${POBJS} ${SOBJS} ${DOBJS}: ${LIBCSRCDIR}/include/namespace.h diff --git a/lib/libopenbsd/crypt/Makefile.inc b/lib/libopenbsd/crypt/Makefile.inc @@ -0,0 +1,7 @@ +# $OpenBSD: Makefile.inc,v 1.27 2016/03/30 06:38:41 jmc Exp $ + +VPATH+= ${LIBCSRCDIR}/arch/${MACHINE_CPU}/crypt ${LIBCSRCDIR}/crypt + +SRCS+= arc4random.c arc4random_uniform.c blowfish.c + +MAN+= blowfish.3 arc4random.3 diff --git a/lib/libopenbsd/gen/Makefile.inc b/lib/libopenbsd/gen/Makefile.inc @@ -0,0 +1,10 @@ +# $OpenBSD: Makefile.inc,v 1.29 2016/03/30 06:38:41 jmc Exp $ + +# stdio sources +VPATH+= ${LIBCSRCDIR}/gen + +SRCS+= basename.c dirname.c errc.c fts.c getmntinfo.c setmode.c unvis.c \ + verrc.c vis.c vwarnc.c warnc.c + + +MAN+= basename.3 dirname.3 fts.3 getmntinfo.3 setmode.3 unvis.3 vis.3 diff --git a/lib/libopenbsd/net/Makefile.inc b/lib/libopenbsd/net/Makefile.inc @@ -0,0 +1,8 @@ +# $OpenBSD: Makefile.inc,v 1.59 2016/03/30 06:38:41 jmc Exp $ + +# net sources +VPATH+= ${LIBCSRCDIR}/net + +CFLAGS+=-DRESOLVSORT + +SRCS+= base64.c diff --git a/lib/libopenbsd/stdio/Makefile.inc b/lib/libopenbsd/stdio/Makefile.inc @@ -0,0 +1,12 @@ +# $OpenBSD: Makefile.inc,v 1.29 2016/03/30 06:38:41 jmc Exp $ + +# stdio sources +VPATH+= ${LIBCSRCDIR}/stdio + +SRCS+= fgetwln.c + +ifneq ($(HAVE_FGETLN),1) +SRCS+= fgetln.c +endif + +MAN+= fgetwln.3 diff --git a/lib/libopenbsd/stdlib/Makefile.inc b/lib/libopenbsd/stdlib/Makefile.inc @@ -0,0 +1,9 @@ +# $OpenBSD: Makefile.inc,v 1.61 2016/08/14 23:18:03 guenther Exp $ + +# stdlib sources +VPATH+= ${LIBCSRCDIR}/stdlib + +ifneq ($(HAVE_REALLOCARRAY),1) +SRCS+= reallocarray.c +MAN+= malloc.3 +endif diff --git a/lib/libopenbsd/string/Makefile.inc b/lib/libopenbsd/string/Makefile.inc @@ -0,0 +1,18 @@ +# $OpenBSD: Makefile.inc,v 1.38 2016/03/30 06:38:41 jmc Exp $ + +# string sources +VPATH+= ${LIBCSRCDIR}/string + +ifneq ($(HAVE_EXPLICIT_BZERO),1) +SRCS+= explicit_bzero.c +endif + +ifneq ($(HAVE_STRLCAT),1) +SRCS+= strlcat.c +endif + +ifneq ($(HAVE_STRLCPY),1) +SRCS+= strlcpy.c +endif + +MAN+= strlcpy.3 diff --git a/lib/libopenbsd/sys/Makefile.inc b/lib/libopenbsd/sys/Makefile.inc @@ -0,0 +1,16 @@ +# $OpenBSD: Makefile.inc,v 1.146 2016/07/04 18:01:44 guenther Exp $ +# $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ +# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 + +# sys sources +VPATH+= ${LIBCSRCDIR}/sys + +ifneq ($(HAVE_GETFSSTAT),1) +SRCS+= getfsstat.c +SRCS+= statfs.c +endif + +ifneq ($(HAVE_GETDTABLECOUNT),1) +SRCS+= getdtablecount.c +MAN+= getdtablecount.2 +endif diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile @@ -1,6 +1,9 @@ # $OpenBSD: Makefile,v 1.39 2016/03/30 06:38:43 jmc Exp $ # $NetBSD: Makefile,v 1.8 1996/05/16 07:03:28 thorpej Exp $ +.TOPDIR?=../.. +.CURDIR?=. + LIB= util CPPFLAGS+=-D_GNU_SOURCE @@ -29,4 +32,4 @@ includes: eval "$$j"; \ done -include bsd.lib.mk +include ${.TOPDIR}/mk/bsd.lib.mk diff --git a/mk/bsd.lib.mk b/mk/bsd.lib.mk @@ -1,14 +1,14 @@ +include ${.TOPDIR}/mk/bsd.own.mk + STATICLIB = lib$(LIB).a -LIBDIR=/lib -BINOWN=root -BINGRP=root -LIBOWN=$(BINOWN) -LIBGRP=$(BINGRP) -.CURDIR = . +#.CURDIR = . +#_objdir = ${.CURDIR}/obj +#VPATH+= $(__objdir) + +CPPFLAGS+= -I$(.TOPDIR)/include -include compat.h \ + -I$(.TOPDIR) -include config.h -CPPFLAGS += -I$(TOPDIR)/lib/libopenbsd -include openbsd.h -I$(TOPDIR)/include \ - -I$(TOPDIR) -include config.h LDFLAGS += $(LDADD) CFILES = $(filter %.c,$(SRCS)) @@ -68,8 +68,7 @@ realinstall: beforeinstall .PHONY: all clean cleandir install libinstall ifndef NOMAN -include bsd.man.mk +include ${.TOPDIR}/mk/bsd.man.mk endif -include bsd.subdir.mk -include config.mk +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/mk/bsd.own.mk b/mk/bsd.own.mk @@ -0,0 +1,44 @@ +#.SUFFIXES: +#.CURDIR = $(shell pwd) +#.OBJDIR ?= ${.CURDIR}/obj +# +#MAKETARGET = $(MAKE) --no-print-directory -C $@ -f ${.CURDIR}/Makefile \ +# .CURDIR=${.CURDIR} .OBJDIR=${.OBJDIR} $(MAKECMDGOALS) +# +#.DEFAULT_GOAL := +# +#${.OBJDIR}: ; +# +@[ -d "$@" ] || mkdir -p "$@" +# +@$(MAKETARGET) +# +#.PHONY: ${.OBJDIR} +# +#Makefile : ; +# +#% :: ${.OBJDIR} ; @: + +include ${.TOPDIR}/config.mk + +.CURDIR ?= $(dir $(firstword $(MAKEFILE_LIST))) +VPATH+= ${.CURDIR} + +BINOWN?= root +BINGRP?= root +BINMODE?= 555 +NONBINMODE?= 444 +DIRMODE?= 755 + +SHAREDIR?= /usr/share +SHAREGRP?= root +SHAREOWN?= root +SHAREMODE?= ${NONBINMODE} + +MANDIR?= /usr/share/man/man +MANGRP?= root +MANOWN?= root +MANMODE?= ${NONBINMODE} + +LIBDIR?= /usr/lib +LIBOWN?= $(BINOWN) +LIBGRP?= $(BINGRP) +LIBMODE?= ${NONBINMODE} diff --git a/mk/bsd.prog.mk b/mk/bsd.prog.mk @@ -1,27 +1,31 @@ -include config.mk +include ${.TOPDIR}/mk/bsd.own.mk -.CURDIR = . -CLEANFILES += $(PROG) *.o +CPPFLAGS+= -I${.TOPDIR}/include -include compat.h +CPPFLAGS+= -I${.TOPDIR} -include config.h -CPPFLAGS += -I$(TOPDIR)/lib/libopenbsd -include openbsd.h -I$(TOPDIR) -include config.h +ifdef MAKEOBJDIR +LIBPATHS+= ${MAKEOBJDIR}/lib +endif +LIBPATHS+= ${.TOPDIR}/obj/lib ${.TOPDIR}/lib + +_find_lib= $(firstword $(wildcard $(LIBPATHS:%=%/$(1)))) -LIBC ?= $(TOPDIR)/lib/libopenbsd/libopenbsd.a -LIBUTIL ?= $(TOPDIR)/lib/libutil/libutil.a +LIBC?= $(call _find_lib,libopenbsd/libopenbsd.a) +LIBUTIL?= $(call _find_lib,libutil/libutil.a) ifeq (-lutil,$(filter -lutil,$(LDADD))) - LDFLAGS+= -L$(TOPDIR)/lib/libutil +LDFLAGS+= -L$(dir $(LIBUTIL)) endif -LDFLAGS += -L$(TOPDIR)/lib/libopenbsd $(LDADD) -lopenbsd + +LDFLAGS+= -L$(dir $(LIBC)) $(LDADD) -lopenbsd CFILES = $(filter %.c,$(SRCS)) YFILES = $(filter %.y,$(SRCS)) LFILES = $(filter %.l,$(SRCS)) -OBJS = $(YFILES:.y=.o) $(LFILES:.l=.o) $(CFILES:.c=.o) - -ifneq (,$(findstring $(.DEFAULT_GOAL),install beforeinstall afterinstall)) - .DEFAULT_GOAL := -endif +OBJS += $(YFILES:.y=.o) +OBJS += $(LFILES:.l=.o) +OBJS += $(CFILES:.c=.o) .DEFAULT_GOAL := @@ -33,20 +37,33 @@ else $(PROG) : % : %.o endif -y.tab.h y.tab.c: - $(YACC) -d $(YFILES) +y.tab.h y.tab.c: $(YFILES) + $(YACC) -d $^ %.o: %.y y.tab.c $(CC) $(CFLAGS) $(CPPFLAGS) -c y.tab.c -o $@ %.o: %.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ $(PROG): $(CC) $^ -o $@ $(LDFLAGS) clean: - rm -f $(CLEANFILES) y.tab.h y.tab.c +ifdef SRCS + rm -f $(OBJS) +else + rm -f $(PROG).o +endif +ifdef PROG + rm -f $(PROG) +endif +ifdef YFILES + rm -f y.tab.h y.tab.c +endif +ifdef CLEANFILES + rm -f $(CLEANFILES) +endif install: proginstall install_links @@ -72,3 +89,8 @@ ifneq (,$(LINKS)) endif .PHONY: all clean install proginstall + +-include ${.TOPDIR}/mk/bsd.obj.mk +-include ${.TOPDIR}/mk/bsd.dep.mk +include ${.TOPDIR}/mk/bsd.subdir.mk +-include ${.TOPDIR}/mk/bsd.sys.mk diff --git a/mk/bsd.regress.mk b/mk/bsd.regress.mk @@ -20,4 +20,4 @@ endif .PHONY: all clean regress depend .SUFFIXES: -include config.mk +include ${.TOPDIR}/config.mk diff --git a/mk/bsd.subdir.mk b/mk/bsd.subdir.mk @@ -1,24 +1,49 @@ -SUBDIR_MFLAGS = -I$(TOPDIR) -I$(TOPDIR)/mk +MAKEOBJDIR?= obj + +.TOPDIR?= .. +.OBJDIR?= ${MAKEOBJDIR} +.SRCDIR?= . +.CURDIR?= . +.RELDIR:= $(.SRCDIR:.%=$(.TOPDIR)/../%) + +SUBDIR_MFLAGS= --no-print-directory \ + -I$(.NEXTTOP)/mk \ + -C ${.OBJDIR}/$$nextdir \ + -f ${.RELDIR}/$$nextdir/Makefile \ + .OBJDIR=. \ + .TOPDIR=${.TOPDIR}/.. \ + .CURDIR=${.RELDIR}/$$nextdir \ + .SRCDIR=${.SRCDIR}/$$nextdir \ + MAKEOBJDIR=${.TOPDIR}/${MAKEOBJDIR} \ + _THISDIR_=$$nextdir + + + SUBDIR_TARGETS = all install clean cleandir includes depend regress obj tags manlint -SKIPDIR ?= $(SUBDIR_TARGETS): _SUBDIRUSE +define __SUBDIRUSE +for nextdir in $(SUBDIR); do \ + b=; for s in $(SKIPDIR); do \ + [ "$$s" = "$$nextdir" ] && b=1 && break; \ + done; \ + [ -n "$$b" ] && echo "($$nextdir skipped)" && continue; \ + echo "===> $${_THISDIR_:+$${_THISDIR_}/}$$nextdir"; \ + mkdir -p "${.OBJDIR}/$$nextdir" \ + && $(MAKE) $(SUBDIR_MFLAGS) $(MAKECMDGOALS) || exit 1; \ +done +endef + _SUBDIRUSE: -ifneq (,$(SUBDIR)) - @for d in $(SUBDIR); do \ - skip=; for s in $(SKIPDIR); do \ - [ "$$s" = "$$d" ] && skip=1; \ - done; \ - [ -n "$$_THISDIR_" ] && n="$$_THISDIR_/$$d" || n=$$d; \ - [ "$$skip" ] && echo "($$n skipped)" && continue; \ - echo "===> $$n"; \ - $(MAKE) $(SUBDIR_MFLAGS) -C $$d _THISDIR_=$$n $(MAKECMDGOALS) || exit 1; \ - done +ifneq ($(SUBDIR),) + @$(__SUBDIRUSE) $(SUBDIR): - @echo "===> $@"; \ - $(MAKE) $(SUBDIR_MFLAGS) -C $@ all || exit 1 + @nextdir="$@"; \ + echo "===> $$nextdir"; \ + mkdir -p "${.OBJDIR}/$$nextdir" \ + && $(MAKE) $(SUBDIR_MFLAGS) all || exit 1 endif .PHONY: _SUBDIRUSE $(SUBDIR_TARGETS) $(SUBDIR) diff --git a/regress/Makefile b/regress/Makefile @@ -1,2 +1,3 @@ -SUBDIR = bin sbin usr.bin usr.sbin -include bsd.subdir.mk +TOPDIR?=.. +SUBDIR= bin sbin usr.bin usr.sbin +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/regress/bin/Makefile b/regress/bin/Makefile @@ -1,3 +1,3 @@ -SUBDIR = cat chmod ln md5 pax test -SKIPDIR = -include bsd.subdir.mk +TOPDIR?=../.. +SUBDIR= cat chmod ln md5 pax test +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/regress/bin/cat/Makefile b/regress/bin/cat/Makefile @@ -8,4 +8,4 @@ cat_be: cat_se: cat -se ${.CURDIR}/cat_se.in | cmp -s ${.CURDIR}/cat_se.out /dev/stdin -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/bin/chmod/Makefile b/regress/bin/chmod/Makefile @@ -487,4 +487,4 @@ clean: .POSIX: -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/bin/ln/Makefile b/regress/bin/ln/Makefile @@ -15,4 +15,4 @@ recursive: links links/source: links @echo "Hello, world!" > ${.OBJDIR}/links/source -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/bin/md5/Makefile b/regress/bin/md5/Makefile @@ -47,4 +47,4 @@ md5_multiple_files: .PHONY: ${REGRESS_TARGETS} -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/bin/pax/Makefile b/regress/bin/pax/Makefile @@ -8,4 +8,4 @@ $(REGRESS_TARGETS): .PHONY: ${REGRESS_TARGETS} -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/bin/test/Makefile b/regress/bin/test/Makefile @@ -5,4 +5,4 @@ REGRESS_TARGETS= run_test run_test: $(SHELL) $(.CURDIR)/TEST.sh >/dev/null -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/sbin/Makefile b/regress/sbin/Makefile @@ -1,3 +1,2 @@ -SUBDIR = -SKIPDIR = -include bsd.subdir.mk +TOPDIR?=../.. +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/regress/usr.bin/Makefile b/regress/usr.bin/Makefile @@ -1,4 +1,5 @@ -SUBDIR = basename bc calendar colrm column cut dc diff diff3 dirname file \ - fmt fold grep jot tail tsort ul wc xargs -SKIPDIR = grep bc calendar diff3 cut jot -include bsd.subdir.mk +TOPDIR?=../.. +SUBDIR= basename bc calendar colrm column cut dc diff diff3 dirname file \ + fmt fold grep jot tail tsort ul wc xargs +SKIPDIR=grep bc calendar diff3 cut jot +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/regress/usr.bin/basename/Makefile b/regress/usr.bin/basename/Makefile @@ -4,4 +4,4 @@ regress: @$(SHELL) ${.CURDIR}/basename.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/bc/Makefile b/regress/usr.bin/bc/Makefile @@ -47,4 +47,4 @@ t19test: t19 clean: rm -f *.log t19 -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/calendar/Makefile b/regress/usr.bin/calendar/Makefile @@ -10,4 +10,4 @@ $(REGRESS_TARGETS): .PHONY: ${REGRESS_TARGETS} -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/colrm/Makefile b/regress/usr.bin/colrm/Makefile @@ -5,4 +5,4 @@ REGRESS_TARGETS = colrm colrm: $(SHELL) ${.CURDIR}/colrm.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/column/Makefile b/regress/usr.bin/column/Makefile @@ -3,4 +3,4 @@ regress: @$(SHELL) ${.CURDIR}/column.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/cut/Makefile b/regress/usr.bin/cut/Makefile @@ -5,4 +5,4 @@ REGRESS_TARGETS = cut cut: $(SHELL) ${.CURDIR}/cut.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/dc/Makefile b/regress/usr.bin/dc/Makefile @@ -50,4 +50,4 @@ all: clean ${REGRESS_TARGET} clean: rm -f *.log -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/diff/Makefile b/regress/usr.bin/diff/Makefile @@ -67,4 +67,4 @@ t14.1 t15.1: clean: rm -f *.copy *.patch *.orig -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/diff3/Makefile b/regress/usr.bin/diff3/Makefile @@ -6,4 +6,4 @@ REGRESS_TARGETS+=t1 t1: merge -p /etc/motd /etc/motd /etc/motd | diff /etc/motd - -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/dirname/Makefile b/regress/usr.bin/dirname/Makefile @@ -4,4 +4,4 @@ regress: @$(SHELL) ${.CURDIR}/dirname.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/file/Makefile b/regress/usr.bin/file/Makefile @@ -22,4 +22,4 @@ all: ${REGRESS_TARGET} clean: -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/fmt/Makefile b/regress/usr.bin/fmt/Makefile @@ -3,4 +3,4 @@ regress: @$(SHELL) ${.CURDIR}/fmt.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/fold/Makefile b/regress/usr.bin/fold/Makefile @@ -3,4 +3,4 @@ regress: @$(SHELL) ${.CURDIR}/fold.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/grep/Makefile b/regress/usr.bin/grep/Makefile @@ -106,4 +106,4 @@ t26: .PHONY: t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 .PHONY: t21 t22 t23 t24 t25 t26 -include ../../../bsd.regress.mk +include ../../../${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/jot/Makefile b/regress/usr.bin/jot/Makefile @@ -10,4 +10,4 @@ regress: clean: rm -f test.*.out -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/tail/Makefile b/regress/usr.bin/tail/Makefile @@ -12,4 +12,4 @@ $(REGRESS_ROOT_TARGETS): $(REGRESS_TARGETS): $(SHELL) $@.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/tsort/Makefile b/regress/usr.bin/tsort/Makefile @@ -51,4 +51,4 @@ pairs4: .PHONY: t1 t2 t7 CLEANFILES+=t1.out t2.out t3.out t4.out t5.out t6.out pairs3 pairs4 -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/ul/Makefile b/regress/usr.bin/ul/Makefile @@ -5,4 +5,4 @@ REGRESS_TARGETS = ul ul: $(SHELL) ${.CURDIR}/ul.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/wc/Makefile b/regress/usr.bin/wc/Makefile @@ -5,4 +5,4 @@ REGRESS_TARGETS = wc wc: $(SHELL) ${.CURDIR}/wc.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.bin/xargs/Makefile b/regress/usr.bin/xargs/Makefile @@ -5,4 +5,4 @@ PROG= showargs run-regress-showargs: @$(SHELL) ${.CURDIR}/xargs-L.sh -include bsd.regress.mk +include ${.TOPDIR}/mk/bsd.regress.mk diff --git a/regress/usr.sbin/Makefile b/regress/usr.sbin/Makefile @@ -1,3 +1,3 @@ -SUBDIR = -SKIPDIR = -include bsd.subdir.mk +TOPDIR?=../.. +SUBDIR= +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/sbin/Makefile b/sbin/Makefile @@ -1,3 +1,3 @@ -SUBDIR = mknod - -include bsd.subdir.mk +TOPDIR?=.. +SUBDIR= mknod +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/sbin/mknod/Makefile b/sbin/mknod/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.5 2001/08/21 17:55:47 millert Exp $ +.TOPDIR?=../.. + PROG= mknod MAN= mknod.8 mkfifo.1 LINKS= ${BINDIR}/mknod ${BINDIR}/mkfifo -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/Makefile b/usr.bin/Makefile @@ -1,9 +1,10 @@ -# dc before bc because it depends on dc.o -SUBDIR = apply awk basename dc bc biff cal calendar cmp colrm col column comm \ - cut dirname du diff3 diff env expand false file fmt fold getopt grep head \ - hexdump id indent join jot lam lndir logger logname look mktemp nice \ - nl nohup paste patch printenv printf readlink renice rev rs sed shar \ - sort split stat tee time touch tr true tsort tty uname unexpand uniq unvis \ - uudecode uuencode vis wc what which xinstall hexdump cu newsyslog sdiff -SKIPDIR = file cu -include bsd.subdir.mk +TOPDIR?=.. +SUBDIR= apply awk basename bc biff cal calendar cmp colrm col column comm \ + cut dc dirname du diff3 diff env expand false file fmt fold getopt \ + grep head hexdump id indent join jot lam lndir logger logname look \ + mktemp nice nl nohup paste patch printenv printf readlink renice rev \ + rs sed shar sort split stat tee time touch tr true tsort tty uname \ + unexpand uniq unvis uudecode uuencode vis wc what which xinstall \ + hexdump cu newsyslog sdiff +SKIPDIR=file cu +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/usr.bin/apply/Makefile b/usr.bin/apply/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:16 deraadt Exp $ +.TOPDIR?=../.. + PROG= apply CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.14 2013/08/18 22:06:44 miod Exp $ +.TOPDIR?=../.. + PROG= awk SRCS= ytab.c lex.c b.c main.c parse.c proctab.c tran.c lib.c run.c LDADD= -lm @@ -9,6 +11,7 @@ CFLAGS+=-I. -I${.CURDIR} -DHAS_ISBLANK -DNDEBUG HOSTCFLAGS+=-I. -I${.CURDIR} -DHAS_ISBLANK -DNDEBUG CPPFLAGS+=-D_GNU_SOURCE +# XXX: replace with make depends lex.o b.o main.o tran.o run.o parse.o lib.o : ytab.h ytab.c: awkgram.y @@ -24,4 +27,4 @@ proctab.c: maketab maketab: ytab.h maketab.c ${HOSTCC} ${HOSTCFLAGS} ${.CURDIR}/maketab.c -o $@ -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/basename/Makefile b/usr.bin/basename/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.5 2001/07/05 22:06:33 pjanzen Exp $ +.TOPDIR?=../.. + PROG= basename -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/bc/Makefile b/usr.bin/bc/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.8 2015/10/10 19:28:54 deraadt Exp $ +.TOPDIR?=../.. + PROG= bc SRCS= bc.y scan.l tty.c dc.c bcode.c inout.c mem.c stack.c CPPFLAGS+= -I. -I${.CURDIR} @@ -8,12 +10,14 @@ YFLAGS+= LDADD+= -ledit -lcurses -lcrypto DPADD+= ${LIBEDIT} ${LIBCURSES} ${LIBCRYPTO} +# XXX: include add %/obj by default? VPATH+= ${.CURDIR}/../dc beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/bc.library \ ${DESTDIR}/usr/share/misc +# XXX: replace with make depends scan.o : y.tab.h -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/biff/Makefile b/usr.bin/biff/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:28 deraadt Exp $ +.TOPDIR?=../.. + PROG= biff -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/cal/Makefile b/usr.bin/cal/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:29 deraadt Exp $ +.TOPDIR?=../.. + PROG= cal CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/calendar/Makefile b/usr.bin/calendar/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.10 2015/10/23 10:33:52 tedu Exp $ +.TOPDIR?=../.. + PROG= calendar SRCS= calendar.c io.c day.c pesach.c ostern.c paskha.c INTER= de_DE.UTF-8 hr_HR.UTF-8 ru_RU.UTF-8 fr_FR.UTF-8 @@ -16,4 +18,4 @@ beforeinstall: # ${DESTDIR}/usr/share/calendar/${lang}; #.endfor -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/cmp/Makefile b/usr.bin/cmp/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:41 deraadt Exp $ +.TOPDIR?=../.. + PROG= cmp SRCS= cmp.c misc.c regular.c special.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/col/Makefile b/usr.bin/col/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:42 deraadt Exp $ +.TOPDIR?=../.. + PROG= col -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/colrm/Makefile b/usr.bin/colrm/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:45 deraadt Exp $ +.TOPDIR?=../.. + PROG= colrm CPPFLAGS+=-D_GNU_SOURCE -D_XOPEN_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/column/Makefile b/usr.bin/column/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:46 deraadt Exp $ +.TOPDIR?=../.. + PROG= column CPPFLAGS+=-D_GNU_SOURCE -D_XOPEN_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/comm/Makefile b/usr.bin/comm/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:47 deraadt Exp $ +.TOPDIR?=../.. + PROG= comm -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/cu/Makefile b/usr.bin/cu/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 2012/07/10 11:42:02 nicm Exp $ +.TOPDIR?=../.. + PROG= cu SRCS= cu.c command.c error.c input.c xmodem.c @@ -8,4 +10,4 @@ CDIAGFLAGS+= -Wall -W -Wno-unused-parameter LDADD= -levent DPADD= ${LIBEVENT} -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/cut/Makefile b/usr.bin/cut/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:51 deraadt Exp $ +.TOPDIR?=../.. + PROG= cut -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/dc/Makefile b/usr.bin/dc/Makefile @@ -1,10 +1,11 @@ # $OpenBSD: Makefile,v 1.3 2015/10/10 19:28:54 deraadt Exp $ +.TOPDIR?=../.. + PROG= dc SRCS= main.c dc.c bcode.c inout.c mem.c stack.c -CPPFLAGS+=-D_GNU_SOURCE COPTS+= -Wall LDADD= -lcrypto DPADD= ${LIBCRYPTO} -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/diff/Makefile b/usr.bin/diff/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.3 2007/05/29 18:24:56 ray Exp $ +.TOPDIR?=../.. + PROG= diff SRCS= diff.c diffdir.c diffreg.c xmalloc.c COPTS+= -Wall -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/diff3/Makefile b/usr.bin/diff3/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 2003/07/22 00:11:30 millert Exp $ +.TOPDIR?=../.. + PROG= diff3prog MAN= diff3.1 BINDIR= /usr/libexec @@ -8,4 +10,4 @@ beforeinstall: install ${INSTALL_COPY}c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${.CURDIR}/diff3.ksh ${DESTDIR}/usr/bin/diff3 -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/dirname/Makefile b/usr.bin/dirname/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.4 2001/07/05 22:06:24 pjanzen Exp $ +.TOPDIR?=../.. + PROG= dirname -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/du/Makefile b/usr.bin/du/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.4 2004/06/14 18:21:31 otto Exp $ +.TOPDIR?=../.. + PROG= du DPADD= ${LIBUTIL} LDADD= -lutil -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/env/Makefile b/usr.bin/env/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:48:56 deraadt Exp $ +.TOPDIR?=../.. + PROG= env -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/expand/Makefile b/usr.bin/expand/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.4 2016/03/30 06:38:45 jmc Exp $ +.TOPDIR?=../.. + PROG= expand -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/false/Makefile b/usr.bin/false/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.5 2015/11/11 19:05:28 deraadt Exp $ +.TOPDIR?=../.. + MAN= false.1 PROG= false -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/file/Makefile b/usr.bin/file/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.16 2015/10/04 07:25:59 nicm Exp $ +.TOPDIR?=../.. + PROG= file SRCS= file.c magic-dump.c magic-load.c magic-test.c magic-common.c \ text.c xmalloc.c @@ -39,4 +41,4 @@ afterinstall: all: file magic -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/fmt/Makefile b/usr.bin/fmt/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.4 1998/04/25 23:08:26 millert Exp $ +.TOPDIR?=../.. + PROG= fmt SRCS= fmt.c CPPFLAGS+=-D_XOPEN_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/fold/Makefile b/usr.bin/fold/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:49:05 deraadt Exp $ +.TOPDIR?=../.. + PROG= fold CPPFLAGS+=-D_XOPEN_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/getopt/Makefile b/usr.bin/getopt/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:33:44 deraadt Exp $ +.TOPDIR?=../.. + PROG = getopt -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.7 2016/03/30 06:38:46 jmc Exp $ +.TOPDIR?=../.. + PROG= grep SRCS= binary.c file.c grep.c mmfile.c queue.c util.c LINKS= ${BINDIR}/grep ${BINDIR}/egrep \ @@ -13,4 +15,4 @@ CFLAGS+= -Wall LDADD= -lz DPADD= ${LIBZ} -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/head/Makefile b/usr.bin/head/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:34:14 deraadt Exp $ +.TOPDIR?=../.. + PROG= head -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/hexdump/Makefile b/usr.bin/hexdump/Makefile @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:34:16 deraadt Exp $ +.TOPDIR?=../.. + PROG= hexdump SRCS= conv.c display.c hexdump.c hexsyntax.c odsyntax.c parse.c MAN= hexdump.1 od.1 LINKS= ${BINDIR}/hexdump ${BINDIR}/od -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/id/Makefile b/usr.bin/id/Makefile @@ -1,9 +1,11 @@ # $OpenBSD: Makefile,v 1.5 2013/09/06 19:48:46 okan Exp $ +.TOPDIR?=../.. + PROG= id MAN= id.1 groups.1 whoami.1 LINKS= ${BINDIR}/id ${BINDIR}/groups \ ${BINDIR}/id ${BINDIR}/whoami -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/indent/Makefile b/usr.bin/indent/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:34:27 deraadt Exp $ +.TOPDIR?=../.. + PROG= indent SRCS= indent.c io.c lexi.c parse.c pr_comment.c args.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/join/Makefile b/usr.bin/join/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 2003/12/12 10:38:44 otto Exp $ +.TOPDIR?=../.. + PROG= join CFLAGS+= -Wall -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/jot/Makefile b/usr.bin/jot/Makefile @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.5 2016/01/10 01:15:52 tb Exp $ +.TOPDIR?=../.. + PROG= jot CFLAGS+= -Wall LDADD+= -lm DPADD+= ${LIBM} -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/lam/Makefile b/usr.bin/lam/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:49:24 deraadt Exp $ +.TOPDIR?=../.. + PROG= lam -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/lndir/Makefile b/usr.bin/lndir/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.1 1996/08/19 05:47:25 downsj Exp $ +.TOPDIR?=../.. + PROG= lndir -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/logger/Makefile b/usr.bin/logger/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:49:37 deraadt Exp $ +.TOPDIR?=../.. + PROG= logger -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/logname/Makefile b/usr.bin/logname/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:49:42 deraadt Exp $ +.TOPDIR?=../.. + PROG= logname -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/look/Makefile b/usr.bin/look/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:49:44 deraadt Exp $ +.TOPDIR?=../.. + PROG= look -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/mktemp/Makefile b/usr.bin/mktemp/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.1 1996/11/21 07:59:31 millert Exp $ +.TOPDIR?=../.. + PROG= mktemp CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/newsyslog/Makefile b/usr.bin/newsyslog/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.7 2016/06/01 16:57:48 tedu Exp $ +.TOPDIR?=../.. + PROG= newsyslog CPPFLAGS+=-D_GNU_SOURCE @@ -7,4 +9,4 @@ BINOWN= root MAN= newsyslog.8 -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/nice/Makefile b/usr.bin/nice/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:50:19 deraadt Exp $ +.TOPDIR?=../.. + PROG= nice -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/nl/Makefile b/usr.bin/nl/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.1 2013/09/08 18:59:07 jca Exp $ # $NetBSD: Makefile,v 1.4 2011/08/16 12:00:46 christos Exp $ +.TOPDIR?=../.. + PROG= nl -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/nohup/Makefile b/usr.bin/nohup/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:50:24 deraadt Exp $ +.TOPDIR?=../.. + PROG= nohup -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/paste/Makefile b/usr.bin/paste/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:37:49 deraadt Exp $ +.TOPDIR?=../.. + PROG= paste -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/patch/Makefile b/usr.bin/patch/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.5 2015/10/16 07:33:47 tobias Exp $ +.TOPDIR?=../.. + PROG= patch SRCS= patch.c pch.c inp.c util.c backupfile.c mkpath.c ed.c CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/printenv/Makefile b/usr.bin/printenv/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:37:56 deraadt Exp $ +.TOPDIR?=../.. + PROG= printenv -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/printf/Makefile b/usr.bin/printf/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:37:58 deraadt Exp $ +.TOPDIR?=../.. + PROG= printf -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/readlink/Makefile b/usr.bin/readlink/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1997/08/18 20:30:59 kstailey Exp $ +.TOPDIR?=../.. + PROG= readlink -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/renice/Makefile b/usr.bin/renice/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:38:26 deraadt Exp $ +.TOPDIR?=../.. + PROG= renice MAN= renice.8 -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/rev/Makefile b/usr.bin/rev/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:50:34 deraadt Exp $ +.TOPDIR?=../.. + PROG= rev -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/rs/Makefile b/usr.bin/rs/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.3 2015/12/03 12:23:15 schwarze Exp $ +.TOPDIR?=../.. + PROG= rs SRCS= rs.c utf8.c CPPFLAGS+=-D_GNU_SOURCE -D_XOPEN_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/sdiff/Makefile b/usr.bin/sdiff/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.4 2006/02/20 08:38:18 otto Exp $ +.TOPDIR?=../.. + PROG=sdiff SRCS=common.c edit.c sdiff.c COPTS+=-Wall -W @@ -7,4 +9,4 @@ COPTS+=-Wall -W LDADD+= -lutil DPADD+= ${LIBUTIL} -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/sed/Makefile b/usr.bin/sed/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.4 2010/01/04 17:50:39 deraadt Exp $ +.TOPDIR?=../.. + PROG= sed SRCS= compile.c main.c misc.c process.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/shar/Makefile b/usr.bin/shar/Makefile @@ -1,9 +1,11 @@ # $OpenBSD: Makefile,v 1.5 1997/09/21 11:50:44 deraadt Exp $ +.TOPDIR?=../.. + MAN= shar.1 #beforeinstall: # ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ # ${.CURDIR}/shar.sh ${DESTDIR}/usr/bin/shar -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/sort/Makefile b/usr.bin/sort/Makefile @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.6 2015/03/17 17:45:13 millert Exp $ +.TOPDIR?=../.. + PROG= sort SRCS= bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c CPPFLAGS+=-D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/split/Makefile b/usr.bin/split/Makefile @@ -1,5 +1,7 @@ -# $OpenBSD: Makefile,v 1.3 1997/09/21 11:50:59 deraadt Exp $ +## $OpenBSD: Makefile,v 1.3 1997/09/21 11:50:59 deraadt Exp $ + +.TOPDIR?=../.. PROG= split -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/stat/Makefile b/usr.bin/stat/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.2 2005/04/03 18:30:55 deraadt Exp $ # $NetBSD: Makefile,v 1.7 2003/07/25 03:21:17 atatat Exp $ +.TOPDIR?=../.. + PROG= stat -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/tee/Makefile b/usr.bin/tee/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:09 deraadt Exp $ +.TOPDIR?=../.. + PROG= tee -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/time/Makefile b/usr.bin/time/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:14 deraadt Exp $ +.TOPDIR?=../.. + PROG= time -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/touch/Makefile b/usr.bin/touch/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:19 deraadt Exp $ +.TOPDIR?=../.. + PROG= touch CPPFLAGS+=-D_XOPEN_SOURCE -D_GNU_SOURCE -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/tr/Makefile b/usr.bin/tr/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:22 deraadt Exp $ +.TOPDIR?=../.. + PROG= tr SRCS= str.c tr.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/true/Makefile b/usr.bin/true/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.5 2015/11/11 19:05:28 deraadt Exp $ +.TOPDIR?=../.. + MAN= true.1 PROG= true -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/tsort/Makefile b/usr.bin/tsort/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.6 2014/05/12 19:11:20 espie Exp $ +.TOPDIR?=../.. + PROG = tsort SRCS = tsort.c @@ -8,4 +10,4 @@ DPADD += ${LIBUTIL} LDADD += -L$(TOPDIR)/lib/libutil -lutil CPPFLAGS+=-I$(TOPDIR)/lib/libutil -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/tty/Makefile b/usr.bin/tty/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:27 deraadt Exp $ +.TOPDIR?=../.. + PROG= tty -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/uname/Makefile b/usr.bin/uname/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.2 1996/06/26 05:42:06 deraadt Exp $ +.TOPDIR?=../.. + PROG= uname -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/unexpand/Makefile b/usr.bin/unexpand/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:30 deraadt Exp $ +.TOPDIR?=../.. + PROG= unexpand NOMAN= noman -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/uniq/Makefile b/usr.bin/uniq/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.4 2006/04/07 05:10:02 ray Exp $ +.TOPDIR?=../.. + PROG= uniq COPTS+= -Wall -W -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/unvis/Makefile b/usr.bin/unvis/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:36 deraadt Exp $ +.TOPDIR?=../.. + PROG= unvis -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/uudecode/Makefile b/usr.bin/uudecode/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.4 2004/04/09 22:54:02 millert Exp $ +.TOPDIR?=../.. + PROG= uudecode LINKS= ${BINDIR}/uudecode ${BINDIR}/b64decode NOMAN= noman -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/uuencode/Makefile b/usr.bin/uuencode/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.7 2016/03/30 06:38:46 jmc Exp $ +.TOPDIR?=../.. + PROG= uuencode MAN= uuencode.1 uuencode.5 LINKS= ${BINDIR}/uuencode ${BINDIR}/b64encode -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/vis/Makefile b/usr.bin/vis/Makefile @@ -1,6 +1,8 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:50 deraadt Exp $ +.TOPDIR?=../.. + PROG= vis SRCS= vis.c foldit.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/wc/Makefile b/usr.bin/wc/Makefile @@ -1,7 +1,9 @@ # $OpenBSD: Makefile,v 1.3 2005/10/19 21:49:02 espie Exp $ +.TOPDIR?=../.. + PROG= wc DPADD= ${LIBUTIL} LDADD= -lutil -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/what/Makefile b/usr.bin/what/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:58 deraadt Exp $ +.TOPDIR?=../.. + PROG= what -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/which/Makefile b/usr.bin/which/Makefile @@ -1,9 +1,12 @@ # $OpenBSD: Makefile,v 1.9 2016/05/26 21:24:16 millert Exp $ +.TOPDIR?=../.. + PROG= which MAN= which.1 whereis.1 LINKS= ${BINDIR}/which ${BINDIR}/whereis +# XXX: put the updated man page in the objdir? check_path_in_man: @echo "Checking path expansion in whereis.1"; \ stdpath=`printf 'include paths.h\n_PATH_STDPATH\n' | \ @@ -16,4 +19,4 @@ check_path_in_man: all: check_path_in_man CLEANFILES = check_path_in_man -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.7 2011/11/08 10:37:10 guenther Exp $ +.TOPDIR?=../.. + PROG= xinstall SRCS= xinstall.c MAN= install.1 @@ -9,4 +11,4 @@ MAN= install.1 # -o ${BINOWN} -g ${BINGRP} \ # -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/install -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile @@ -1,3 +1,3 @@ -SUBDIR = mtree rdate - -include bsd.subdir.mk +TOPDIR?=.. +SUBDIR= mtree rdate +include ${.TOPDIR}/mk/bsd.subdir.mk diff --git a/usr.sbin/mtree/Makefile b/usr.sbin/mtree/Makefile @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.9 2013/04/15 06:25:18 deraadt Exp $ +.TOPDIR?=../.. + PROG= mtree #CFLAGS+=-DDEBUG MAN= mtree.8 SRCS= compare.c crc.c create.c misc.c mtree.c spec.c verify.c -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk diff --git a/usr.sbin/rdate/Makefile b/usr.sbin/rdate/Makefile @@ -1,5 +1,7 @@ # $OpenBSD: Makefile,v 1.7 2003/11/20 23:23:09 avsm Exp $ +.TOPDIR?=../.. + PROG= rdate SRCS= rdate.c rfc868time.c ntp.c ntpleaps.c CFLAGS+=-Wall @@ -8,4 +10,4 @@ LDADD+= -lutil MAN= rdate.8 -include bsd.prog.mk +include ${.TOPDIR}/mk/bsd.prog.mk