Skip to content

Instantly share code, notes, and snippets.

@candh
Last active February 27, 2019 16:04
Show Gist options
  • Save candh/ad3fd2126e6c1b1d4f4c92beb43c04cb to your computer and use it in GitHub Desktop.
Save candh/ad3fd2126e6c1b1d4f4c92beb43c04cb to your computer and use it in GitHub Desktop.
makefile for OpenGL projects in C for both Mac and Linux (Works with gcc versions >= 5.5 on linux. Tested on Ubuntu)
# candh
# set compiler
CC = gcc
MACFLAGS = -framework OpenGL -framework GLUT
LINFLAGS = -lGL -lGLU -lglut
TARGET = main
mac:
$(CC) $(MACFLAGS) -o $(TARGET) $(TARGET).c
linux:
$(CC) $(LINFLAGS) -o $(TARGET) $(TARGET).c
run:
./$(TARGET)
clean:
$(RM) $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment