From 91103f59acf807095a7bb1f4dff7e0efe5a455f1 Mon Sep 17 00:00:00 2001 From: Chris Couzens Date: Sun, 3 Jul 2022 23:37:39 +0100 Subject: [PATCH 1/2] Set executable bit on Linux build.sh So it can be easily run. --- src/linux/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/linux/build.sh diff --git a/src/linux/build.sh b/src/linux/build.sh old mode 100644 new mode 100755 From 0a27e4f88cb8d8c7c277be6e2f24ce94f2dd012d Mon Sep 17 00:00:00 2001 From: Chris Couzens Date: Sun, 3 Jul 2022 23:41:40 +0100 Subject: [PATCH 2/2] Place the executable in the destination immediately Before when it copied, it didn't copy the executable bit. Therefore adding the executable bit was a second step. GCC puts it on by default, so having gcc build it in the right directory ensures the binary has the executable bit. --- src/linux/build.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/linux/build.sh b/src/linux/build.sh index 2a3a951..7627d98 100755 --- a/src/linux/build.sh +++ b/src/linux/build.sh @@ -1,5 +1 @@ -gcc -Wall -std=c99 -I/usr/include/libusb-1.0 -I.. -o usbhidtool ../main.c hid.c -lusb-1.0 -lrt -lpthread - -cp usbhidtool ../../bin/linux/usbhidtool - -rm -f usbhidtool +gcc -Wall -std=c99 -I/usr/include/libusb-1.0 -I.. -o ../../bin/linux/usbhidtool ../main.c hid.c -lusb-1.0 -lrt -lpthread