Skip to content

Commit

Permalink
src/Makefile, src/yajl/Makefile: make inc installs work with sjg's Mk…
Browse files Browse the repository at this point in the history
…-files
  • Loading branch information
robohack committed Mar 22, 2024
1 parent 1a69a02 commit cc24cea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
21 changes: 7 additions & 14 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,16 @@ _bmake_static_lib_install_symlink: .PHONY
SUBDIR += yajl

.include <bsd.lib.mk>
.if !defined(DISTRIBUTION) # avoid a duplicate include on some systems
.include <bsd.subdir.mk>
# avoid a duplicate include on some systems
.if !defined(DISTRIBUTION)
. include <bsd.subdir.mk>
.endif
.sinclude <inc.mk> # hack for crufty.net mk-files

# this has to come after to avoid upsetting the check in any system mk-file
# xxx hmmmm.... weird! Avoid a "don't know how to make incinstall" error with
# Bmake-20181221 and newer (and maybe some older? was ok in mk-20160401):
#
.if target(install)
# get includes to install at install time
install: includes
.endif

# xxx hmmmm.... weird! Avoid a "don't know how to make incinstall" error on
# macOS with Homebrew bmake-20181221:
#
# (this target is defined in <bsd.inc.mk> (on at least NetBSD and DragonflyBSD)
# which is included in <bsd.lib.mk> and others)
# (this target is defined in <bsd.inc.mk> (on at least NetBSD and DragonflyBSD,
# and in sjg's Mk-files) which is included in <bsd.lib.mk> and others)
#
.if !target(incinstall)
incinstall: .PHONY
Expand Down
23 changes: 20 additions & 3 deletions src/yajl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ yajl_INCS += yajl_gen.h
yajl_INCS += yajl_common.h
yajl_INCS += yajl_tree.h

.if defined(_this_mk_dir) # special for crufty.net mk-files
# special for sjg's Mk-files
#
# XXX Not needed after some point, but when???? Definitely not for macos
# bsdmake! Probably not needed after there was a <bsd.inc.mk> symlink to
# <inc.mk>! Does no harm though.
#
.if defined(MAKE_VERSION) && (${MAKE_VERSION} < 5200408120)
INCS += ${yajl_INCS:S|^|${.CURDIR}/|}
.else
INCS += ${yajl_INCS}
Expand All @@ -16,14 +22,25 @@ INCS += ${yajl_INCS}
INCS += yajl_version.h
CLEANFILES += yajl_version.h

.include <bsd.prog.mk> # bsd.inc.mk is insufficient (no ../Makefile.inc)
.sinclude <inc.mk> # hack for crufty.net mk-files
.include <bsd.prog.mk> # bsd.inc.mk is insufficient (no ../Makefile.inc)
.if !target(incinstall) && !target(inc_mkdirs)
. sinclude <inc.mk> # hack for sjg's Mk-files, esp. pre <bsd.inc.mk> link
.endif

# this has to come after <bsd.prog.mk> to avoid upsetting the check in any
# system mk-file
#
.if target(install)
# get includes to install at install time
install: includes
.endif

# work-arounds for sjg's Mk-files
.if !target(.depend)
.depend:
touch ${.TARGET}
.endif

#
# Local Variables:
# eval: (make-local-variable 'compile-command)
Expand Down

0 comments on commit cc24cea

Please sign in to comment.