Skip to content

Instantly share code, notes, and snippets.

@sr6033
Created September 6, 2018 13:12
Show Gist options
  • Select an option

  • Save sr6033/1d1ce94c4023d6377d74cd529d71c6d6 to your computer and use it in GitHub Desktop.

Select an option

Save sr6033/1d1ce94c4023d6377d74cd529d71c6d6 to your computer and use it in GitHub Desktop.
Makefile to compile & execute OpenGL programs
# FILE specifies which files to compile as part of the project
FILE = main.cpp
# CC specifies which compiler we're using
CC = g++ -std=c++11
# COMPILER_FLAGS specifies the additional compilation options we're using
# -Wall will turn on all standard warnings
COMPILER_FLAGS = -Wall
# LINKER_FLAGS specifies the libraries we're linking against
LINKER_FLAGS = -lGL -lGLU -lglut -lGLEW -lglfw -lX11 -lXxf86vm -lXrandr -lpthread -lXi -ldl -lXinerama -lXcursor
# OBJ_NAME specifies the name of our exectuable
NAME = main
#This is the target that compiles our executable
all: $(FILE)
$(CC) $(FILE) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(NAME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment