By default a MaxMSP XCode Project must live in cnmat/trunk/max/(dir1)/(dir2)/(dir3) so that the relative path "../../../makefile.per-object" points to the shared makefile. Typically this relative path "../../../" is also used in the XCode build settings to locate the relevant c74support directory and its header files.

It is possible to change this location by setting the environment variable, CNMAT_MAX_DIR. This variable can be set in the Makefile, but it is more portable to use the user environment. To set the variable for the shell, for example, add the following to ~/.bash_profile:

export CNMAT_MAX_DIR="/Users/myhome/Projects/cnmat/trunk/max"

Then set Makefile to the following:

include $(CNMAT_MAX_DIR)/makefile.per-object

After restarting Terminal, it will be possible to invoke 'make' from the command line and have the object compile properly. It can also be released into the CNMAT downloads page using the macho-release target.

However this environment variable is not seen by XCode because XCode does not live in the bash shell. To add the environment variable to *ALL* contexts for the current user, run the following command in Terminal:

defaults write ~/.MacOSX/environment CNMAT_MAX_DIR -string "~/Projects/cnmat/trunk/max";
plutil -convert xml1 ~/.MacOSX/environment.plist

Logout and login again for this change to apply.