yellowman / nsh

OpenBSD networking configuration shell
http://www.nmedia.net/nsh/
Other
177 stars 27 forks source link

tweak nsh Makefile to support release and development builds #129

Closed stspdotname closed 1 year ago

stspdotname commented 1 year ago

The default 'make' target now behaves differently depending on whether we are building from the Git repository or from a release tarball.

Data in nsh-version.mk controls the nsh version number (to be increased manually as needed) and the build type. In a distribution tarball the file nsh-version.mk will always contain NSH_RELEASE=Yes, which ensures that the default 'make' target will compile a release-style build out of the box.

Builds from the Git repository now always contain debug symbols and are compiled without any compiler optimization flags, for proper backtracing and easy access to values of variables in gdb. Unlike release builds the debug builds report the suffix "-current" in their version number.

Add a 'make release' target which generates a source distribution of nsh source code for consumption by the OpenBSD ports tree. This target uses the new files nsh-dist.txt and nsh-version.mk.

When running 'make release' no uncommitted changes must exist in the work tree, and no unknown/unversioned files must be present, apart from any build artifacts removed by 'make clean'.

The nsh-dist.txt file provides a sanity check for files included in the release tarball. If the list of packaged files changes then differences will be displayed, which must be reconciled by adding or removing lines from nsh-dist.txt as appropriate or by making sure that build artifacts or other temporary files are properly cleaned up by 'make clean' to prevent them from appearing in the distribution. The 'make release' must then be run again after removing the botched release tarball from disk and committing any local changes to nsh-dist.txt.

smytht commented 1 year ago

This Makes Sense OK Tom