Skip to content

Instantly share code, notes, and snippets.

@Chabam
Created April 12, 2020 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chabam/74f165bce55f41458e5724ab1468f142 to your computer and use it in GitHub Desktop.
Save Chabam/74f165bce55f41458e5724ab1468f142 to your computer and use it in GitHub Desktop.
A standard MakeFile template for Clang (or other compilers)
CC = clang
STD_LIBS = -lstdc++
LIBS = $(STD_LIBS)
FLAGS = -std=c++17 -g -Wall -Wextra -Werror $(LIBS) -o
BUILD_DIR = ./bin
SRC_DIR = ./src
INCLUDE = $(SRC_DIR)/main.cpp
EXEC = exec
all:
$(CC) $(INCLUDE) $(FLAGS) $(BUILD_DIR)/$(EXEC)
clean:
rm $(BUILD_DIR)/*
install:
cp $(BUILD_DIR)/$(EXEC) /bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment