SBINDIR = $(DESTDIR)/usr/sbin
-ETCDIR = $(DESTDIR)/etc/rrqnet
-MAN1DIR = $(DESTDIR)/usr/share/man/man1
+#ETCDIR = $(DESTDIR)/etc/overlay
+#MAN1DIR = $(DESTDIR)/usr/share/man/man1
MAN8DIR = $(DESTDIR)/usr/share/man/man8
VARLIBDIR = $(DESTDIR)/var/lib/overlay-boot
-SBINCFILES =
+#SBINCFILES =
#SBINFILES = overlay-boot overlay-go overlay-stop
-ETCFILES =
-MAN1FILES =
+# The SBINFILES are installed via links; see debian/overlay-boot.links
+#ETCFILES =
+#MAN1FILES =
MAN8FILES = overlay-boot.8 overlay-go.8 overlay-stop.8
-HTMLDOC = $(MAN8FILES:%=%.html)
+#HTMLDOC = $(MAN8FILES:%=%.html)
VARLIBFILES = overlay-boot overlay-go overlay-stop functions reaper
VARLIBFILES += overlay-init overlay-postmount overlay-premount
-all: asm/reaper
+# The default is to build asm/reaper
+REAPER = src/reaper
+all: $(REAPER)
-asm/reaper:
- $(MAKE) -C asm reaper
+# Specific rule: $(REAPER) is ensured by "recursive make"
+$(REAPER):
+ $(MAKE) -C $$(dirname $(REAPER)) reaper
-overlay-boot.8: README.adoc
- a2x -d manpage -f manpage $^
-
-$(addprefix $(MAN8DIR)/,$(MAN8FILES)): overlay-boot.8 | $(MAN8DIR)/
- cp $< $@
+# Specific rule: the reaper program originates from $(REAPER)
+reaper: $(REAPER)
+ cp -p $< $@
-$(MAN8DIR)/ $(VARLIBDIR)/:
+# Generic rule: any dependee directory needs to be created
+%/:
mkdir -p $@
-reaper: asm/reaper
- cp -p $< $@
+# Generic rule: a local .8 file depends on the same .8.adoc file, if any
+$(MAN8FILES): %: %.adoc
+ a2x -d manpage -f 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 $< $@
+# Make target: to clean up this workspace
clean:
- rm -f reaper overlay-boot.8 asm/reaper
+ rm -f reaper overlay-boot.8
+ make -C $$(dirname $(REAPER)) clean
dh_clean -d
-INSTALLTARGETS = $(addprefix $(SBINDIR)/,$(SBINFILES))
-INSTALLTARGETS += $(addprefix $(ETCDIR)/,$(ETCFILES))
-INSTALLTARGETS += $(addprefix $(MAN1DIR)/,$(MAN1FILES))
+# Make target: enumerates that which should be installed
+#INSTALLTARGETS = $(addprefix $(SBINDIR)/,$(SBINFILES))
+#INSTALLTARGETS += $(addprefix $(ETCDIR)/,$(ETCFILES))
+#INSTALLTARGETS += $(addprefix $(MAN1DIR)/,$(MAN1FILES))
INSTALLTARGETS += $(addprefix $(MAN8DIR)/,$(MAN8FILES))
INSTALLTARGETS += $(addprefix $(VARLIBDIR)/,$(VARLIBFILES))
-
install: $(INSTALLTARGETS)
+# Make target: make a .deb file in ../
BUILDPACKAGE = -us -uc --build=full -Iolle
deb:
- PREFIX= INCLUDE_PREFIX=/usr dpkg-buildpackage $(BUILDPACKAGE)
+ dpkg-buildpackage $(BUILDPACKAGE)
+# PREFIX= INCLUDE_PREFIX=/usr