diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-10-08 22:15:26 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-10-08 22:15:26 +0200 |
commit | 067ba4a39729f1e33b41c60c826274a4c4c38b8d (patch) | |
tree | 56afaa73b4535acb34b5aa55096f2b8b81439c5b /Makefile | |
parent | d6cc28665d2025afba1f3701a486927f0b3a51da (diff) |
Lib-ify
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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 $@ $< |