How do I use -l in makefiles to link to frameworks?
How do I use -l in makefiles to link to frameworks?
- Subject: How do I use -l in makefiles to link to frameworks?
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Mon, 28 Jun 2004 13:25:46 -0400
- Thread-topic: xcode-users digest, Vol 1 #482 - 6 msgs
I've been teaching myself how to use OpenGL, and have been trying to get the code to compile using the command line tools. The makefile for compiling the code is extremely simple; I've attached it below (it is from the code supplied at http://www.cs.unm.edu/~angel/BOOK/PRIMER/SECOND_EDITION/PROGRAMS/ if anyone is interested) but have run into the problem of specifying the libraries for the makefile. The problem is that GLUT is supplied as a framework; this makes it much easier to package and use from XCode and other IDEs, but I have no idea how to properly use them in a makefile.
Note that I can easily convert all of this to work under XCode, but I want to know how to use the command line tools to link to frameworks.
# This sample Makefile allows you to make an OpenGL application
# whose source is exactly one .c file.
#
#
# To use this Makefile, you type:
#
# make xxxx
#
# where
# xxxx.c is the name of the file you wish to compile
#
# A binary named xxxx will be produced
# Libraries are assumed to be in the default search paths
# as are any required include files
#
# For linux replace the next line with
# CC = gcc
# and you may have to add -L/usr/X11R6/lib to LDLIBS
CC = cc
LDLIBS = -lglut -lGL -lGLU -lXmu -lX11 -lm
.c:
$(CC) $@.c $(LDLIBS) -o $@
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.