11SBLG = sblg
2- PREFIX = $(HOME ) /profanity
3- BLOG_POST_SRC_DIR = blogsource/content/post
4- BLOG_POST_OUT_DIR = blog
2+ PREFIX = $(PWD ) /site
3+ BLOG_SRC_TOP_DIR = blogsource/content
4+ BLOG_POST_SRC_DIR = $(BLOG_SRC_TOP_DIR ) /post
5+ BLOG_POST_OUT_TOP_DIR = blog
6+ BLOG_POST_OUT_DIR = $(BLOG_POST_OUT_TOP_DIR ) /post
57BLOG_POSTS = $(wildcard $(BLOG_POST_SRC_DIR ) /* .md)
68BLOG_POSTS_OUT = $(subst $(BLOG_POST_SRC_DIR ) , $(BLOG_POST_OUT_DIR ) , $(BLOG_POSTS:.md=.html ) )
79CONTRIBUTORS_SRC_DIR = blogsource/content/contributors
810CONTRIBUTORS_OUT_DIR = contributors
911CONTRIBUTORS = $(wildcard $(CONTRIBUTORS_SRC_DIR ) /* .md)
1012PAGES_SRC_DIR = pagesource
11- PAGES = $(wildcard $(PAGE_SRC_DIR ) /* .xml)
12- PAGES_OUT = $(subst $(PAGES_SRC_DIR ) ,, $( PAGES :.xml=.html ) )
13+ PAGES_SRC = $(wildcard $(PAGES_SRC_DIR ) /* .xml)
14+ PAGES = $(subst $(PAGES_SRC_DIR ) /,, $( PAGES_SRC :.xml=.html ) )
1315REDIRECTS_DIR = pageredirects
1416REDIRECTS_SRC = $(wildcard $(REDIRECTS_DIR ) /* .html)
1517REDIRECTS = $(subst $(REDIRECTS_DIR ) /,,$(REDIRECTS_SRC ) )
1618
17- all : index.html $(PAGES_OUT ) themegallery.html $(BLOG_POSTS_OUT ) $(BLOG_POST_OUT_DIR ) /atom.xml \
19+ all : index.html $(PAGES ) themegallery.html $(BLOG_POSTS_OUT ) $(BLOG_POST_OUT_DIR ) /atom.xml \
1820 $(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html $(REDIRECTS)
1921
20- install : index.html $(PAGES_OUT ) themegallery.html $(BLOG_POSTS_OUT ) $(BLOG_POST_OUT_DIR ) /atom.xml \
22+ install : index.html $(PAGES ) themegallery.html $(BLOG_POSTS_OUT ) $(BLOG_POST_OUT_DIR ) /atom.xml \
2123 $(BLOG_POST_OUT_DIR ) /index.html $(CONTRIBUTORS_OUT ) $(CONTRIBUTORS_OUT_DIR ) /index.html $(REDIRECTS )
2224 mkdir -p $(PREFIX )
2325 install -m0444 * .html $(PREFIX )
24- install -m0444 -p -D -t $(PREFIX ) /blog blog/* .html
25- install -m0444 -p -D -t $(PREFIX ) /blog/img blog/img/* .png
26- install -m0444 -p -D -t $(PREFIX ) /contributors contributors/* .html
27- install -m0444 -p -D -t $(PREFIX ) /contributors/img contributors/img/* jpg
26+ install -m0444 -p -D -t $(PREFIX ) /$(BLOG_POST_OUT_TOP_DIR ) $(BLOG_POST_OUT_TOP_DIR ) /index.html
27+ install -m0444 -p -D -t $(PREFIX ) /$(BLOG_POST_OUT_DIR ) $(BLOG_POST_OUT_DIR ) /* .html
28+ install -m0444 -p -D -t $(PREFIX ) /$(BLOG_POST_OUT_DIR ) /img $(BLOG_POST_OUT_DIR ) /img/* .png
29+ install -m0444 -p -D -t $(PREFIX ) /$(CONTRIBUTORS_OUT_DIR ) $(CONTRIBUTORS_OUT_DIR ) /* .html
30+ install -m0444 -p -D -t $(PREFIX ) /$(CONTRIBUTORS_OUT_DIR ) /img $(CONTRIBUTORS_OUT_DIR ) /img/* jpg
2831 cp -p -r css $(PREFIX )
2932 cp -p -r guide $(PREFIX )
3033 cp -p -r images $(PREFIX )
3134 cp -p -r js $(PREFIX )
3235 cp -p -r plugins $(PREFIX )
3336 cp -p -r tarballs $(PREFIX )
3437
38+
3539index.html : landing-template.xml
3640 $(SBLG ) -o $@ -t landing-template.xml -c index.xml
3741
38- $(PAGES_OUT ) : manual-template.xml
39- $(SBLG ) -o $@ -t manual-template.xml -c $(addprefix $PAGES_SRC_DIR) /,($( subst .html,.xml,$@ ) )
42+ $(PAGES ) : manual-template.xml
43+ cp --preserve=mode,ownership,timestamps $(addprefix $(PAGES_SRC_DIR ) /,$(@:.html=.xml ) ) .
44+ $(SBLG ) -o $@ -t manual-template.xml -c $(@:.html=.xml )
45+ rm -f $(PAGES:.html=.xml )
4046
4147themegallery.html : gallery-template.xml
4248 $(SBLG ) -o $@ -t gallery-template.xml -c themegallery.xml
4349
4450$(BLOG_POST_OUT_DIR ) /atom.xml $(BLOG_POST_OUT_DIR ) /index.html $(BLOG_POSTS_OUT ) : $(BLOG_POSTS )
4551 $(MAKE ) -C $(BLOG_POST_SRC_DIR )
46- mkdir $(BLOG_POST_OUT_DIR )
52+ mkdir -p $(BLOG_POST_OUT_DIR )
53+ cp --preserve=mode,ownership,timestamps $(BLOG_SRC_TOP_DIR ) /index.html $(BLOG_POST_OUT_TOP_DIR ) /
4754 mv $(BLOG_POST_SRC_DIR ) /* .html $(BLOG_POST_OUT_DIR ) /
4855 mv $(BLOG_POST_SRC_DIR ) /atom.xml $(BLOG_POST_OUT_DIR ) /
4956 cp --preserve=mode,ownership,timestamps --recursive $(BLOG_POST_SRC_DIR ) /img $(BLOG_POST_OUT_DIR ) /
@@ -62,6 +69,6 @@ $(REDIRECTS): $(REDIRECTS_SRC)
6269clean :
6370 $(MAKE ) -C $(BLOG_POST_SRC_DIR ) clean
6471 $(MAKE ) -C $(CONTRIBUTORS_SRC_DIR ) clean
65- rm -f index.html $(PAGES_OUT ) themegallery.html $(REDIRECTS )
66- rm -r $(BLOG_POSTS_XML ) $(BLOG_POSTS_OUT ) $(BLOG_POST_OUT_DIR )
72+ rm -f index.html $(PAGES ) themegallery.html $(REDIRECTS )
73+ rm -r $(BLOG_POSTS_XML ) $(BLOG_POSTS_OUT ) $(BLOG_POST_OUT_TOP_DIR )
6774 rm -r $(CONTRIBUTORS_XML ) $(CONTRIBUTORS_OUT ) $(CONTRIBUTORS_OUT_DIR )
0 commit comments