Hints and tips for working with the GNUstep developer tools and frameworks.
Codesigning macOS apps with GNUstep-make
GNUstep-make adds a stamp file (for example, stamp.make) inside the .app bundle directory, for internal dependency tracking. The macOS codesign tool rejects bundles containing unexpected files, so the stamp file must be removed before you sign your app.
Use a GNUstep-make hook to remove the stamp file before signing, for example, in a before-install:: hook.
GNUstep make and NEEDS_GUI
By default, GNUstep make encodes assumptions about whether it should link your target to the GUI framework (libs-gui on most platforms, AppKit on macOS). The default is yes for apps, and no for frameworks, libraries, and tools.
To change this, modify your GNUmakefile to set one of these variables to either yes or no:
NEEDS_GUI: applies to all targets in theGNUmakefile.[product_name]_NEEDS_GUI: applies to the specific product. For example, if your tool is calledMyTool, and it needs to link to the GUI framework, setMyTool_NEEDS_GUI = yes.
GNUstep-make hooks
GNUstep-make provides various double-colon rules that define integration points where you can run your own processes before, during, and after GNUstep-make actions.
For example, you can run additional steps after you build your app by defining after_$(GNUSTEP_INSTANCE)_all:: (where $(GNUSTEP_INSTANCE) is the name of your app), or supply the commands to run your tests when someone runs make check by defining internal-check::.
Global Hooks
These hooks are defined in Master/rules.make and apply to the entire build process:
Set GNUSTEP_MAKEFILES
GNUstep-make resolves the files it includes relative to the GNUSTEP_MAKEFILES environment variable. Often, the value of this is /Library/GNUstep/Makefiles, but you can set it correctly by running this command:
% export GNUSTEP_MAKEFILES=`gnustep-config --var=GNUSTEP_MAKEFILES`
If you get build errors about missing /common.make, it’s because you didn’t set this variable.
The other way to set it is to source the GNUstep.sh script (or GNUstep.csh on C-style shells like tcsh), but as this script is inside the GNUSTEP_MAKEFILES folder this isn’t a good way to discover the location. You source the script in a .rc or .profile file.