mirror of
https://github.com/iustin/mt-st.git
synced 2026-01-08 04:55:16 +00:00
Allow installing the binaries under /usr/
This patch reworks the directory-related variables to allow
installation of binaries under `/usr/[s]bin`, instead of directly
under `/[s]bin`. It also allows installing the man pages under a
different prefix (e.g. `/usr/local`).
Example:
$ make install EXEC_PREFIX=/usr
will install binaries under `/usr/bin`, respectively `/usr/sbin`. A
full "local" installation under `/usr/local` is accomplished by:
$ make install EXEC_PREFIX=/usr/local PREFIX=/usr/local
This patch points once again that an autoconf/automake conversion
would make a lot of sense…
Closes #3. Additionally, it fixes a previous bug with installation of
the manual pages.
This commit is contained in:
16
Makefile
16
Makefile
@@ -1,12 +1,12 @@
|
||||
CFLAGS?= -Wall -O2
|
||||
SBINDIR= $(DESTDIR)/sbin
|
||||
BINDIR= $(DESTDIR)/bin
|
||||
USRBINDIR= $(DESTDIR)/usr/bin
|
||||
MANDIR= $(DESTDIR)/usr/share/man
|
||||
PREFIX?= /usr
|
||||
EXEC_PREFIX?= /
|
||||
SBINDIR= $(DESTDIR)/$(EXEC_PREFIX)/sbin
|
||||
BINDIR= $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||
DATAROOTDIR= $(DESTDIR)/$(PREFIX)/share
|
||||
MANDIR= $(DATAROOTDIR)/man
|
||||
DEFTAPE?= /dev/tape
|
||||
|
||||
MTDIR=$(BINDIR)
|
||||
|
||||
PROGS=mt stinit
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ version.h: Makefile
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DDEFTAPE='"$(DEFTAPE)"' -o $@ $<
|
||||
|
||||
install: $(PROGS)
|
||||
install -d $(MTDIR) $(MANDIR) $(SBINDIR)
|
||||
install -s mt $(MTDIR)
|
||||
install -d $(BINDIR) $(SBINDIR) $(MANDIR) $(MANDIR)/man1 $(MANDIR)/man8
|
||||
install -s mt $(BINDIR)
|
||||
install -c -m 444 mt.1 $(MANDIR)/man1
|
||||
(if [ -f $(MANDIR)/man1/mt.1.gz ] ; then \
|
||||
rm -f $(MANDIR)/man1/mt.1.gz; gzip $(MANDIR)/man1/mt.1; fi)
|
||||
|
||||
Reference in New Issue
Block a user