Search code examples
objective-cgnustepgnu-make

How do I tell my GNUMakefile to link against a specific library?


My GNUMakefile is as follows:

include $(GNUSTEP_MAKEFILES)/common.make

APP_NAME = MyApp

MyApp_HEADER_FILES = src/objc/framework/Bug.h src/objc/framework/NSMutableArray+Shuffle.h src/objc/framework/World.h src/objc/framework/BugProtocol.h src/objc/domain/RandomBug.h 
MyApp_OBJC_FILES =  src/objc/framework/Bug.m src/objc/framework/World.m src/objc/framework/NSMutableArray+Shuffle.m src/objc/domain/RandomBug.m 

include $(GNUSTEP_MAKEFILES)/application.make

In my code I'm using arc4random, which means that I need to link against libbsd. How do I do that in my makefile?


Solution

  • I figured this out. I used ADDITIONAL_TOOL_LIBS:

    include $(GNUSTEP_MAKEFILES)/common.make
    
    APP_NAME = BhumiApp
    
    BhumiApp_HEADER_FILES = src/objc/framework/Bug.h src/objc/framework/NSMutableArray+Shuffle.h src/objc/framework/World.h src/objc/framework/BugProtocol.h src/objc/domain/RandomBug.h 
    BhumiApp_OBJC_FILES =  src/objc/framework/Bug.m src/objc/framework/World.m src/objc/framework/NSMutableArray+Shuffle.m src/objc/domain/RandomBug.m 
    ADDITIONAL_TOOL_LIBS = -l:libbsd.so.0
    
    include $(GNUSTEP_MAKEFILES)/application.make