summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile33
1 files changed, 19 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index b584fbc..d0bf8a2 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,11 @@ LDLIBS+=`pkg-config --libs lua5.4`
PREFIX?=/usr/local
SHARE?=$(PREFIX)/share
+MANDIR?=$(SHARE)/man/man1
PLOP_DEFAULT_HANDLER?=$(SHARE)/plop/default.lua
+all: plop
+
plop: connection.o main.o plop.o stream.o
main.o: CFLAGS+=-DPLOP_DEFAULT_HANDLER=\"$(PLOP_DEFAULT_HANDLER)\"
@@ -18,25 +21,27 @@ clean:
rm -f plop *.o
install: plop
- mkdir -p $(PREFIX)/bin
- mkdir -p $(SHARE)/man/man1
- mkdir -p $(SHARE)/plop
- cp -f plop $(PREFIX)/bin
- cp -f plop.1 $(SHARE)/man/man1
- cp -f default.lua $(SHARE)/plop
- chmod 755 $(PREFIX)/bin/plop
- chmod 644 $(SHARE)/man/man1/plop.1
- chmod 644 $(SHARE)/plop/default.lua
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ mkdir -p $(DESTDIR)$(MANDIR)/man/man1
+ mkdir -p $(DESTDIR)$(SHARE)/plop
+ cp -f plop $(DESTDIR)$(PREFIX)/bin
+ cp -f plop.1 $(DESTDIR)$(MANDIR)/man/man1
+ cp -f default.lua $(DESTDIR)$(SHARE)/plop
+ chmod 755 $(DESTDIR)$(PREFIX)/bin/plop
+ chmod 644 $(DESTDIR)$(MANDIR)/man/man1/plop.1
+ chmod 644 $(DESTDIR)$(SHARE)/plop/default.lua
uninstall:
- rm -f $(PREFIX)/bin/plop
- rm -f $(SHARE)/man/man1/plop.1
- rm -f $(SHARE)/plop/default.lua
- rmdir $(SHARE)/plop
+ rm -f $(DESTDIR)$(PREFIX)/bin/plop
+ rm -f $(DESTDIR)$(MANDIR)/man/man1/plop.1
+ rm -f $(DESTDIR)$(SHARE)/plop/default.lua
+ rmdir $(DESTDIR)$(SHARE)/plop
env:
+ @echo DESTDIR=$(DESTDIR)
@echo PREFIX=$(PREFIX)
@echo SHARE=$(SHARE)
+ @echo MANDIR=$(MANDIR)
@echo PLOP_DEFAULT_HANDLER=$(PLOP_DEFAULT_HANDLER)
-.PHONY: clean install uninstall env
+.PHONY: all clean install uninstall env