good Makefile

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

good Makefile

Post by Guest »

Hi!
im currently trying to make a good makefile thats small and not too bloated.

here is what i got so far, and this works very good (only example application to test it):

Code: Select all

CPP	= g++
APP	= framework

OBJ	= main.cpp IGame.cpp

LINKOBJ	= main.o IGame.o
FLAGS	= -fexpensive-optimizations -O3 -pipe -g3
DIRS	= -L"../irrlicht-0.10.0/lib/Linux" -I"../irrlicht-0.10.0/include" -I"/usr/X11R6/include" -L"/usr/X11R6/lib"
DEPS	= -lIrrlicht -lGL -lXxf86vm -lXext -lX11




all:

	$(CPP) -c $(OBJ) $(DIRS) $(DEPS) $(FLAGS)
	$(CPP) $(LINKOBJ) -o $(APP) $(DIRS) $(DEPS) $(FLAGS)

run:
	clear;make -s;clear;./$(APP);clear

clean:
	rm -r $(LINKOBJ) $(APP)

is this good or do you have any optimizations?

ps: is there a way to make "make" quiet? i dont want to see the damn output everytime i compile it, something like "compiling..." should be enough :) (warnings or errors should appear though)

i'll have a look at the manpages, maybe they help - cheers! :D
Last edited by Guest on Tue Jun 14, 2005 1:27 pm, edited 1 time in total.
Guest

Post by Guest »

just found the solution to make it quiet:

Code: Select all

run:
clear;make -s;clear;./$(APP);clear
then just type "make run" and everything compiles and runs nicely without flooding the terminal, thats how i like it :) yeah
schick
Posts: 230
Joined: Tue Oct 07, 2003 3:55 pm
Location: Germany
Contact:

Post by schick »

I suggest you wan to have a look at cMake. It is a easy to use Makefile (or project file) generator. I use it :-).

scons could also help you. As i know the Doom3 linux port uses it as build system.
Please send me an e-mail instead of a private message.
Post Reply