aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-10-08 22:15:26 +0200
committertomsmeding <tom.smeding@gmail.com>2016-10-08 22:15:26 +0200
commit067ba4a39729f1e33b41c60c826274a4c4c38b8d (patch)
tree56afaa73b4535acb34b5aa55096f2b8b81439c5b /Makefile
parentd6cc28665d2025afba1f3701a486927f0b3a51da (diff)
Lib-ify
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 7 insertions, 9 deletions
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 $@ $<