-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (38 loc) · 1.11 KB
/
Makefile
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
TARGET := jknit.out
CPP := g++ -std=c++20 -O3 -pedantic -Wall -g
GLOBAL_DEPS := engine.hpp md_engine.hpp tex_engine.hpp
.PHONY: install
install: $(TARGET)
strip --strip-all $(TARGET) -o $(TARGET).stripped.out
sudo cp $(TARGET).stripped.out /usr/bin/$(TARGET:.out=)
sudo cp -r compilation-drivers /usr/include
sudo chmod +x /usr/include/compilation-drivers/*
.PHONY: debug-install
debug-install: $(TARGET)
sudo cp $(TARGET) /usr/bin/$(TARGET:.out=)
sudo cp -r compilation-drivers /usr/include
sudo chmod +x /usr/include/compilation-drivers/*
.PHONY: uninstall
uninstall:
sudo rm -rf /usr/bin/$(TARGET:.out=) \
/usr/include/compilation-drivers
.PHONY: clean
clean:
rm -f *.o *.out *.log *.png *.aux *.pdf a.*
.PHONY: format
format:
find . -type f \( -iname "*.cpp" -or -iname "*.hpp" \) \
-exec clang-format -i "{}" \;
.PHONY: test
test:
for CASE in demo demo2 demo3 ; \
do \
cd demos ; \
jknit $$CASE.jmd -o $$CASE.md ; \
jknit $$CASE.jmd -o $$CASE.tex ; \
pdflatex $$CASE.tex ; \
done
$(TARGET): main.o engine.o md_engine.o tex_engine.o
$(CPP) -o $@ $^
%.o: %.cpp $(GLOBAL_DEPS)
$(CPP) -c -o $@ $<