profiles = desktop desktoptopics = email office web desktoptopiclists = $(patsubst %,profiles/desktop-%,$(desktoptopics)) 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 $@ $^ $(topicfiles): content/desktop/%/preseed.cfg : profiles/desktop profiles/desktop-% profiles/desktop-z bin/pkglist2preseed skel/preseed.cfg.in $@ $^ $(mainfiles): content/%/preseed.cfg : profiles/% profiles/%-email $(desktoptopiclists) profiles/%-z bin/pkglist2preseed skel/preseed.cfg.in $@ $^ $(mdfiles): content/MD%SUMS: $(allfiles) cd content && md$*sum $(allfiles:content/%=%) > MD$*SUMS~ mv -f $@~ $@ $(shafiles): content/SHA%SUMS: $(allfiles) cd content && sha$*sum $(allfiles:content/%=%) > SHA$*SUMS~ mv -f $@~ $@ $(signfiles): %.sign: % rm -f $@ gpg --detach-sign -a -o $@ $<