Linux SDL/OpenGL

Started by
1 comment, last by kRogue 17 years, 1 month ago
Does anyone have a Makefile for linux which creates an exe file? I need SDL, GL, and Glu included? Thanks in advance.
Advertisement
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.
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.

This topic is closed to new replies.

Advertisement