-# Building archives and the test0 app
+# Building archives and the test? apps
-PACKNL = ${HOME}/src/borta/packnl/packnl
+default: .archives
+
+####################
+SUBDIR = $(dir $(wildcard */Makefile))
+
+.PHONY: .archives
+.archives:
+ @for D in ${SUBDIR} ; do $(MAKE) -C $$D ; done
-LSPSRC = lsp-dbus-test.lsp
-ARCHIVES = lsp-misc.a lsp-dbus.a
-DOCS = lsp-dbus.a.8 lsp-misc.a.8
+.PHONY: .clean
+.clean:
+ for D in ${SUBDIR} ; do $(MAKE) -C $$D clean ; done
-default: test0 docs
+%.8: %.8.adoc
+ asciidoctor -b manpage $<
+
+####################
+PACKNL = ${HOME}/src/borta/packnl/packnl
+define PACKNLACTION
+${PACKNL} -w $@ $< ${EXTRA} $(addprefix -A ,$(wordlist 2,1000,$^))
+endef
-include manpage.mk
-include lsplib.mk
+test0: lsp-misc/lsp-misc.a lsp-dbus/lsp-dbus.a
+test0: lsp-dbus-test.lsp
+ ${PACKNLACTION}
-.PHONY: docs
-docs: ${DOCS}
+test1: EXTRA = ex2.conf
+test1: lsp-alsa/lsp-pcm-dispatch.a lsp-alsa/lsp-libasound.a
+test1: lsp-alsa-test.lsp lsp-misc/lsp-misc.a
+ ${PACKNLACTION}
-test0: lsp-dbus-test.lsp ${ARCHIVES}
- ${PACKNL} -w $@ $< $(addprefix -A ,${ARCHIVES})
+clean: .clean
+ rm -f test0 test1
-clean:
- rm -f test0 ${CLEAN}