Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Makefile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Recipes use cmd.exe syntax; run with a native GNU make (make or mingw32-make).
SHELL := cmd.exe
TEX := tectonic
OUTDIR := build
CONST_TEX := constitution.tex
CONST_PDF := $(OUTDIR)/constitution.pdf
BYLAW_TEX := bylaws.tex
BYLAW_PDF := $(OUTDIR)/bylaws.pdf

TEX_SOURCES := $(CONST_TEX) $(BYLAW_TEX)

.PHONY: all constitution bylaws open open-bylaws clean watch help

help:
@echo Targets:
@echo make constitution Build constitution PDF ($(CONST_PDF))
@echo make bylaws Build bylaws PDF ($(BYLAW_PDF))
@echo make all Build constitution + bylaws
@echo make open Build and open the constitution PDF
@echo make open-bylaws Build and open the bylaws PDF
@echo make watch Rebuild on file changes (Ctrl+C to stop)
@echo make clean Remove build output

all: constitution bylaws

constitution: $(CONST_PDF)
bylaws: $(BYLAW_PDF)

$(CONST_PDF): $(CONST_TEX)
@if not exist $(OUTDIR) mkdir $(OUTDIR)
$(TEX) -X compile $(CONST_TEX) --outdir $(OUTDIR)

$(BYLAW_PDF): $(BYLAW_TEX)
@if not exist $(OUTDIR) mkdir $(OUTDIR)
$(TEX) -X compile $(BYLAW_TEX) --outdir $(OUTDIR)

open: constitution
start "" "$(subst /,\,$(CONST_PDF))"

open-bylaws: bylaws
start "" "$(subst /,\,$(BYLAW_PDF))"

watch:
@echo Watching .tex files for changes...
@powershell -NoProfile -Command "while ($$true) { & '$(MAKE)' -s all; Start-Sleep -Seconds 1 }"

clean:
@if exist $(OUTDIR)\*.pdf del /q $(OUTDIR)\*.pdf
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ cp Makefile.linux Makefile

# macOS (uses tectonic)
cp Makefile.mac Makefile

# Windows (uses tectonic; in cmd/PowerShell: copy Makefile.windows Makefile)
cp Makefile.windows Makefile
```

Then build:
Expand All @@ -41,14 +44,19 @@ make watch-bylaws # rebuild bylaws on change
```

On Linux this uses `latexmk -pvc`. On macOS it uses `fswatch`
(`brew install fswatch`).
(`brew install fswatch`). On Windows `make watch` re-runs `make all` every second
via PowerShell (there is no separate `watch-bylaws`).

## Toolchain

- **Linux:** [`latexmk`](https://m%67.ctan.org/pkg/latexmk) plus a TeX distribution
- **Linux:** [`latexmk`](https://ctan.org/pkg/latexmk) plus a TeX distribution
(e.g. TeX Live: `sudo apt install texlive-full` or a smaller subset).
- **macOS:** [Tectonic](https://tectonic-typesetting.github.io/)
(`brew install tectonic`) — self-contained, downloads packages on demand.
- **Windows:** Tectonic (`winget install TectonicProject.Tectonic` or
`scoop install tectonic`) plus a native GNU make (`winget install ezwinports.make`,
`scoop install make`, or `mingw32-make`). The Makefile runs its recipes in
`cmd.exe`, so it works from cmd, PowerShell, or Git Bash.

Either toolchain works on either OS; the split just reflects the most common setup
for each. CI builds with Tectonic.
Expand Down
Loading