aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMateusz Zalega <mateusz@appliedsourcery.com>2015-10-22 22:41:18 +0200
committerMateusz Zalega <mateusz@appliedsourcery.com>2015-10-22 22:41:18 +0200
commitc4aec144256e3f27fedd8f8de03e10cc08eecab8 (patch)
treee7dda787a0f98be420499a3c60f7a821d75ad60c /Makefile
downloadlibnitrokey-c4aec144256e3f27fedd8f8de03e10cc08eecab8.tar.gz
libnitrokey-c4aec144256e3f27fedd8f8de03e10cc08eecab8.tar.bz2
Initial
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e98e631
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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)