Skip to content

Instantly share code, notes, and snippets.

@injust90
Created November 28, 2022 22:10
Show Gist options
  • Save injust90/6ffd750016ec2fcd3a39be66ecbb4a7d to your computer and use it in GitHub Desktop.
Save injust90/6ffd750016ec2fcd3a39be66ecbb4a7d to your computer and use it in GitHub Desktop.
Makefile template
# OBJS declares the files to be compiled
OBJS = Main.cpp Game.cpp
# CC declares the compiler (GCC)
CC = g++
# COMPILER_FLAGS declares the additional compilation options
# -w suppresses warnings
COMPILER_FLAGS = -w
# LINKER_FLAGS declares the libraries we are linking against
LINKER_FLAGS = -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer
#OBJ_NAME declares the name of our executable
OBJ_NAME = mainexe
# The target that compiles are 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