Skip to content

Instantly share code, notes, and snippets.

@jarulsamy
Created September 30, 2019 15:26
Show Gist options
  • Save jarulsamy/78efec7cb17e2001635cd6f7602311b7 to your computer and use it in GitHub Desktop.
Save jarulsamy/78efec7cb17e2001635cd6f7602311b7 to your computer and use it in GitHub Desktop.
Sample Makefile for C++
# the compiler: gcc for C program, define as g++ for C++
CC = g++
CFLAGS = -g -Wall
# the build target executable:
TARGET = `NAME_OF_MAIN_FILE`
all: $(TARGET)
$(TARGET): $(TARGET).cpp
$(CC) $(CFLAGS) -o $(TARGET).out $(TARGET).cpp
clean:
$(RM) $(TARGET).out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment