# # file: rules-common.mk # purpose: list of common rules to be included in rules.mk's # created: pasha jun 5 2001 # modified: pasha jan 27 2010 # modification: added STRIP_COMMENTS rule # # rule for generating html/php/cgi page from perl source define PL_RULE $(YAEP) $< | $(HTMLPOSTPROCESS) --pagedir=$( $@; \ if (( $${PIPESTATUS[0]} || $${PIPESTATUS[1]} )); then rm -f $@; exit 1; fi @if ! [ -s $@ ]; then rm -f $@; echo zero output file $@; exit 1; fi endef # html postprocessing rule define HTML_RULE ($(HTMLPOSTPROCESS) --pagedir=$( $@) || (rm -f $@; exit 1;) endef # strip comments (i.e., lines starting with # and blank lines) define STRIP_COMMENTS sed '/^#.*$$/d' $< | sed '/^[:blank:]*$$/d' > $@ endef # copy rule define CP_RULE cp -p $< $@ && chmod a+r $@ endef # end of rules-common.mk