Created
September 6, 2018 13:12
-
-
Save sr6033/1d1ce94c4023d6377d74cd529d71c6d6 to your computer and use it in GitHub Desktop.
Makefile to compile & execute OpenGL programs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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