#import <Foundation/Foundation.h> int main (void) { NSLog (@"Executing"); return 0; }The function NSLog simply outputs the string to stderr, flushing the output before continuing. To compile this little program as a command line tool called LogTest, add in the same directory a file called GNUmakefile, with the following contents:
include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.makeAnd that's it. At this point, you have all the usual standard GNU make options: typically make, make clean, make install, make distclean. For example, typing make in the project directory should compile our little tool. It should create a single executable LogTest, and put it in the subdirectory
shared_obj/ix86/linux-gnu/gnu-gnu-gnu-xgps(or in a similar one, according to your system). To install the tool, simply type make install; you usually need to be root to install the tool on a system directory. If you want to have it installed in your own user GNUstep directory (eg, /home/nicola/GNUstep), which doesn't require you to be root and could be a better place for testing, you just need to add the line
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_USER_ROOT)after including common.make, as follows:
include $(GNUSTEP_MAKEFILES)/common.make GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_USER_ROOT) TOOL_NAME = LogTest LogTest_OBJC_FILES = source.m include $(GNUSTEP_MAKEFILES)/tool.makeI usually do this when testing my own code and programs, and it is very handy.