Add bind-mount for /etc/adjtime to make subhost use host clock without ado
[rrq/overlay-boot.git] / Makefile
1 ETCDIR = $(DESTDIR)/etc
2 INITDIR = $(DESTDIR)/etc/init.d
3 MAN8DIR = $(DESTDIR)/usr/share/man/man8
4 SBINDIR = $(DESTDIR)/usr/sbin
5 VARLIBDIR = $(DESTDIR)/var/lib/overlay-boot
6
7 MAN8FILES = overlay-boot.8 overlay-go.8 overlay-stop.8 overlay-diskfile.8
8 MAN8FILES += overlay-share.8
9 VARLIBFILES = overlay-boot overlay-go overlay-stop functions reaper
10 VARLIBFILES += overlay-init overlay-postmount overlay-premount
11 VARLIBFILES += overlay-diskfile
12 VARLIBFILES += overlay-share
13 INITFILES = subhosts
14 ETCFILES = subhosts.conf
15
16 # The default is to build asm/reaper
17 REAPER = src/reaper
18 all: $(REAPER)
19
20 # Specific rule: $(REAPER) is ensured by "recursive make"
21 $(REAPER): 
22         $(MAKE) -C $$(dirname $(REAPER)) reaper
23
24 # Specific rule: the reaper program originates from $(REAPER)
25 reaper: $(REAPER)
26         mv $< $@
27
28 # Specific rule: the sysvinit init file
29 $(INITDIR)/subhosts: subhosts.sh | $(INITDIR)/
30         cp $< $@
31
32 # Specific rule: the sysvinit init configuration file
33 $(ETCDIR)/subhosts.conf: subhosts.conf | $(ETCDIR)/
34         cp $< $@
35
36 # Generic rule: any dependee directory needs to be created
37 %/:
38         mkdir -p $@
39
40 # Generic rule: a local .8 file depends on the same .8.adoc file, if any
41 $(MAN8FILES): %: %.adoc
42         asciidoctor -b manpage $^
43
44 # Generic rule: an installed MAN8FILE file depends on a local the
45 # same, and that the installation directory exists
46 $(addprefix $(MAN8DIR)/,$(MAN8FILES)): $(MAN8DIR)/%: % | $(MAN8DIR)/
47         cp $< $@
48
49 # Generic rule: an installed VARLIBFILES file depends on a local the
50 # same, and that the installation directory exists
51 $(addprefix $(VARLIBDIR)/,$(VARLIBFILES)): $(VARLIBDIR)/%: % | $(VARLIBDIR)/
52         cp -p $< $@
53
54 # Make target: to clean up this workspace
55 clean:
56         rm -f reaper *.8
57         make -C $$(dirname $(REAPER)) clean
58
59 .INTERMEDIATE: reaper $(MAN8FILES)
60
61 # Make target: enumerates that which should be installed
62 INSTALLTARGETS += $(addprefix $(MAN8DIR)/,$(MAN8FILES))
63 INSTALLTARGETS += $(addprefix $(VARLIBDIR)/,$(VARLIBFILES))
64 INSTALLTARGETS += $(addprefix $(INITDIR)/,$(INITFILES))
65 INSTALLTARGETS += $(addprefix $(ETCDIR)/,$(ETCFILES))
66
67 install: $(INSTALLTARGETS)
68
69 # Make target: make a .deb file in ../
70 BUILDPACKAGE = -us -uc --build=full -Iolle
71 deb:
72         dpkg-buildpackage $(BUILDPACKAGE)
73 #       PREFIX= INCLUDE_PREFIX=/usr