From 3bb6c38ed17c2cf0d2f68bb64fbd24737c4a6677 Mon Sep 17 00:00:00 2001 From: Mateusz Zalega Date: Thu, 22 Oct 2015 23:07:23 +0200 Subject: Minor fixes, working version --- Makefile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e98e631..fb3d369 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,14 @@ INCLUDE = -Iinclude/ LIB = -lhidapi-libusb BUILD = build -CXXFLAGS = -std=c++14 +CXXFLAGS = -std=c++14 -fPIC +SOFLAGS = -shared CXXSOURCES = $(wildcard *.cc) -OBJ = $(CXXSOURCES:%.cc:$(BUILD)/%.o) +OBJ = $(CXXSOURCES:%.cc=$(BUILD)/%.o) $(BUILD)/libnitrokey.so: $(OBJ) - $(CXX) -shared $(OBJ) -o $@ + $(CXX) $(SOFLAGS) $(OBJ) -o $@ $(BUILD)/%.o: %.cc $(CXX) -c $< -o $@ $(INCLUDE) $(CXXFLAGS) @@ -20,12 +21,17 @@ $(BUILD)/%.o: %.cc all: $(OBJ) $(BUILD)/libnitrokey.so clean: - rm $(OBJ) - rm $(BUILD)/libnitrokey.so + rm -f $(OBJ) + rm -f $(BUILD)/libnitrokey.so + make -C unittest clean mrproper: clean - rm $(BUILD)/*.d + rm -f $(BUILD)/*.d -.PHONY: all clean mrproper +unittest: all + make -C unittest + cd unittest/build && ln -fs ../../build/libnitrokey.so . + +.PHONY: all clean mrproper unittest include $(wildcard build/*.d) -- cgit v1.2.3