12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- Description: Modify the main Makefile
- Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
- 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 <libusb.h>
- +#include <libusb-1.0/libusb.h>
- #include <cstdlib>
- #include <string.h>
- #include <string>
- --- a/src/usbhid/usbhid.h
- +++ b/src/usbhid/usbhid.h
- @@ -16,7 +16,7 @@
- #ifndef _USBHID_H_
- #define _USBHID_H_
-
- -#include <libusb.h>
- +#include <libusb-1.0/libusb.h>
-
-
- /** hidapi info structure */
|