summaryrefslogblamecommitdiff
path: root/makefile
blob: 386f15181ab9752e5f77d6caeedb75fe52bf5eff (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                           
                                             







                                                                             

           
                                                   




















                             
 
                 
                          
 
                                                              

                                     
                                                                                                                                                

                     
                         
 
                                                                          

                                       
                                                                                                                    


                     
MD = $(shell find md/ -type f -name '*.md')
CSS = $(shell find md/ -type f -name '*.css')
JPG = $(shell find md/ -type f -name '*.jpg')
PNG = $(shell find md/ -type f -name '*.png')

CSS_OUT = $(patsubst md/%.css, html/%.css, $(CSS))
JPG_OUT = $(patsubst md/%.jpg, html/%.jpg, $(JPG))
PNG_OUT = $(patsubst md/%.png, html/%.png, $(PNG))
53HORNET_OUT = $(patsubst md/53hor.net/%.md, html/53hor.net/%.html, $(MD))
ATC_OUT = $(patsubst md/atc.53hor.net/%.md, html/atc.53hor.net/%.html, $(MD))

.PHONY: all
all: css img 53hor.net atc.53hor.net alsplusatc.net

.PHONY: css
css: $(CSS_OUT)

html/%.css: md/%.css
	@echo "css: $< -> $@"
	@mkdir -p "$(@D)"
	@cp "$<" "$@"

.PHONY: img
img: $(JPG_OUT) $(PNG_OUT)

html/%.jpg: md/%.jpg
	@echo "img: $< -> $@"
	@mkdir -p "$(@D)"
	@cp "$<" "$@"

html/%.png: md/%.png
	@echo "img: $< -> $@"
	@mkdir -p "$(@D)"
	@cp "$<" "$@"

.PHONY: 53hor.net
53hor.net: $(53HORNET_OUT)

html/53hor.net/%.html: md/53hor.net/%.md md/53hor.net/nav.html
	@echo   "53hor.net: $< -> $@"
	@mkdir -p "$(@D)"
	@pandoc "$<" -f markdown -t html5 -s --toc --toc-depth=2 -H md/53hor.net/background.html -B md/53hor.net/nav.html -c /styles.css -o "$@"

.PHONY: atc.53hor.net
atc.53hor.net: $(ATC_OUT)

html/atc.53hor.net/%.html: md/atc.53hor.net/%.md md/atc.53hor.net/nav.html
	@echo "atc.53hor.net: $< -> $@"
	@mkdir -p "$(@D)"
	@pandoc "$<" -f markdown -t html5 -s --toc --toc-depth=3 -B md/atc.53hor.net/nav.html -c /styles.css -o "$@"

clean:
	@rm -rf html/