HC = ghc HC_MAKE = $(HC) --make $< -o $@ -main-is $(notdir $@) $(HC_OPTIONS) H_CRONS = Daemon1st Daemon2ndRecurring Editor1st Editor2nd Editor3rdLimit Editor4thRecurring \ Editor5thOutputWindow Editor6thCrontab %: %.hs $(HC_MAKE) all: $(H_CRONS) Daemon1st: Daemon1st.hs Entry1st.hs Daemon2ndRecurring: Daemon2ndRecurring.hs Entry2ndRecurring.hs Editor1st: Editor1st.hs Entry1st.hs Editor2nd: Editor2nd.hs Entry1st.hs Editor3rdLimit: Editor3rdLimit.hs Entry1st.hs Editor4thRecurring: Editor4thRecurring.hs Entry2ndRecurring.hs Editor5thOutputWindow: Editor5thOutputWindow.hs Entry2ndRecurring.hs Editor6thCrontab: Editor6thCrontab.hs Entry3rdCrontab.hs .PHONY: clean all screenshots all:$(H_CRONS) clean: - rm *.hi *.o *~ $(H_CRONS) *.png define hcronScreenshot echo "Doing $(1) screenshot" ./$(1) & sleep 2 && import -frame -window $(2) $(1)Screenshot.png killall $(1) endef screenshots: all $(call hcronScreenshot,Editor1st,"Editor1st") $(call hcronScreenshot,Editor2nd,"Editor2nd") $(call hcronScreenshot,Editor3rdLimit,"Editor3rd") $(call hcronScreenshot,Editor4thRecurring,"Editor4th") $(call hcronScreenshot,Editor5thOutputWindow,"Editor5th") $(call hcronScreenshot,Editor6thCrontab,"Editor6th")