# List source files (not headers!) and binary name: SOURCES=$(wildcard *.cc) BINARY=programname # Set up compiler and compiler options: CXX=g++ LD=g++ CXXFLAGS=-Wall -Wextra -pedantic -ansi -O3 LDFLAGS=-s LDLIBS= # --- No need to modify anything below this line --- all: dep $(BINARY) $(BINARY): $(SOURCES:.cc=.o) $(LD) $^ -o $@ $(LDFLAGS) $(LDLIBS) dep: g++ -MM $(SOURCES) > .dep -include .dep