github.com/elves/elvish@v0.15.0/website/Makefile (about)

     1  TOOLS_DIR := ./tools
     2  DST_DIR = ./_dst
     3  PUBLISH_DIR := ./_publish
     4  
     5  MDS := home.md $(filter-out %/README.md,$(wildcard [^_]*/*.md))
     6  HTMLS := $(MDS:.md=.html)
     7  
     8  TOOLS := highlight macros elvdoc genblog
     9  
    10  default: gen
    11  
    12  %.html: %.md $(TOOL_BINARIES) $(TOOLS_DIR)/md-to-html
    13  	$(TOOLS_DIR)/md-to-html $< $@
    14  
    15  # Generates the website into the dst directory.
    16  gen: tools $(HTMLS)
    17  	./$(TOOLS_DIR)/genblog.bin . $(DST_DIR)
    18  	ln -sf `pwd`/fonts.css `pwd`/favicons/* $(DST_DIR)/
    19  
    20  tools:
    21  	for tool in $(TOOLS); do \
    22  		go build -o $(TOOLS_DIR)/$$tool.bin ./cmd/$$tool; \
    23  	done
    24  
    25  genblog:
    26  	: # a nop, kept for backward compatibility with elves/up
    27  	
    28  # Synchronizes the generated website into $(PUBLISH_DIR). The PUBLISH_DIR
    29  # environment variable can be overridden to a remote place to publish this online.
    30  publish: gen
    31  	rsync -aLv --delete ./_dst/ $(PUBLISH_DIR)/
    32  
    33  clean:
    34  	rm -f $(HTMLS) _tools/*.bin
    35  	rm -rf $(DST_DIR)
    36  
    37  .PHONY: default gen tools genblog publish clean
    38  .SECONDARY: $(TOOL_BINARIES)