1

I'm trying to build hello world on Objective-C on Linux (Ubuntu). main.c

#import <Foundation/Foundation.h>

int main(void)
{

    NSLog(@"asdasd");  
    return 0;
}

I don't think there is the error here. Then i'd created Makefile:

GNUSTEP_MAKEFILES = /usr/share/GNUstep/Makefiles

include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = main
main_OBJC_FILES = main.m
include $(GNUSTEP_MAKEFILES)/tool.make

And then i run "make":

This is gnustep-make 2.2.0. Type 'make print-gnustep-make-help' for help.
Making all for tool main...
make[1]: GNUmakefile: no such file or directory

How can i fix it ?

Deck
  • 1,969
  • 4
  • 20
  • 41

1 Answers1

5

Installing the GNUstep libraries and tools on an Ubuntu system is simple, just sudo apt-get install gnustep gnustep-devel and you're all set (seriously, Apt is, as far as I know, the easiest way to install software - as long as it's in the repositories). Turns out I had named it GNUMakefile, while I should have named it GNUmakefile.

source.m:

#import <Foundation/Foundation.h>
int main(void)
{
    NSLog(@"asdasd");  
    return 0;
}

GNUmakefile:

GNUSTEP_MAKEFILES = /usr/share/GNUstep/Makefiles

include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = app
app_OBJC_FILES = source.m
include $(GNUSTEP_MAKEFILES)/tool.make

And I can run it.

us@com:~/ObjectiveC$ make
This is gnustep-make 2.6.0. Type 'make print-gnustep-make-help' for help.
Making all for tool app...
 Compiling file source.m ...
 Linking tool app ...

us@com:~/ObjectiveC$ ./obj/app
2011-11-22 18:01:21.285 app[8042] asdasd
Blaisorblade
  • 6,438
  • 1
  • 43
  • 76
user_
  • 66
  • 1
  • 2