Skip to content

Commit a2a56e5

Browse files
author
Sam Kleinman
committed
build: minor refactor
1 parent cabf049 commit a2a56e5

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

bin/makefile.clean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
archive:$(public-output).$(timestamp).tar.gz
2+
@echo [$@]: created $< $@.
3+
$(public-output).%.tar.gz:$(public-output)
4+
tar -czvf $@ $<
5+
6+
build-ephemera = $(output-tables) $(output)/makefile.* $(output)/*.inv
7+
clean:
8+
-rm -rf $(build-ephemera)
9+
clean-branch:
10+
-rm -rf $(build-ephemera) $(branch-output)/*
11+
clean-public:
12+
-rm -rf $(build-ephemera) $(public-output)/*
13+
clean-all:
14+
-rm -rf $(build-ephemera) $(output)/*

makefile

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Makefile for MongoDB Sphinx documentation
2+
include bin/makefile.compatibility
23
MAKEFLAGS += -j -r --no-print-directory
34

45
# Build directory tweaking.
@@ -29,10 +30,6 @@ help:
2930
@echo " pdfs generates pdfs."
3031

3132
############# makefile includes #############
32-
include bin/makefile.compatibility
33-
include bin/makefile.content
34-
include bin/makefile.push
35-
3633
# Included, dynamically generated makefile sections, to build: sphinx
3734
# targets, LaTeX/PDFs, tables, the installation guides, and sym links.
3835

@@ -54,13 +51,17 @@ $(output)/makefile.intersphinx:bin/makefile-builder/intersphinx.py bin/makefile_
5451
@mkdir -p $(output)
5552
@$(PYTHONBIN) $< $@
5653

54+
include bin/makefile.clean
55+
include bin/makefile.content
56+
include bin/makefile.push
57+
5758
############# Meta targets that control the build and publication process. #############
5859
.PHONY: publish publish-if-up-to-date
5960

6061
publish-if-up-to-date:
6162
@bin/published-build-check $(current-branch) $(last-commit)
6263
@$(MAKE) publish
63-
publish:$(sphinx-content) $(static-content)
64+
publish:$(sphinx-content) $(static-content)
6465
@echo [build]: $(manual-branch) branch is succeessfully deployed to '$(public-output)'.
6566

6667
############# Targets that define the production build process #############
@@ -88,6 +89,7 @@ $(public-branch-output)/ $(public-output)/:
8889
@mkdir -p $@
8990
@echo [build]: created $@
9091
$(public-branch-output):$(branch-output)/dirhtml
92+
@mkdir -p $@
9193
@cp -R $</* $@
9294
@rm -rf $@/meta/reference $@/meta/use-cases
9395
@touch $@
@@ -96,7 +98,8 @@ $(public-branch-output)/single:$(branch-output)/singlehtml
9698
@mkdir -p $@
9799
@cp -R $</* $@
98100
@rm -f $@/contents.html
99-
@echo [single]: migrated singlehtml files '$@'
101+
@touch $@
102+
@echo [build]: migrated '$</*' to '$@'
100103
$(public-branch-output)/single/index.html:$(branch-output)/singlehtml/contents.html
101104
@cp $< $@
102105
@sed $(SED_ARGS_FILE) -e 's/href="contents.html/href="index.html/g' \
@@ -113,7 +116,6 @@ $(output)/sitemap.xml.gz:$(public-branch-output) $(public-output)/manual
113116
@echo [sitemap]: sitemap built at `date`.
114117

115118
############# PDF generation infrastructure. #############
116-
117119
LATEX_CORRECTION = "s/(index|bfcode)\{(.*!*)*--(.*)\}/\1\{\2-\{-\}\3\}/g"
118120
LATEX_LINK_CORRECTION = "s%\\\code\{/%\\\code\{http://docs.mongodb.org/$(current-if-not-manual)/%g"
119121
pdflatex-command = TEXINPUTS=".:$(branch-output)/latex/:" pdflatex --interaction batchmode --output-directory $(branch-output)/latex/ $(LATEXOPTS)
@@ -144,21 +146,7 @@ $(branch-output)/latex/%.tex:
144146
@echo [pdf]: pdf compilation of $@, complete at `date`.
145147

146148
############# General purpose targets. Not used (directly) in the production build #############
147-
build-ephemera = $(output-tables) $(output)/makefile.* $(output)/*.inv
148-
clean:
149-
-rm -rf $(build-ephemera)
150-
clean-branch:
151-
-rm -rf $(build-ephemera) $(branch-output)/*
152-
clean-public:
153-
-rm -rf $(build-ephemera) $(public-output)/*
154-
clean-all:
155-
-rm -rf $(build-ephemera) $(output)/*
156149
draft:draft-html
157-
archive:$(public-output).$(timestamp).tar.gz
158-
@echo [$@]: created $< $@.
159-
$(public-output).%.tar.gz:$(public-output)
160-
tar -czvf $@ $<
161-
162150
# man page support, uses sphinx `man` builder output.
163151
.PHONY:$(manpages)
164152
manpages := $(wildcard $(branch-output)/man/*.1)

0 commit comments

Comments
 (0)