aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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 $@ $<