Skip to content

Instantly share code, notes, and snippets.

@cdecl
Last active March 25, 2017 04:36
Show Gist options
  • Save cdecl/9c71c57f25ec426c6c55 to your computer and use it in GitHub Desktop.
Save cdecl/9c71c57f25ec426c6c55 to your computer and use it in GitHub Desktop.
CC = g++
CC_FLAGS = -std=c++11 -pedantic -Wall -O2
LD_LIBS =
EXEC = main
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
# Main target
$(EXEC): $(OBJECTS)
$(CC) $(OBJECTS) -o $(EXEC) $(LD_LIBS)
%.o: %.cpp
$(CC) -c $(CC_FLAGS) $< -o $@
clean:
rm -f $(EXEC) $(OBJECTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment