html.mk

static html creation framework using make(1) and cpp(1)
Log | Files | Refs | README | LICENSE

commit 256f10c3505df460ccc6c8d903b4f3e0c03c8271
parent d3b0e0dd6a34a51a2d38e41bdb55ce403bc930a8
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Tue, 20 Jul 2021 20:38:01 +0000

mk: replace obj.mk with bsd.obj.mk

Diffstat:
Mmk/html.mk | 2+-
Dmk/obj.mk | 35-----------------------------------
Mt/cp_happy.t | 5+++--
Mt/cp_unhappy.t | 3++-
4 files changed, 6 insertions(+), 39 deletions(-)

diff --git a/mk/html.mk b/mk/html.mk @@ -168,6 +168,6 @@ all: ${.OBJDIR}/${file} .endif .endfor -.include "obj.mk" .include "site.mk" +.include <bsd.obj.mk> .include <bsd.subdir.mk> diff --git a/mk/obj.mk b/mk/obj.mk @@ -1,35 +0,0 @@ -# -# Originally from OpenBSD /usr/share/mk/bsd.obj.mk. -# - -_SUBDIRUSE: - -obj! _SUBDIRUSE - @cd ${.CURDIR}; \ - here=`/bin/pwd`/; bsdsrcdir=`cd ${TOP}; /bin/pwd`; \ - subdir=$${here#$${bsdsrcdir}/}; \ - if [[ $$here != $$subdir ]]; then \ - dest=${DESTDIR}/$$subdir ; \ - echo "$$here/obj -> $$dest"; \ - if [[ ! -L obj || `readlink obj` != $$dest ]]; \ - then \ - [[ -e obj ]] && rm -rf obj; \ - ln -sf $$dest obj; \ - fi; \ - if [[ -d ${DESTDIR} ]]; then \ - [[ -d $$dest ]] || mkdir -p $$dest; \ - else \ - if [[ -e ${DESTDIR} ]]; then \ - echo "${DESTDIR} is not a directory"; \ - else \ - echo "${DESTDIR} does not exist"; \ - fi; \ - fi; \ - else \ - dest=$$here/obj ; \ - if [[ ! -d obj ]]; then \ - echo "making $$dest" ; \ - mkdir -p $$dest; \ - $$SETOWNER $$dest; \ - fi ; \ - fi; diff --git a/t/cp_happy.t b/t/cp_happy.t @@ -14,7 +14,8 @@ $cmd->write( 'copy.txt', 'some stuff here' ); $cmd->subdir( 'destdir' ); $cmd->write( 'Makefile', <<EOF ); CP_OBJ = copy.txt -DESTDIR = destdir +BSDSRCDIR = /tmp +BSDOBJDIR = destdir SRCS = .include "$html_mk" @@ -23,7 +24,7 @@ EOF # # Create obj/ directory. # -my $o = ".*//obj -> destdir/"; +my $o = ".*/obj -> destdir/"; $cmd->run( args => 'obj', chdir => $cmd->curdir ); like( $cmd->stdout, qr{$o}, 'make obj stdout' ); diff --git a/t/cp_unhappy.t b/t/cp_unhappy.t @@ -37,7 +37,8 @@ $e = 'cp: .*/cp_dir is a directory \(not copied\)'; $cmd->subdir( 'destdir', 'cp_dir' ); $cmd->write( 'Makefile', <<EOF ); CP_OBJ = cp_dir -DESTDIR = destdir +BSDSRCDIR = /tmp +BSDOBJDIR = destdir SRCS = .include "$html_mk"