-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (30 loc) · 843 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CXX=g++
CXXFLAGS=-std=c++11 -Wall -Wextra -pedantic
INCLUDE=-I./include -I./lib
OBJS=build/test.o build/test_ciphers.o build/ciphers.o
LIB=bin/libCrypt.a
TEST=bin/test
all: build/ciphers.o test
@echo Archiving library...
ar rcs $(LIB) $<
build/ciphers.o: src/ciphers.cpp include/Crypt/ciphers.hpp
@echo Compiling library...
$(CXX) -o $@ -c $< $(CXXFLAGS) $(INCLUDE)
# rule for building tests executable
$(TEST): $(OBJS)
@echo Building tests executable...
@$(CXX) -o $@ $^ $(CXXFLAGS) $(INCLUDE)
# rule for building tests
build/%.o: test/%.cpp
$(CXX) -o $@ -c $^ -DTEST=1 $(CXXFLAGS) $(INCLUDE)
.PHONY: clean test _test lib
# clean using platform specific del/rm command
clean:
@echo Cleaning up object files...
del build\\*.o
test: _test $(TEST)
@echo Running tests...
@$(TEST)
_test:
@echo Compiling tests...
lib: $(LIB)