Description: Modify the main Makefile Author: Christoph Biedl Date: 2017-01-13 Forwarded: no Last-Update: 2020-12-20 * Fix CUR_PATH definition * Use the build flags to make hardening build succeed * Provide an install target * Don't use the libusb.h code copy --- a/Makefile +++ b/Makefile @@ -21,24 +21,25 @@ COMPILE_FLAGS += $(addprefix -D, $(DEFINES)) -CUR_PATH = $(shell echo $(PWD)) +CUR_PATH = . INCLUDEPATHS = $(addprefix -I$(CUR_PATH)/, $(dir $(SOURCE_FULL)) libusb ) LOADPATHS = LIBS = -lusb-1.0 -CPP = g++ - + ykushcmd : $(PROG_OBJ) $(OBJS) - $(CPP) -o bin/$@ $(PROG_OBJ) $(OBJS) $(LIBS) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o bin/$@ $(PROG_OBJ) $(OBJS) $(LIBS) $(PROG_OBJ) : %.o : %.cpp - $(CPP) $(COMPILE_FLAGS) $(INCLUDEPATHS) -c $< -o $@ + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(COMPILE_FLAGS) $(INCLUDEPATHS) -c $< -o $@ $(OBJS) : %.o : %.cpp %.h - $(CPP) $(COMPILE_FLAGS) $(INCLUDEPATHS) -c $< -o $@ + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(COMPILE_FLAGS) $(INCLUDEPATHS) -c $< -o $@ clean : rm -f bin/yktrl $(OBJS) $(PROG_OBJ) +install: + install -D bin/ykushcmd $(DESTDIR)/usr/bin/ykushcmd --- a/src/usbhid/usbhid.cpp +++ b/src/usbhid/usbhid.cpp @@ -14,7 +14,7 @@ limitations under the License. *******************************************************************************/ #include "usbhid.h" -#include +#include #include #include #include --- a/src/usbhid/usbhid.h +++ b/src/usbhid/usbhid.h @@ -16,7 +16,7 @@ #ifndef _USBHID_H_ #define _USBHID_H_ -#include +#include /** hidapi info structure */