NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

What is BSD make?

After years of development using GNU make under Linux I switched my
home workstation to NetBSD. Here I've found a number of interesting
things. One of them is NetBSD make.

I've found it's VERY interesting and in many aspect much better than
GNU make. But I have a few questions about it. Some are about history.

1) Here there is interesting
   information about history of make utility.

   But this history ends with

    * BSD make, which is derived from Adam de Boor's work on a version
      of make capable of building targets in parallel, and survives
      with _varying degrees of modification_ in FreeBSD, NetBSD and

   So the very first question is "What exactly is BSD make?"  How
   different FreeBSD/NetBSD and OpenBSD make utilities are?  Do
   appropriate *BSD teams try to keep their make as compatible as
   possible or not.

2) Another question is "What is pmake?"
   If I understand correctly this page
   describes that common ancestor of all *BSD makes without any extensions.
   pmake is also 4.4BSD make utility and also "parallel make". Right?

   hint: In many Linux distros pmake package is available and is
   actually a rather old version of NetBSD make.

3) In my view bsd.*.mk scripts is a main thing about BSD make. It is
   really amazing thing and may be much more important than make itself.
   I believe that MK scripts with _some extensions and additions_
   may be excellent replacement for GNU make + automake + libtool.

   I really love declarative nature in writing Makefiles, I like this
   approach and think that things like automake/libtool must die.

   The question is (rhetorical again) why BSD makes are used mainly to
   build respective *BSD systems and not used by software developers
   outside *BSD. That is, why BSD make and especially MK scripts are
   promoted so badly :-(

4) Recently I've found that FreeBSD and NetBSD MK scripts
   are also a bit different. They build shared libraries
   differently, for examples (I have no access to OpenBSD).

   The question is (rhetorical again) is there reason for *BSD developers
   to have their own extensions to MK scripts incompatible with others'.
   Why not to have one common MK scripts for all their makes and systems.

   Different and incompatible mk scripts make general purpose
   development using these scripts painful. But I think that
   potential for MK script is very big.

5) Here I've found different MK
   scripts (devel/mk-files), fork of NetBSD mk files.  Is Simon
   J. Gerraty <> the only developer of these scripts?
   Are these scripts completely independeant from NetBSD and pkgsrc

6) pkgsrc pkgtools/bootstrap-mk-files is yet another place for mk
   files.  Are these scripts completely independent from NetBSD mk
   files and those by
   Or they synced periodically? Where is upstream for
   pkgtools/bootstrap-mk-files? Are these scripts distributed as
   separate tarball anywhere? What is relation between
   pkgtools/bootstrap-mk-files and devel/mk-files?

7) mk files from pkgtools/bootstrap-mk-files supports
   building shared libraries
   by setting SHLIB_MAJOR etc.
   It is well known that different compilers and different OSes
   have their own way to create .so/.dynlib/.dll etc.
   Currently only gcc is supported (-shared is hardcoded in

   This is where libtool/autoconf/automake comes into play in GNU
   world, but I don't like this _approach_. Declarative Makefiles
   seems much better to me. Like this one.

       PROG=         mylib
       SRCS=         1.c 2.c 3.c

       SHLIB_MAJOR=  1
       SHLIB_MINOR=  0
       SHLIB_TEENY=  4

       .include <>

   This is already implemented but only for GCC.
   What about support for other compilers and platforms? It whould be nice
   build libraries like this

        bmake all COMPILER_TYPE=sunc 

   I think idea is clear. I'm talking about crossplatform general
   purpose development using BSD make (or NetBSD make) and MK scripts.

8) The same as 7) for pthread support. It whould be nice to write Makefile
   like this

      PROG=             hello

      NEED_PTHREAD=     yes

      .include <>

   Compiler's and linker's options should be added automatically,
   e.g. -pthread.

9) I'm looking for system (replacement for automake/libtool/make)
   where I can write declarative Makefiles, just like that I can write
   with <bsd.*.mk> scripts and BSD makes, but with problems mentioned
   above solved. Any suggestions?  I don't want to reimplement the
   wheel and implement such scripts manually.

Best regards, Aleksey Cheusov.

Home | Main Index | Thread Index | Old Index