diff options
author | Josh Stone <cuviper@gmail.com> | 2015-05-15 12:06:38 -0700 |
---|---|---|
committer | Josh Stone <cuviper@gmail.com> | 2015-05-15 12:06:38 -0700 |
commit | be82ac2cb0cb4a8695f6baebadb0e3e7f5b87b10 (patch) | |
tree | 33f0627bc64a6330d5a3d045511b0603ff38a414 | |
parent | 4e38dcab448f054d82a346e3c9d21ac78516a416 (diff) | |
download | rust-hoedown-be82ac2cb0cb4a8695f6baebadb0e3e7f5b87b10.tar.gz |
Support overrides for bin, lib, and include
Usually bin and include are the same, but for instance lib may want to be
lib64 on Red Hat distros. Add BINDIR, LIBDIR, and INCLUDEDIR variables
that can be overridden on the command line.
This commit also tweaks the way the libraries are installed, dropping
execute privileges on libhoedown.a, and making sure libhoedown.so is
installed as a symlink. (The install command doesn't preserve symlinks.)
-rw-r--r-- | Makefile | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -1,5 +1,8 @@ CFLAGS = -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter PREFIX = /usr/local +BINDIR = $(PREFIX)/bin +LIBDIR = $(PREFIX)/lib +INCLUDEDIR = $(PREFIX)/include HOEDOWN_CFLAGS = $(CFLAGS) -Isrc ifneq ($(OS),Windows_NT) @@ -64,16 +67,19 @@ clean: # Installing install: - install -m755 -d $(DESTDIR)$(PREFIX)/lib - install -m755 -d $(DESTDIR)$(PREFIX)/bin - install -m755 -d $(DESTDIR)$(PREFIX)/include + install -m755 -d $(DESTDIR)$(LIBDIR) + install -m755 -d $(DESTDIR)$(BINDIR) + install -m755 -d $(DESTDIR)$(INCLUDEDIR) - install -m644 libhoedown.* $(DESTDIR)$(PREFIX)/lib - install -m755 hoedown $(DESTDIR)$(PREFIX)/bin - install -m755 smartypants $(DESTDIR)$(PREFIX)/bin + install -m644 libhoedown.a $(DESTDIR)$(LIBDIR) + install -m755 libhoedown.so.3 $(DESTDIR)$(LIBDIR) + ln -f -s libhoedown.so.3 $(DESTDIR)$(LIBDIR)/libhoedown.so - install -m755 -d $(DESTDIR)$(PREFIX)/include/hoedown - install -m644 src/*.h $(DESTDIR)$(PREFIX)/include/hoedown + install -m755 hoedown $(DESTDIR)$(BINDIR) + install -m755 smartypants $(DESTDIR)$(BINDIR) + + install -m755 -d $(DESTDIR)$(INCLUDEDIR)/hoedown + install -m644 src/*.h $(DESTDIR)$(INCLUDEDIR)/hoedown # Generic object compilations |