orangepi-xunlong / wiringOP

wiringPi for Orange Pi
GNU Lesser General Public License v3.0
415 stars 192 forks source link

`cp gpio /usr/local/bin` in Makefile? #14

Closed 2i3r closed 4 years ago

2i3r commented 4 years ago

Today I just build wiringOP for Orange Pi lite to test it out. build command ended with:

.
.
.
GPIO Utility
[Compile] gpio.c
[Compile] readall.c
[Compile] OrangePi.c
[Link]
[Install]
chown: cannot access '/usr/local/bin/gpio': Not a directory
make: *** [Makefile:211: install] Error 1

then I checked and findout my /usr/local/bin directory has been replaced with a executable file.

~/wiringOP$ file /usr/local/bin
/usr/local/bin: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=bcc011c726f62c44f2ac6e89a53c166080131be6, not stripped

further investigation shown, there is a bug in gpio/Makefile line 210 which replace /usr/loca/bin/ with gpio binary which just compiled.

.
.
.
install: gpio
        $Q echo "[Install]"
        $Q cp gpio              $(DESTDIR)$(PREFIX)/bin
ifneq ($(WIRINGPI_SUID),0)
.
.
.

and symptoms also prove this:

~/wiringOP$ md5sum gpio/gpio /usr/local/bin
2e1fe3bab8acb83bd1d7c0d95ac4182e  gpio/gpio
2e1fe3bab8acb83bd1d7c0d95ac4182e  /usr/local/bin