Last active
July 9, 2018 07:54
-
-
Save VeggieVampire/b7cade7f3d95d6b99a01748eabe9cff4 to your computer and use it in GitHub Desktop.
Basic Perfect Makefile for compiling target .cpp files using g++.
This file contains 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
Basic Perfect Makefile for compiling target .cpp files with SDL2 libraries using g++. | |
#USEAGE: copy Makefile to folder with .cpp files then type "make" | |
#OBJS specifies which files to compile as part of the project | |
OBJS = $(wildcard *.cpp) | |
#CC specifies which compiler we're using | |
CC = g++ | |
#COMPILER_FLAGS specifies the additional compilation options we're using | |
# -w suppresses all warnings | |
COMPILER_FLAGS = -w | |
#LINKER_FLAGS specifies the libraries we're linking against | |
LINKER_FLAGS = -lSDL2 -lSDL2_image | |
#OBJ_NAME specifies the name of our exectuable | |
OBJ_NAME = $(patsubst %.cpp,%,$(wildcard *.cpp)) | |
#This is the target that compiles our executable | |
all : $(OBJS) | |
$(CC) $(OBJS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested on raspberry pi.