diff options
| author | David Lechner | 2020-02-12 17:17:09 -0600 |
|---|---|---|
| committer | Damien George | 2020-02-16 23:37:40 +1100 |
| commit | 4af79e76943312bf71be395a71fa80ab39e7c2c2 (patch) | |
| tree | 34b938d06ab5e34b4238ec7111087177b410dbcf | |
| parent | c5f4268c9955f08894fec78c1eeacf78f55256c4 (diff) | |
unix/Makefile: Allow to install all variants of the executable.
The install target is current broken when PROG is used to override the
default executable name. This fixes it by removing the redundant TARGET
variable and uses PROG directly instead.
The install and uninstall targets are also moved to the common unix
Makefile so that all variants can be installed in the same way.
| -rw-r--r-- | ports/unix/Makefile | 9 | ||||
| -rw-r--r-- | ports/unix/variants/standard/mpconfigvariant.mk | 13 |
2 files changed, 9 insertions, 13 deletions
diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 948cdd0c4..1e0a38ca2 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -248,3 +248,12 @@ axtls: $(TOP)/lib/axtls/README $(TOP)/lib/axtls/README: @echo "You cloned without --recursive, fetching submodules for you." (cd $(TOP); git submodule update --init --recursive) + +PREFIX = /usr/local +BINDIR = $(DESTDIR)$(PREFIX)/bin + +install: $(PROG) + install -D $(PROG) $(BINDIR)/$(PROG) + +uninstall: + -rm $(BINDIR)/$(PROG) diff --git a/ports/unix/variants/standard/mpconfigvariant.mk b/ports/unix/variants/standard/mpconfigvariant.mk index 6650c086f..cf3efab8a 100644 --- a/ports/unix/variants/standard/mpconfigvariant.mk +++ b/ports/unix/variants/standard/mpconfigvariant.mk @@ -1,16 +1,3 @@ # This is the default variant when you `make` the Unix port. PROG ?= micropython - -# install micropython in /usr/local/bin -TARGET = micropython -PREFIX = /usr/local -BINDIR = $(DESTDIR)$(PREFIX)/bin - -install: micropython - install -d $(BINDIR) - install $(TARGET) $(BINDIR)/$(TARGET) - -# uninstall micropython -uninstall: - -rm $(BINDIR)/$(TARGET) |
