changeset: 33:213e4888f56f
tag: tip
user: pancake <pancake_AT_nopcode.org>
date: Wed Aug 11 01:23:26 2010 +0200
files: Makefile
description:
support DESTDIR, PREFIX and ETCDIR
diff -r 4f587b495a7a -r 213e4888f56f Makefile
--- a/Makefile Thu Apr 29 20:18:14 2010 +0100
+++ b/Makefile Wed Aug 11 01:23:26 2010 +0200
@@ -3,6 +3,12 @@
src = skvm.c
inc = -I/usr/include -I/usr/include/hal
+DESTDIR?=
+ETCDIR?=/etc
+PREFIX?=/usr
+dst = ${DESTDIR}${PREFIX}
+etc = ${DESTDIR}${ETCDIR}
+
CC = gcc
CFLAGS += -Wall -Wextra -std=gnu99 -Wformat-security -Wshadow \
-Wpointer-arith -ggdb \
@@ -26,23 +32,24 @@
@rm -rf skvm-$(ver)
install: all
- @echo installing executable file to /usr/bin
- @cp -f $(bin) /usr/bin
- @chmod 755 /usr/bin/$(bin)
- @echo installing init script to /etc/rc.d
- @cp -f init/$(bin) /etc/rc.d
- @chmod 755 /etc/rc.d/$(bin)
- @echo installing manpage at /usr/local/share/man/man1
- @mkdir -p /usr/local/share/man/man1
- @sed "s/VERSION/$(ver)/g" < skvm.1 > /usr/local/share/man/man1/skvm.1
- @chmod 644 /usr/local/share/man/man1/skvm.1
+ @echo installing executable file to $(dst)/bin
+ @cp -f $(bin) $(dst)/bin
+ @chmod 755 $(dst)/bin/$(bin)
+ @echo installing init script to $(etc)/rc.d
+ @mkdir -p $(etc)/rc.d
+ @cp -f init/$(bin) $(etc)/rc.d
+ @chmod 755 $(etc)/rc.d/$(bin)
+ @echo installing manpage at $(dst)/share/man/man1
+ @mkdir -p $(dst)/share/man/man1
+ @sed "s/VERSION/$(ver)/g" < skvm.1 > $(dst)/share/man/man1/skvm.1
+ @chmod 644 $(dst)/share/man/man1/skvm.1
uninstall:
@echo removing /usr/bin/$(bin)
- @rm -f /usr/bin/$(bin)
- @echo removing /etc/rc.d/$(bin)
- @rm -f /etc/rc.d/$(bin)
- @echo removing /usr/local/share/man/man1/skvm.1
- @rm -f /usr/local/share/man/man1/skvm.1
+ @rm -f $(dst)/bin/$(bin)
+ @echo removing $(etc)/rc.d/$(bin)
+ @rm -f $(etc)/rc.d/$(bin)
+ @echo removing $(dst)/share/man/man1/skvm.1
+ @rm -f $(dst)/share/man/man1/skvm.1
.PHONY: all clean dist install uninstall
Received on Wed Aug 11 2010 - 01:27:13 CEST
This archive was generated by hypermail 2.2.0 : Wed Aug 11 2010 - 01:36:04 CEST