bsd.prog.mk

You'll be surprised that it tends to just work on all BSD variants.

Stuff that breaks: PROG & PROGS with multiple targets.
To enable warnings I set both `WARNINGS= yes` and `WARNS= 3`
 
You'll be surprised that it tends to just work on all BSD variants.

Stuff that breaks: PROG & PROGS with multiple targets.
To enable warnings I set both `WARNINGS= yes` and `WARNS= 3`
I was kinda hoping that it would work on all BSD variants as I'm trying to find out if it ought to work on FreeBSD v1.0
 
Does bsd.prog.mk get changed from release to release of FreeBSD?
It almost certainly does. As mer already said, git(1) would be the most convenient way to find the exact differences between the releases.

I guess there may be a more straightforward way in git for doing this, but honestly git interface is a mess, and I don't really want to spend much time fiddling with it. However, I wrote a simple shell script that will help you to get the versions of bsd.prog.mk for every FreeBSD release up until 15.0. Before running it, make sure that you have a git repository with FreeBSD sources in your /usr/src and have enough privileges to perform git operations on it (usually, /usr/src is owned by root, but on my system, it's owned by my user, so I can operate on this repo without going to su(1)). You may also want to change DEST variable, where the resulting files will be saved.

diff-bsd-prog-mk
sh:
#!/bin/sh

progname=$(basename "${0}")
SRC=/usr/src
DEST=/tmp/bsd-prog-mks
RELENGS="1 2.0 2.0.5 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 5.0 5.1 5.2 \
5.3 5.4 5.5 6.0 6.1 6.2 6.3 6.4 7.0 7.1 7.2 7.3 7.4 8.0 8.2 8.3 8.4 9.0 \
9.1 9.2 9.3 10.0 10.1 10.2 10.3 10.4 11.0 11.1 11.2 11.3 11.4 12.0 12.1 \
12.2 12.3 12.4 13.0 13.1 13.2 13.3 13.4 13.5 14.0 14.1 14.2 14.3 15.0"

err()
{
    echo "${progname}: ${@}" 1>&2
    exit 1
}

[ -d "${SRC}" ] || err "${SRC} is not a directory"
mkdir -p "${DEST}"

for releng in ${RELENGS}; do
    branch="releng/${releng}"
    echo "Fetching branch ${branch}" 1>&2
    git -C "${SRC}" fetch origin "${branch}" || err "Can't fetch ${branch}"
    git -C "${SRC}" checkout "${branch}" || err "Can't checkout ${branch}"
    source="${SRC}/share/mk/bsd.prog.mk"
    dest="${DEST}/bsd.prog.mk_${releng}"
    cp "${source}" "${dest}" && echo "${source} -> ${dest}" || \
        err "Can't cp(1) ${source} -> ${dest}"
    git -C "${SRC}" clean -fd  || err "Can't git-clean(1)"
done

Just run it with ./diff-bsd-prog-mk and it will put versions of bsd.prog.mk from every release into /tmp/bsd-prog-mks (it will take a while to jump between releases and download them). Now you can either examine the files yourself, or find a differences between releases you want using git-diff(1), e.g. if you want to know what's the difference between releases 1 and 2.0.5, run git diff --no-index bsd.prog.mk_1 bsd.prog.mk_2.0.5
 
Back
Top