summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-08-15 13:45:35 +0200
committerAki <please@ignore.pl>2021-08-15 13:45:35 +0200
commitc05d5a9faa363ee68776ec621d8c2cb86e3b9e24 (patch)
treee584ac7cd58517f91a66cac86f91fcb9b9234cd8 /Makefile
parent2837a4ff324f1f1b92f6f96791b5bad844135681 (diff)
downloadplop-c05d5a9faa363ee68776ec621d8c2cb86e3b9e24.zip
plop-c05d5a9faa363ee68776ec621d8c2cb86e3b9e24.tar.gz
plop-c05d5a9faa363ee68776ec621d8c2cb86e3b9e24.tar.bz2
Updated makefile with standard variables
Diffstat (limited to 'Makefile')
-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