aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: e98e631d7485694f718d5d276f478f0375f70e90 (plain)
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
CC  = $(PREFIX)-gcc
CXX = $(PREFIX)-g++
LD = $(CXX)

INCLUDE = -Iinclude/
LIB = -lhidapi-libusb
BUILD = build

CXXFLAGS = -std=c++14

CXXSOURCES = $(wildcard *.cc)
OBJ = $(CXXSOURCES:%.cc:$(BUILD)/%.o)

$(BUILD)/libnitrokey.so: $(OBJ)
	$(CXX) -shared $(OBJ) -o $@

$(BUILD)/%.o: %.cc
	$(CXX) -c $< -o $@ $(INCLUDE) $(CXXFLAGS)

all: $(OBJ) $(BUILD)/libnitrokey.so

clean:
	rm $(OBJ)
	rm $(BUILD)/libnitrokey.so

mrproper: clean
	rm $(BUILD)/*.d

.PHONY: all clean mrproper

include $(wildcard build/*.d)