Skip to content

Commit

Permalink
README.md: BSD make on FreeBSD needs MAKESYSPATH set.
Browse files Browse the repository at this point in the history
Add the note that using BSD make on FreeBSD as a development host
requires the system makefile include path set to /usr/share/mk and
that it can be done either via command line or via the MAKESYSPATH
environment variable.

The regression this solves is that FreeBSD, by default, sets
  DEFAULT_SYS_PATH?= .../share/mk:/usr/share/mk
for their BSD make (actually NetBSD make) system path to sys.mk.

Changing DiscoBSD's system include Makefile from target.mk to
share/mk/sys.mk caused FreeBSD's BSD make to pick it up, even for
building the utilities in tools.

There are no elegant ways to remedy this issue on FreeBSD besides
requiring users to either use make -m or set MAKESYSPATH.

GNU make does not have this issue, as it does not use /usr/share/mk.
  • Loading branch information
chettrick committed Feb 23, 2024
1 parent 890bf1c commit 0726bbd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Building

DiscoBSD is cross-built on UNIX-like host operating systems.

Currently supported host operating systems: OpenBSD, Linux, FreeBSD.

Instructions to configure an OpenBSD host development environment for
Arm and MIPS targets is available [here][6].

Expand All @@ -103,6 +105,19 @@ which will build a file system image in the file `distrib/pic32/sdcard.img`
and ELF-formatted kernels in the files `sys/pic32/${BOARD}/unix` and
Intel HEX-formatted kernels in the files `sys/pic32/${BOARD}/unix.hex`.

Using BSD make on a FreeBSD host requires the system makefile include
directory to be specified on the command line or via the MAKESYSPATH
environment variable. For example:

$ make -m /usr/share/mk

or

$ MAKESYSPATH=/usr/share/mk
$ export MAKESYSPATH

$ make

[6]: tools/openbsd/README.md

Debugging
Expand Down

0 comments on commit 0726bbd

Please sign in to comment.