vdudouyt / stm8flash

program your stm8 devices with SWIM/stlinkv(1,2)
GNU General Public License v2.0
403 stars 183 forks source link

'make install' gives 'no permission' error on macOS #77

Closed fdx1601 closed 6 years ago

fdx1601 commented 7 years ago

on macOS "Sierra" 10.12.6 (16G29) the "make install" gives an error stating it has no permission to copy stm8flash:

localhost:stm8flash ts$ make install
mkdir -p /usr/bin/
cp stm8flash /usr/bin/
cp: /usr/bin/stm8flash: Operation not permitted
make: *** [install] Error 1

This error happens regardless if executed with normal user privileges or via sudo.

Adding a 'Darwin' condition to the install target in the Makefile resolves this issue:

$ git diff Makefile 
diff --git a/Makefile b/Makefile
index bc1a9c2..b74fc15 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,11 @@ install:
 ifeq ($(PLATFORM),FreeBSD)
        mkdir -p $(DESTDIR)/usr/local/bin/
        cp $(BIN)$(BIN_SUFFIX) $(DESTDIR)/usr/local/bin/
+else ifeq ($(PLATFORM),Darwin)
+       mkdir -p $(DESTDIR)/usr/local/bin/
+       cp $(BIN)$(BIN_SUFFIX) $(DESTDIR)/usr/local/bin/
 else
        mkdir -p $(DESTDIR)/usr/bin/
        cp $(BIN)$(BIN_SUFFIX) $(DESTDIR)/usr/bin/
 endif

Regards.

vbauer commented 6 years ago

+1 I have the same issue

spth commented 6 years ago

Isn't /usr/local/bin the conventional place on other OSes, such as GNU/Linux and OpenBSD anyway? Shouldn't we just make installation into /usr/local/bin/ the default for all OSes?

Philipp

spth commented 6 years ago

I now made /usr/local/bin/ the default install location for all platforms.

Philipp

vbauer commented 6 years ago

Now it works fine, thank you!