-DST := /etc/postfix
+SUBDIRS := postfix postfixadmin
-INPUTS := \
- configuration/main.cf \
- configuration/master.cf \
- configuration/postgrey_whitelist_clients.local \
- configuration/postgrey_whitelist_recipients \
- configuration/rbl_override \
- configuration/mysql/relay_domains.cf \
- configuration/mysql/virtual_alias_maps.cf \
- configuration/mysql/virtual_domains_maps.cf \
- configuration/mysql/virtual_mailbox_limits.cf \
- configuration/mysql/virtual_mailbox_maps.cf
+all: $(SUBDIRS)
+.PHONY: $(SUBDIRS)
-OUTPUTS := $(subst configuration/,$(DST)/,$(INPUTS))
-
-all: $(OUTPUTS) postfixadmin
-
-postfixadmin:
- ./setup-postfix.sh
-
-$(DST)/%: configuration/%
- @mkdir -p $(@D)
- cp $^ $@
+$(SUBDIRS):
+ $(MAKE) -C $@
--- /dev/null
+DST := /etc/postfix
+
+INPUTS := \
+ main.cf \
+ master.cf \
+ postgrey_whitelist_clients.local \
+ postgrey_whitelist_recipients \
+ rbl_override \
+ mysql/relay_domains.cf \
+ mysql/virtual_alias_maps.cf \
+ mysql/virtual_domains_maps.cf \
+ mysql/virtual_mailbox_limits.cf \
+ mysql/virtual_mailbox_maps.cf
+
+OUTPUTS := $(INPUTS:%=$(DST)/%)
+
+all: $(OUTPUTS)
+
+$(DST)/%: configuration/%
+ @mkdir -p $(@D)
+ cp $^ $@