+# Building archives and the test? apps
-LSPLIB = -A lsp-misc/lsp-misc.a -A lsp-dbus/lsp-dbus.a
+default: .archives
-LSPSRC = lsp-dbus-test.lsp
+####################
+SUBDIR = $(dir $(wildcard */Makefile))
-test0: ${LSPSRC}
- ${HOME}/src/borta/packnl/packnl -w $@ $^ ${LSPLIB}
+.PHONY: .archives
+.archives:
+ for D in ${SUBDIR} ; do $(MAKE) -C $$D ; done
+
+.PHONY: .clean
+.clean:
+ for D in ${SUBDIR} ; do $(MAKE) -C $$D clean ; done
+
+####################
+PACKNL = ${HOME}/src/borta/packnl/packnl
+define PACKNLACTION
+${PACKNL} -w $@ $< $(addprefix -A ,$(wordlist 2,1000,$^))
+endef
+
+test0: lsp-dbus-test.lsp
+test0: lsp-misc/lsp-misc.a lsp-dbus/lsp-dbus.a
+ ${PACKNLACTION}
+
+test1: lsp-alsa-test.lsp
+test1: lsp-alsa/pcm-dispatch.a lsp-alsa/libasound.a lsp-alsa/lib-utils.a
+ ${PACKNLACTION}
+
+clean: .clean
+ rm -f test0 test1