Skip to content

Instantly share code, notes, and snippets.

@rbarzic
Created November 14, 2016 09:23
Show Gist options
  • Save rbarzic/3d41b5ae51874d78ec527d1da20fd542 to your computer and use it in GitHub Desktop.
Save rbarzic/3d41b5ae51874d78ec527d1da20fd542 to your computer and use it in GitHub Desktop.
Minimalist Makefile
CPP = g++
CPPFLAGS = -Wall -pedantic -O2 -g -c
SOURCES := ${wildcard *.cpp}
OBJECTS := ${SOURCES:.cpp=.o}
.PHONY: all clean
.SUFFIXES: .cpp .o
all: main
main: $(OBJECTS)
.cpp.o:
$(CPP) $(CPPFLAGS) $< -o $@
clean:
-rm -fv *.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment