|
| 1 | +# |
| 2 | +# This file and its contents are supplied under the terms of the |
| 3 | +# Common Development and Distribution License ("CDDL"), version 1.0. |
| 4 | +# You may only use this file in accordance with the terms of version |
| 5 | +# 1.0 of the CDDL. |
| 6 | +# |
| 7 | +# A full copy of the text of the CDDL should have accompanied this |
| 8 | +# source. A copy of the CDDL is also available via the Internet at |
| 9 | +# http://www.illumos.org/license/CDDL. |
| 10 | +# |
| 11 | + |
| 12 | +# |
| 13 | +# Copyright 2014 (c) Joyent, Inc. All rights reserved. |
| 14 | +# |
| 15 | + |
| 16 | +PTYHON = python |
| 17 | +MDPATH = ./support |
| 18 | +MD = $(MDPATH)/markdown2.py |
| 19 | +TOC = ./support/gentoc.sh |
| 20 | + |
| 21 | +HEADER = assets/header.html |
| 22 | +TRAILER = assets/trailer.html |
| 23 | + |
| 24 | +BOOTSTRAP_MIN = .min |
| 25 | +BOOTSTRAP_TYPES = css img js |
| 26 | +BOOTSTRAP_FILES = \ |
| 27 | + css/bootstrap$(BOOTSTRAP_MIN).css \ |
| 28 | + img/glyphicons-halflings-white.png \ |
| 29 | + img/glyphicons-halflings.png \ |
| 30 | + js/bootstrap$(BOOTSTRAP_MIN).js |
| 31 | + |
| 32 | +MDARGS = \ |
| 33 | + --extras fenced-code-blocks \ |
| 34 | + --extras wiki-tables \ |
| 35 | + --extras link-patterns \ |
| 36 | + --extras header-ids \ |
| 37 | + --link-patterns-file support/link-patterns.txt |
| 38 | + |
| 39 | +IMAGE_FILES = \ |
| 40 | + illumos_phoenix_small.png |
| 41 | + |
| 42 | +FILES = \ |
| 43 | + intro \ |
| 44 | + workflow \ |
| 45 | + layout \ |
| 46 | + anatomy \ |
| 47 | + debugging \ |
| 48 | + integrating \ |
| 49 | + help \ |
| 50 | + license |
| 51 | + |
| 52 | +OUTDIR = output |
| 53 | +BOOTSTRAP_OUTDIRS = \ |
| 54 | + $(BOOTSTRAP_TYPES:%=$(OUTDIR)/bootstrap/%) |
| 55 | + |
| 56 | +OUTFILES = \ |
| 57 | + $(FILES:%=$(OUTDIR)/%.html) \ |
| 58 | + $(IMAGE_FILES:%=$(OUTDIR)/img/%) \ |
| 59 | + $(BOOTSTRAP_FILES:%=$(OUTDIR)/bootstrap/%) |
| 60 | + |
| 61 | + |
| 62 | +all: $(OUTDIR) $(BOOTSTRAP_OUTDIRS) $(OUTFILES) |
| 63 | + |
| 64 | +$(OUTDIR): |
| 65 | + mkdir -p "$@" |
| 66 | + |
| 67 | +$(OUTDIR)/img: |
| 68 | + mkdir -p "$@" |
| 69 | + |
| 70 | +$(BOOTSTRAP_OUTDIRS): |
| 71 | + mkdir -p "$@" |
| 72 | + |
| 73 | +$(OUTDIR)/%.html: % $(HEADER) $(TRAILER) $(OUTDIR) |
| 74 | + sed '/<!-- vim:[^:]*: -->/d' $(HEADER) > $@ |
| 75 | + $(TOC) $< $(FILES) >> $@ |
| 76 | + $(PYTHON) $(MD) $(MDARGS) $< >> $@ |
| 77 | + sed '/<!-- vim:[^:]*: -->/d' $(TRAILER) >> $@ |
| 78 | + |
| 79 | +$(OUTDIR)/img/%: assets/% $(OUTDIR)/img |
| 80 | + cp $< $@ |
| 81 | + touch $@ |
| 82 | + |
| 83 | +$(OUTDIR)/bootstrap/%: assets/bootstrap/% $(BOOTSTRAP_OUTDIRS) |
| 84 | + cp $< $@ |
| 85 | + touch $@ |
| 86 | + |
| 87 | +clean: clobber |
| 88 | + |
| 89 | +clobber: |
| 90 | + rm -rf output |
| 91 | + |
| 92 | +FRC: |
0 commit comments