1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- Description: Several changes to make the build succeed
- Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
- * Use hidapi-libusb provided by Debian
- * Use the build flags to make hardening build succeed
- * Provide an install target
- * Don't abort from failing "make clean"
- --- a/Makefile
- +++ b/Makefile
- @@ -1,23 +1,21 @@
- -CUR_PATH = $(shell echo $(PWD))
- OBJS = $(addprefix ykushcmd/objs/,ykushcmd.o commandParser.o usbcom.o)
- -LIBS = -lhidapi-libusb -lusb-1.0 -ludev
- -LOADPATHS = -L$(CUR_PATH)/ykushcmd/linux
- -PREPROCESSOR_DEFS = -DLINUX
- -CPP = g++
- +LIBS = -lhidapi-libusb
-
- -ykushcmd : $(OBJS)
- - $(CPP) $(LOADPATHS) -o bin/ykushcmd $(OBJS) $(LIBS)
- +bin/ykushcmd : $(OBJS)
- + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o bin/ykushcmd $(OBJS) $(LIBS)
-
-
- ykushcmd/objs/ykushcmd.o : ykushcmd/ykushcmd.cpp ykushcmd/commandParser.h
- - $(CPP) $(PREPROCESSOR_DEFS) -c ykushcmd/ykushcmd.cpp -o ykushcmd/objs/ykushcmd.o
- + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -c ykushcmd/ykushcmd.cpp -o ykushcmd/objs/ykushcmd.o
-
- -ykushcmd/objs/commandParser.o : ykushcmd/commandParser.cpp ykushcmd/commandParser.h ykushcmd/usbcom.h
- - $(CPP) $(PREPROCESSOR_DEFS) -c ykushcmd/commandParser.cpp -o ykushcmd/objs/commandParser.o
- +ykushcmd/objs/commandParser.o : ykushcmd/commandParser.cpp ykushcmd/commandParser.h ykushcmd/usbcom.h
- + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -c ykushcmd/commandParser.cpp -o ykushcmd/objs/commandParser.o
-
- -ykushcmd/objs/usbcom.o : ykushcmd/usbcom.cpp ykushcmd/linux/hidapi.h ykushcmd/usbcom.h
- - $(CPP) $(PREPROCESSOR_DEFS) -c ykushcmd/usbcom.cpp -o ykushcmd/objs/usbcom.o
- +ykushcmd/objs/usbcom.o : ykushcmd/usbcom.cpp ykushcmd/usbcom.h
- + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -c ykushcmd/usbcom.cpp -o ykushcmd/objs/usbcom.o
-
- clean :
- - rm -f bin/ykushcmd $(OBJS)
- + -rm -f bin/ykushcmd $(OBJS)
-
- +install:
- + install -D bin/ykushcmd $(DESTDIR)/usr/bin/ykushcmd
- --- a/ykushcmd/usbcom.cpp
- +++ b/ykushcmd/usbcom.cpp
- @@ -59,7 +59,7 @@
- #ifndef LINUX
- #include "windows\hidapi.h"
- #else
- - #include "linux/hidapi.h"
- + #include <hidapi/hidapi.h>
- #endif
-
- #include "usbcom.h"
|