[Gllug] Makefile for OpenGL / GLUT

Andy Millar andy at andymillar.co.uk
Thu Jul 17 19:07:54 UTC 2008


%{LIBPATH}?
---
Andy Millar

t: +44 (0) 845 862 0268
e: andy at andymillar.co.uk

-----Original Message-----
From: Henry Gilbert <henry.gilbert at gmail.com>
Sent: 17 July 2008 19:59
To: Greater London Linux User Group <gllug at gllug.org.uk>
Subject: [Gllug] Makefile for OpenGL / GLUT

Hi,

I've been trying to compile some OpenGL exercises in Linux, but the
Makefile code offered by the book doesn't quite work:


INCPATH = -I/usr/X11R6/include/
LIBS = -lglut -lGLU -lGL -lm -lpthread
LIBPATH = -L/usr/lib /usr/X11R6/lib/
%:%.c
	gcc $(INCPATH) $(LIBPATH) $^ $(LIBS) -o $@
%:%.cpp
	g++ $(INCPATH) %(LIBPATH) $^ $(LIBS) -o $@


But when I type a full compilation command:

g++ -o Example Example.cpp -I /usr/X11R6/include/ -L /usr/X11R6/lib/
-lglut -lGL -lGLU -lX11 -lXmu -lXi -lm

That works fine.

Would anyone know how to edit the Makefile to make 'make' work instead?

kind regards

Henry Gilbert




--
SEO Mastery
http://www.alliancetec.com
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list