Page 1 of 1

Building an OpenGL project from Makefile

Posted: Sat Oct 20, 2012 7:00 am
by mikeglaz
I'm learning OpenGL. I know how to make my program in the Terminal using a Makefile. But how would I have CodeLite invoke my Makefile or otherwise where would I need to put certain flags from my Makefile?

Here's my Makefile:

Code: Select all

objects = Asteroid.o Bullet.o main.o Projectile.o Ship.o

asteroids: $(objects)
	g++ -o asteroids $(objects) -lX11 -lXi -lglut -lGL -lGLU -lm
	
Asteroid.o: Asteroid.cpp
	g++ -c Asteroid.cpp

bullet.o: Bullet.cpp
	g++ -c Bullet.cpp

main.o: main.cpp
	g++ -c main.cpp

Projectile.o: Projectile.cpp
	g++ -c Projectile.cpp

ship.o: Ship.cpp
	g++ -c Ship.cpp

clean:
	rm asteroids Asteroid.o Bullet.o main.o Projectile.o Ship.o

Re: Building an OpenGL project from Makefile

Posted: Sat Oct 20, 2012 8:48 am
by mikeglaz
Nevermind, I figured it out :)