-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (93 loc) · 3.64 KB
/
Copy pathMakefile
File metadata and controls
120 lines (93 loc) · 3.64 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
all: | Makefile.config
$(MAKE) common texpresso texpresso-xetex
@echo "# Build succeeded."
@echo "# TeXpresso detects package providers (TeXlive or Tectonic) by looking in PATH:"
@echo "# - it defaults to Tectonic if the 'tectonic' command is available"
@echo "# - it falls back to TeXlive if the 'kpsewhich' command is available"
@echo "# A provider can be selected manually by passing the '-texlive' or '-tectonic' flags."
@echo "#"
@echo "# When using tectonic, first time launch needs to download many files and can be slow."
@echo "# You can speed-up this process using:"
@echo "# make fill-tectonic-cache"
@echo "#"
@echo "# After, you can try texpresso by running:"
@echo "# build/texpresso test/simple.tex"
@echo "#"
@echo "# Or:"
@echo "# build/texpresso -texlive test/simple.tex"
@echo "# build/texpresso -tectonic test/simple.tex"
common: | Makefile.config
$(MAKE) -C src/common
texpresso: | Makefile.config
$(MAKE) -C src/frontend texpresso
dev: | Makefile.config
$(MAKE) -C src texpresso-dev
debug: | Makefile.config
$(MAKE) -C src texpresso-debug texpresso-debug-proxy
clean:
rm -rf build/*/*
distclean:
rm -rf build Makefile.config
re2c:
$(MAKE) -C src/dvi $@
test-utfmapping:
mkdir -p build
gcc -g -o build/test_utf_mapping test/test_utf_mapping.c
build/test_utf_mapping &> test/test_utf_mapping.output
git diff --exit-code test/test_utf_mapping.output
UNAME := $(shell uname)
Makefile.config: Makefile
$(MAKE) config
ifeq ($(UNAME), Linux)
config:
mkdir -p build/objects
# LDCC: some Linux distribution build mupdf with C++ dependencies,
echo >Makefile.config "CFLAGS=-O2 -ggdb -I. -fPIC"
echo >>Makefile.config 'CC=gcc $$(CFLAGS)'
echo >>Makefile.config 'LDCC=g++ $$(CFLAGS)'
echo >>Makefile.config "LIBS=-lmupdf -lm `CC=gcc ./mupdf-config.sh` -lz -ljpeg -lharfbuzz -lfreetype -lSDL2"
endif
ifeq ($(UNAME), Darwin)
BREW=$(shell brew --prefix)
BREW_ICU4C=$(shell brew --prefix icu4c)
config:
mkdir -p build/objects
echo >Makefile.config "CFLAGS=-O2 -ggdb -I. -fPIC -I$(BREW)/include"
echo >>Makefile.config 'CC=gcc $$(CFLAGS)'
echo >>Makefile.config 'LDCC=g++ $$(CFLAGS)'
echo >>Makefile.config "LIBS=-L$(BREW)/lib -lmupdf -lm `CC=gcc ./mupdf-config.sh -L$(BREW)/lib` -lz -ljpeg -lharfbuzz -lfreetype -lSDL2"
endif
texpresso-xetex:
$(MAKE) -C src/engine
compile_commands.json:
bear -- $(MAKE) -B -k all
fill-tectonic-cache:
tectonic --outfmt fmt test/format.tex
tectonic --outfmt xdv test/simple.tex
test-texlive:
build/texpresso-xetex -texlive test/simple.tex
rm simple.aux simple.log simple.xdv
test-tectonic:
build/texpresso-xetex -tectonic test/simple.tex
rm simple.aux simple.log simple.xdv
test-open-base64:
printf '(open-base64 "test/simple.tex" "%s")\n' "$$(base64 < test/simple.tex | tr -d '\n')" | \
env SDL_VIDEODRIVER=dummy build/texpresso -test-initialize test/simple.tex
test-texpresso:
env SDL_VIDEODRIVER=dummy build/texpresso -test-initialize test/simple.tex
test-texpresso-texlive:
env SDL_VIDEODRIVER=dummy build/texpresso -texlive -test-initialize test/simple.tex
test-texpresso-tectonic:
env SDL_VIDEODRIVER=dummy build/texpresso -tectonic -test-initialize test/simple.tex
test-stream:
bash test/test_stream.sh
test-register:
bash test/test-register.sh
test-lookup-file:
bash test/test-lookup-file.sh
test-rerun:
bash test/test-rerun.sh
macos-app: texpresso
@[ "$$(uname)" = "Darwin" ] || { echo "macos-app requires macOS"; exit 1; }
bash scripts/build-macos-app.sh
.PHONY: all dev clean config texpresso common texpresso-xetex re2c compile_commands.json fill-tectonic-cache test-texlive test-tectonic test-texpresso test-stream test-open-base64 test-register test-lookup-file test-rerun macos-app