File: Makefile

package info (click to toggle)
overlay-boot 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: sh: 253; makefile: 59; ansic: 26
file content (80 lines) | stat: -rw-r--r-- 2,461 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ETCDIR = $(DESTDIR)/etc
INITDIR = $(DESTDIR)/etc/init.d
SRVDIR =  $(DESTDIR)/usr/lib/systemd/system
MAN8DIR = $(DESTDIR)/usr/share/man/man8
SBINDIR = $(DESTDIR)/usr/sbin
VARLIBDIR = $(DESTDIR)/var/lib/overlay-boot

MAN8FILES = overlay-boot.8 overlay-go.8 overlay-stop.8 overlay-diskfile.8
MAN8FILES += overlay-share.8
VARLIBFILES = overlay-boot overlay-go overlay-stop functions reaper
VARLIBFILES += overlay-init overlay-postmount overlay-premount
VARLIBFILES += overlay-diskfile
VARLIBFILES += overlay-share
INITFILES = subhosts
ETCFILES = subhosts.conf
SRVFILES = overlay-boot@.service

# The default is to build asm/reaper
REAPER = src/reaper
all: $(REAPER)

# Specific rule: $(REAPER) is ensured by "recursive make"
$(REAPER): 
	$(MAKE) -C $$(dirname $(REAPER)) reaper

# Specific rule: the reaper program originates from $(REAPER)
reaper: $(REAPER)
	mv $< $@

# Specific rule: the sysvinit init file
$(INITDIR)/subhosts: subhosts.sh | $(INITDIR)/
	cp $< $@

# Specific rule: the sysvinit init configuration file
$(ETCDIR)/subhosts.conf: subhosts.conf | $(ETCDIR)/
	cp $< $@

# Generic rule: any dependee directory needs to be created
%/:
	mkdir -p $@

# Generic rule: a local .8 file depends on the same .8.adoc file, if any
$(MAN8FILES): %: %.adoc
	asciidoctor -b manpage $^

# Generic rule: an installed MAN8FILE file depends on a local the
# same, and that the installation directory exists
$(addprefix $(MAN8DIR)/,$(MAN8FILES)): $(MAN8DIR)/%: % | $(MAN8DIR)/
	cp $< $@

# Generic rule: an installed VARLIBFILES file depends on a local the
# same, and that the installation directory exists
$(addprefix $(VARLIBDIR)/,$(VARLIBFILES)): $(VARLIBDIR)/%: % | $(VARLIBDIR)/
	cp -p $< $@

# Generic rule: copy service files
$(addprefix $(SRVDIR)/,$(SRVFILES)): $(SRVDIR)/%: % | $(SRVDIR)/
	cp $< $@

# Make target: to clean up this workspace
clean:
	rm -f reaper *.8
	make -C $$(dirname $(REAPER)) clean

.INTERMEDIATE: reaper $(MAN8FILES)

# Make target: enumerates that which should be installed
INSTALLTARGETS += $(addprefix $(MAN8DIR)/,$(MAN8FILES))
INSTALLTARGETS += $(addprefix $(VARLIBDIR)/,$(VARLIBFILES))
INSTALLTARGETS += $(addprefix $(INITDIR)/,$(INITFILES))
INSTALLTARGETS += $(addprefix $(SRVDIR)/,$(SRVFILES))
INSTALLTARGETS += $(addprefix $(ETCDIR)/,$(ETCFILES))

install: $(INSTALLTARGETS)

# Make target: make a .deb file in ../
BUILDPACKAGE = -us -uc --build=full -Iolle
deb:
	dpkg-buildpackage $(BUILDPACKAGE)
#	PREFIX= INCLUDE_PREFIX=/usr