diff --git a/Makefile b/Makefile index e5928d6..14a573b 100644 --- a/Makefile +++ b/Makefile @@ -116,11 +116,17 @@ # more or less, but it doesn't support .WAIT in the ${SUBDIR} list, so parallel # builds are impossible with it. # +# Old macOS systems with "bsdmake" may not have "mkdep" in the installed SDK +# even though the wrapper in /usr/bin/mkdep exists (and "xcrun -find mkdep" +# fails). This can be worked around with: MKDEPCMD=/Developer/usr/bin/mkdep +# +# # OpenBSD: # # So note OpenBSD's make since 5.5 (and before 2.1) does NOT support # $MAKEOBJDIRPREFIX at all. For recent OpenBSD, just use ${MAKEOBJDIR} instead. # +# # FreeBSD: # # FreeBSD's mk-files don't work reliably with "obj" in the dependency list for @@ -130,10 +136,11 @@ # "WITH_AUTO_OBJ=yes" ON THE COMMAND LINE OR IN THE ENVIRONMENT! (Having it set # in /etc/src-env.conf DOES NOT WORK for an out-of-/usr/src project.) # +# # Other BMake ports: # # See the first use of .WAIT below for comments about really old BMakes and -# mk-files that don't deal with it properly. +# Mk-files that don't deal with it properly. # ##################### # @@ -212,6 +219,14 @@ bmake_topdir = . +##################### +# +# Sub-directories of the project +# +# xxx this must come after and thus after Makefile.inc because of +# the ugly hacks here to try to sort out wether or not a .WAIT is needed and can +# be included in the list. + SUBDIR = src # Some variants of Mk-files (e.g. NetBSD's) build subdirs in parallel (when @@ -220,8 +235,9 @@ SUBDIR = src # quite make up for it because of the fact these directories always exist prior # to starting make). # -# BMake with pkgsrc's bootstrap-mk-files is equivalent to NetBSD's native -# mk-files, so work fine with '-j' so long as this .WAIT is present. +# BMake with pkgsrc's bootstrap-mk-files are equivalent to NetBSD's native +# Mk-files, so work fine with '-j' so long as this .WAIT is present. These set +# "unix" to "We Run Unix" in . # # BMake with sjg's Mk-files doesn't build subdirs in parallel at all yet, and # until 20240212 it does not support .WAIT in the SUBDIR list, but older @@ -240,17 +256,15 @@ SUBDIR = src # invoke parallel builds (no -j)! # .if !defined(MAKE_VERSION) || \ - (defined(MAKE_VERSION) && defined(_BSD_OWN_MK_) && ${_BSD_OWN_MK_} == 1) || \ - (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 20240212 && ${MAKE} != "bsdmake") || \ + (defined(unix) && ${unix} == "We run Unix"&& ${MAKE} != "bsdmake") || \ + (${MAKE_VERSION} >= 20240212 && ${MAKE} != "bsdmake") || \ (defined(.FreeBSD) && ${.FreeBSD} == "true") SUBDIR += .WAIT SUBDIR_PARALLEL = 1 # defined, for FreeBSD.... .elif defined(.MAKE.JOBS) && (${.MAKE.JOBS} > 1) && \ !defined(MAKE_VERSION) # -# xxx: only more recent bmake's define .MAKE.JOBS. Maybe to support ancient -# OSx bsdmake maybe the .WAIT should be left in so the user has to manually -# remove it and thus see that parallel builds are unsupported? +# xxx: only more recent bmake's define .MAKE.JOBS. # . error "Parallel builds not supported without .WAIT in SUBDIR list." .endif @@ -266,7 +280,7 @@ SUBDIR += test # # The next section is mostly just default boilerplate for stand-alone project # builds. It could/should be in a separate included file. (Except for some of -# the ${bmake_install_dirs}.) +# the setting of ${SUBDIR} and ${bmake_install_dirs}.) # # Yes, "make obj" is forced -- it is stupid to build in the source directory) # @@ -307,19 +321,6 @@ BUILDTARGETS += docs_subdir_${__dir} . endfor .endif -# this ("all") must be the VERY first target -# (there shouldn't be any .includes above, including Makefile.inc!) -# -# (Remove the .WAIT if your build blows up.) -# -all: .PHONY .MAKE bmake-test-obj .WAIT ${BUILDTARGETS} - -# just in case old habits prevail -# -dependall: .PHONY all - -.ORDER: bmake-test-obj bmake-do-obj bmake-do-depend ${SUBDIR} bmake-do-docs - .for targ in ${BUILDTARGETS:N.WAIT:N*_subdir_*} ${targ}: .PHONY .MAKE ${targ:S/bmake-do-//} .endfor @@ -334,6 +335,18 @@ ${__dir}: ${__targ}_subdir_${__dir} .PHONY .MAKE . endfor .endif +# this ("all") must be the VERY first target +# (there shouldn't be any .includes above, including Makefile.inc!) +# +all: .PHONY .MAKE bmake-test-obj .WAIT ${BUILDTARGETS} + +# just in case old habits prevail +# +dependall: .PHONY all + +# xxx the .WAIT's in here are probably not necessary??? +.ORDER: bmake-test-obj .WAIT ${BUILDTARGETS} + # XXX this is just a very crude check... not as complete as the FreeBSD check # bmake-test-obj: .PHONY diff --git a/src/Makefile b/src/Makefile index f9f441b..959964c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -165,16 +165,18 @@ incinstall: .PHONY # .if ((defined(TARGET_OSNAME) && (${TARGET_OSNAME} == "Linux")) || \ (defined(OS) && (${OS} == "Linux"))) +# # XXX stupid GNU BinUtils LD changed its command line syntax recently, # apparently without concern for backward compatability. # -# N.B.: also apparently on Linux BMake currently (20200710) doesn't use -# SHLIB_SHFLAGS for the final command, but instead LD_shared, and for non-BSD -# platforms the value of LD_shared directly overridden without consulting -# SHLIB_SHFLAGS. +# N.B.: also apparently on Linux BMake currently (20200710 on ubuntu-latest, +# 20181221 on ubuntu-20.04) doesn't use SHLIB_SHFLAGS for the final command, but +# instead LD_shared, and for non-BSD platforms the value of LD_shared directly +# overridden without consulting SHLIB_SHFLAGS. # # So, override LD_shared to use more portable '-h' instead of the apparently now # dead '-soname' (we could use '--soname', but '-h' is probably more canonical). +# LD_shared=-shared -Wl,-h,lib${LIB}.so.${SHLIB_MAJOR} .endif @@ -182,7 +184,7 @@ LD_shared=-shared -Wl,-h,lib${LIB}.so.${SHLIB_MAJOR} # # We'll still link our own programs and tests with the static library as that # makes testing during build possible, but providing a dylib might be useful for -# other uses.... +# other uses and may make packager's jobs easier.... # .if ${MAKE} != "bsdmake" && \ ((defined(TARGET_OSNAME) && (${TARGET_OSNAME} == "Darwin")) || \ @@ -206,7 +208,7 @@ SHLIB_FULLVERSION ?= ${SHLIB_MAJOR} SHLIB_FULLVERSION ?= ${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY} . endif SHLIB_INSTALL_VERSION ?= ${SHLIB_MAJOR} -# hmmm..... should compat be just SHLIB_MAJOR? (not according to Simon G.) +# hmmm..... should compat be just SHLIB_MAJOR? (not according to sjg) SHLIB_COMPATABILITY_VERSION ?= ${SHLIB_MAJOR}.${SHLIB_MINOR} # XXX do we need "-install_name=${PREFIX}/lib/lib${LIB}.dylib" too? # xxx -dylib_*_version might be too new for macos-10.x @@ -223,8 +225,10 @@ lib${LIB}.dylib: lib${LIB}.so.${SHLIB_FULLVERSION} # @echo fixing up shared library name for macos: ${.TARGET} # ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} ${.TARGET} +# xxx why does this have realall too? realall all: lib${LIB}.dylib +# xxx this afterinstall: ${DESTDIR}${LIBDIR}/lib${LIB}.dylib ${DESTDIR}${LIBDIR}/lib${LIB}.dylib: diff --git a/src/yajl/Makefile b/src/yajl/Makefile index edb15b5..c66640d 100644 --- a/src/yajl/Makefile +++ b/src/yajl/Makefile @@ -13,7 +13,10 @@ yajl_INCS += yajl_tree.h # bsdmake! Probably not needed after there was a symlink to # ! Does no harm though. # -.if defined(MAKE_VERSION) && (${MAKE_VERSION} < 5200408120) +# but must be avoided with pkgsrc bootstrap-mk-files... +# +.if defined(MAKE_VERSION) && (${MAKE_VERSION} < 5200408120) && \ + (defined(unix) && ${unix} != "We run Unix") INCS += ${yajl_INCS:S|^|${.CURDIR}/|} .else INCS += ${yajl_INCS}