-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 1.26 KB
/
Makefile
File metadata and controls
39 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
VERSION := $(shell grep '^version' typst.toml | awk -F ' = ' '{print $$2}' | tr -d '"')
PACKAGE_NAME := $(shell grep '^name' typst.toml | awk -F ' = ' '{print $$2}' | tr -d '"')
TARGET_DIR=./$(PACKAGE_NAME)/$(VERSION)
check:
typst compile ./lib.typ
rm ./lib.pdf
link :
mkdir -p ~/.cache/typst/packages/preview/alchemist
ln -s "$(CURDIR)" ~/.cache/typst/packages/preview/alchemist/$(VERSION)
clean-link:
rm -rf ~/.cache/typst/packages/preview/alchemist
module:
mkdir -p $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/src
cp ./typst.toml $(TARGET_DIR)/typst.toml
cp ./LICENSE $(TARGET_DIR)/
cp ./lib.typ $(TARGET_DIR)/
cp -r ./src/* $(TARGET_DIR)/src/
awk '{gsub("https://typst.app/universe/package/alchemist", "https://github.com/Typsium/alchemist");print}' ./README.md > $(TARGET_DIR)/README.md
manual:
typst compile ./doc/manual.typ --root .
watch:
typst watch ./doc/manual.typ --root .
test:
tt run -F -j15
# Target to bump the version in lib.typ and all files in /src
CETZ_VERSION ?= 0.4.2
bump-cetz:
perl -pi -e 's/cetz:[0-9]+\.[0-9]+\.[0-9]+/cetz:$(CETZ_VERSION)/g' ./lib.typ
find ./src -type f -exec perl -pi -e 's/cetz:[0-9]+\.[0-9]+\.[0-9]+/cetz:$(CETZ_VERSION)/g' {} +
find ./tests/* -type f -exec perl -pi -e 's/cetz:[0-9]+\.[0-9]+\.[0-9]+/cetz:$(CETZ_VERSION)/g' {} +