Jump to content
  • Advertisement
Sign in to follow this  
Phoresis

OpenGL Linux SDL/OpenGL

This topic is 4130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone have a Makefile for linux which creates an exe file? I need SDL, GL, and Glu included? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Roughly it would be:


CC = gcc
SOURCE = main.c
LIBS = -L/usr/local/lib -lGL -lGLU -lSDL
BINARY = main

all:
$(CC) $(SOURCE) -o $(BINARY) $(LIBS)

clean:
@echo Cleaning up...
@rm $(BINARY)
@echo Done.

Share this post


Link to post
Share on other sites
I would do:


CC=gcc
CFLAGS=`sdl-config --cflags`
LIBS= `sdl-config --cflags --libs` -lGL -lGLU
SOURCE = main.c
BINARY = main

all:
$(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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!