CXX = g++ CXXFLAGS = -Wall -Wextra -std=c++0x -fwrapv LDFLAGS = ifneq ($(DEBUG),) CXXFLAGS += -g else CXXFLAGS += -O2 endif ifeq ($(shell uname),Linux) LDFLAGS += -lbsd endif BIN = envelope .PHONY: all clean remake all: $(BIN) clean: rm -rf $(BIN) *.o *.dSYM remake: clean all $(BIN): $(patsubst %.cpp,%.o,$(wildcard *.cpp)) ../cryptolib.a $(CXX) -o $@ $^ $(LDFLAGS) %.o: %.cpp $(wildcard *.h) $(CXX) $(CXXFLAGS) -c -o $@ $<