TOP_DIR = $(shell /bin/pwd | /bin/sed -e 's/.*\/dwl\/src//' -e 's/^\///' -e 's/[^/][^/]*/../g' -e 's/^$$/./') MY_DIR = $(shell /bin/pwd | /bin/sed -e 's/.*\/dwl\/src//' -e 's/^\///') WWW_DIR = $(TOP_DIR)/.. HTML_TOP = $(WWW_DIR)/html M4_DIR = $(TOP_DIR)/include MAKEFILE = Makefile M4 = /usr/bin/m4 INCLUDES = $(M4_DIR)/header-html5.m4 $(M4_DIR)/footer-html5.m4 \ $(M4_DIR)/common-html5.m4 TARGET_DIR = $(HTML_TOP)/$(MY_DIR) TARGET = $(TARGET_DIR)/report20170415.html DEFINE = -DHTML_TOPDIR=$(TOP_DIR) -DHTML_PARTDIR=$(TOP_DIR) -I$(M4_DIR) .SUFFIXES: .src .html all: $(TARGET) clean:: -rm $(TARGET) .src.html: $(M4) $(DEFINE) $< > $@ $(TARGET): $(MAKEFILE) $(INCLUDES) report20170415.src $(M4) $(DEFINE) $< > $@