From 067ba4a39729f1e33b41c60c826274a4c4c38b8d Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 8 Oct 2016 22:15:26 +0200 Subject: Lib-ify --- Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5778290..87bf616 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,26 @@ 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 = main + +LIBNAME = cryptolib.a + .PHONY: all clean remake -all: $(BIN) +all: $(LIBNAME) clean: - rm -rf $(BIN) *.o *.dSYM + rm -rf $(LIBNAME) *.o remake: clean all -$(BIN): $(patsubst %.cpp,%.o,$(wildcard *.cpp)) - $(CXX) -o $@ $^ $(LDFLAGS) +$(LIBNAME): $(patsubst %.cpp,%.o,$(wildcard *.cpp)) + ar -cr $@ $^ %.o: %.cpp $(wildcard *.h) $(CXX) $(CXXFLAGS) -c -o $@ $< -- cgit v1.2.3-70-g09d2