profiles = desktop desktoptopics = email office web desktoptopiclists = $(patsubst %,profiles/desktop-%,$(desktoptopics)) desktoptweaks = tweaks/base tweaks/desktop basefiles = $(patsubst %,content/%/base/preseed.cfg,$(profiles)) topicfiles = $(patsubst %,content/desktop/%/preseed.cfg,$(desktoptopics)) mainfiles = $(patsubst %,content/%/preseed.cfg,$(profiles)) allfiles = $(basefiles) $(topicfiles) $(mainfiles) mdfiles = content/MD5SUMS shafiles = $(patsubst %,content/SHA%SUMS,1 256 512) checksumfiles = $(mdfiles) $(shafiles) signfiles = $(patsubst %,%.sign,$(checksumfiles)) all: $(checksumfiles) sign: $(signfiles) $(basefiles): content/%/base/preseed.cfg : profiles/% profiles/%-z bin/pkglist2preseed skel/preseed.cfg.in $@ "$^" "$(desktoptweaks)" $(topicfiles): content/desktop/%/preseed.cfg : profiles/desktop profiles/desktop-% profiles/desktop-z bin/pkglist2preseed skel/preseed.cfg.in $@ "$^" "$(desktoptweaks)" $(mainfiles): content/%/preseed.cfg : profiles/% profiles/%-email $(desktoptopiclists) profiles/%-z bin/pkglist2preseed skel/preseed.cfg.in $@ "$^" "$(desktoptweaks)" $(mdfiles): content/MD%SUMS: $(allfiles) cd content && md$*sum $(allfiles:content/%=%) > MD$*SUMS~ rm -f $@.sign mv -f $@~ $@ $(shafiles): content/SHA%SUMS: $(allfiles) cd content && sha$*sum $(allfiles:content/%=%) > SHA$*SUMS~ rm -f $@.sign mv -f $@~ $@ $(signfiles): %.sign: % rm -f $@ gpg --detach-sign -a -o $@ $<