File: Makefile

package info (click to toggle)
blockdomains 0.1-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104 kB
  • sloc: ansic: 456; makefile: 49; sh: 14
file content (66 lines) | stat: -rw-r--r-- 1,659 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Distribution Makefile for blockdomains

# Generated files
SBINFILES = blockdomains
BINFILES  = blockdomainsctl
MANFILES  = blockdomains.5 blockdomains.8 blockdomainsctl.8
CFGDIRS   = blocked/ acl/

default: $(SBINFILES) $(MANFILES)

.PHONY: install clean

# Building targets

$(MANFILES): %: doc/%.adoc
	asciidoctor -bmanpage -o $@ $< 

README.html: README.adoc
	asciidoctor -bhtml $<

blockdomains: CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
blockdomains: CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
blockdomains: LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
blockdomains: CFLAGS += -Wall
blockdomains: src/blockdomains.c src/cache.c src/database.c
	$(LINK.c) -o $@ $^ -lnetfilter_queue

# Installation

SBINDIR = $(DESTDIR)/usr/sbin
BINDIR  = $(DESTDIR)/usr/bin
CFGTOP  = $(DESTDIR)/etc/blockdomains
MAN5DIR = $(DESTDIR)/usr/share/man/man5
MAN8DIR = $(DESTDIR)/usr/share/man/man8
SYSVINIT  = $(DESTDIR)/etc/init.d/blockdomains
SYSTEMDINIT = $(DESTDIR)/usr/lib/systemd/system/blockdomains.service

install: $(addprefix $(SBINDIR)/,$(SBINFILES))
install: $(addprefix $(BINDIR)/,$(BINFILES))
install: $(addprefix $(MAN5DIR)/,$(filter %.5,$(MANFILES)))
install: $(addprefix $(MAN8DIR)/,$(filter %.8,$(MANFILES)))
install: $(addprefix $(CFGTOP)/,$(CFGDIRS))
install: $(SYSVINIT) $(SYSTEMDINIT)

$(SYSVINIT): init/blockdomains
	install -D $< $@

$(SYSTEMDINIT): init/blockdomains.service
	install -m 644 -D $< $@

$(CFGTOP)/%/:
	mkdir -p $@

$(SBINDIR)/%: %
	install -D $< $@
$(BINDIR)/%: %
	install -D $< $@
$(MAN5DIR)/%: %
	install -m 644 -D $< $@
$(MAN8DIR)/%: %
	install -m 644 -D $< $@

# Cleaning up

clean:
	rm -f $(SBINFILES) $(MANFILES)