blob: d0bf8a2bef7d5e318972f8b417b3cc68bacda7c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
CFLAGS+=-std=c11 -Wall -Wextra -Wpedantic -D_POSIX_C_SOURCE=200809L
CFLAGS+=`pkg-config --cflags lua5.4`
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)\"
main.o: plop.h
plop.o: connection.h plop.h stream.h
connection.o: connection.h
stream.o: stream.h
clean:
rm -f plop *.o
install: plop
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 $(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: all clean install uninstall env
|