Skip to main content
GameDev.net gamedev.net
🔒 Locked

Linux SDL/OpenGL

Started by Phoresis Mar 2, 2007 at 8:30 AM 1 replies 600+ views
Original Post
Phoresis
Phoresis
Does anyone have a Makefile for linux which creates an exe file? I need SDL, GL, and Glu included? Thanks in advance.
rotalever
rotalever
Roughly it would be:

CC = gccSOURCE = main.cLIBS = -L/usr/local/lib -lGL -lGLU -lSDL BINARY = mainall:	$(CC) $(SOURCE) -o $(BINARY) $(LIBS)clean:	@echo Cleaning up...	@rm $(BINARY)	@echo Done.
kRogue
kRogue
I would do:

CC=gccCFLAGS=`sdl-config --cflags` LIBS= `sdl-config --cflags --libs` -lGL -lGLUSOURCE = main.cBINARY = mainall:	$(CC) $(CFLAGS) $(SOURCE) -o $(BINARY) $(LIBS)clean:	@echo Cleaning up...	@rm $(BINARY)	@echo Done.


note that in Linux, executables are not tagged by having a .exe extension. It is usually best to use sdl-config --cflags and sdl-config --cflags --libs because that way the same switches will work on other platforms (my codebase has the exact same make file and source for Windows and Linux) and that was posible by using sdl-config.

Close this Gamedev account, I have outgrown Gamedev.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.