summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Mendez <me@jmendeth.com>2014-11-04 07:20:16 +0100
committerXavier Mendez <me@jmendeth.com>2014-11-04 07:20:16 +0100
commit5aa09e2db82b1ff47c2f6d06a5586bbfbafdeb70 (patch)
tree7f48cc835aba96f4e72a6848c812bd6fc2897b8f
parent4898a1e494c24340992d77dab93245d9ec22cf83 (diff)
downloadrust-hoedown-5aa09e2db82b1ff47c2f6d06a5586bbfbafdeb70.tar.gz
Simple install target
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ae5f92c..38ab431 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,6 @@
CFLAGS = -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -Isrc
+PREFIX ?= /usr/local
+DESTDIR ?= /
ifneq ($(OS),Windows_NT)
CFLAGS += -fPIC
@@ -59,6 +61,20 @@ clean:
$(RM) libhoedown.so libhoedown.so.1 libhoedown.a
$(RM) hoedown smartypants hoedown.exe smartypants.exe
+# Installing
+
+install:
+ install -m755 -d $(DESTDIR)$(PREFIX)/lib
+ install -m755 -d $(DESTDIR)$(PREFIX)/bin
+ install -m755 -d $(DESTDIR)$(PREFIX)/include
+
+ install -m644 libhoedown.* $(DESTDIR)$(PREFIX)/lib
+ install -m755 hoedown $(DESTDIR)$(PREFIX)/bin
+ install -m755 smartypants $(DESTDIR)$(PREFIX)/bin
+
+ install -m755 -d $(DESTDIR)$(PREFIX)/include/hoedown
+ install -m644 src/*.h $(DESTDIR)$(PREFIX)/include/hoedown
+
# Generic object compilations
%.o: %.c