Linux SDL/OpenGL
Does anyone have a Makefile for linux which creates an exe file? I need SDL, GL, and Glu included?
Thanks in advance.
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:
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement