maintopics = desktop desktoptopics = email media mobile office scheduling web lcdesktoptopics = email office web lcgroups = all eu desktoptopiclists = $(patsubst %,profiles/desktop-%,$(desktoptopics)) desktoptopiclcgrouplists = $(foreach topic,$(lcdesktoptopics),\ profiles/desktop-$(topic)-%) desktoptweaks = tweaks/base tweaks/desktop mainfiles = $(patsubst %,content/%/preseed.cfg,$(maintopics)) mainlcgroupfiles = $(patsubst %,content/desktop/%/preseed.cfg,$(lcgroups)) profiles-di = $(mainfiles) $(mainlcgroupfiles) profiles-script = $(patsubst %/preseed.cfg,%/script.sh,$(profiles-di)) profiles = $(profiles-di) $(profiles-script) mdfiles = content/MD5SUMS shafiles = $(patsubst %,content/SHA%SUMS,1 256 512) checksumfiles = $(mdfiles) $(shafiles) signfiles = $(patsubst %,%.sig,$(checksumfiles)) info = content/NEWS content/TODO all: $(checksumfiles) $(info) sign: $(signfiles) $(mainfiles): content/%/preseed.cfg : skel/preseed.cfg.in profiles/% $(desktoptopiclists) profiles/%-z $(desktoptweaks) bin/pkglist2preseed $(filter skel/%,$^) $@ "$(filter profiles/%,$^)" "$(filter tweaks/%,$^)" $(mainlcgroupfiles): content/desktop/%/preseed.cfg : skel/preseed.cfg.in profiles/desktop $(desktoptopiclists) $(desktoptopiclcgrouplists) profiles/desktop-z $(desktoptweaks) bin/pkglist2preseed $(filter skel/%,$^) $@ "$(filter profiles/%,$^)" "$(filter tweaks/%,$^)" $(profiles-script): %script.sh : %preseed.cfg $(mdfiles): content/MD%SUMS: $(profiles) cd content && md$*sum $(profiles:content/%=%) > MD$*SUMS~ rm -f $@.sig mv -f $@~ $@ $(shafiles): content/SHA%SUMS: $(profiles) cd content && sha$*sum $(profiles:content/%=%) > SHA$*SUMS~ rm -f $@.sig mv -f $@~ $@ $(signfiles): %.sig: % rm -f $@ gpg --detach-sign -a -o $@ $< $(info): content/% : % mkdir -p content cp -f $< $@ clean: rm -f $(profiles) $(info) $(checksumfiles) $(signfiles)