Skip to content

Instantly share code, notes, and snippets.

@JohnPeel
Last active August 29, 2015 14:01
Show Gist options
  • Save JohnPeel/11553809 to your computer and use it in GitHub Desktop.
Save JohnPeel/11553809 to your computer and use it in GitHub Desktop.
.PHONY: clean
CC = g++
CFLAGS = -Wall -fexceptions -std=c++11 -g
EXEC = lib$(notdir $(shell pwd)).a
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
$(EXEC): $(OBJECTS)
ar -Dcq $(EXEC) $(OBJECTS)
%.cpp: %.hpp
%.o: %.cpp Makefile
$(CC) -c $(CFLAGS) $< -o $@
clean:
rm -rf $(EXEC) $(OBJECTS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment