forked from sanssecours/Yan-LR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 903 Bytes
/
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
GRAMMAR := YAML
PARSER := Build/badger
export ASAN_OPTIONS := detect_leaks=1,detect_container_overflow=0
export CC := /usr/local/opt/llvm/bin/clang
export CXX := /usr/local/opt/llvm/bin/clang++
.PHONY: compile clean configure test
all: lint
lint: run
@printf '\n✨ Lint\n'
@oclint -p Build -no-analytics -enable-global-analysis \
-enable-clang-static-analyzer Source/*.cpp
run: test
@printf '\n🏃🏼♂️ Run\n\n'
@sed -nE "s~(^[^'][^=]+)=(.*)~s/<\2>/<\1>/~p" Build/$(GRAMMAR).tokens > \
Build/$(GRAMMAR).sed
@set -o pipefail; $(PARSER) Input/Null.yaml | sed -f Build/$(GRAMMAR).sed
test: compile
@printf '\n🐛 Test\n\n'
@Test/test.fish
compile:
@printf '👷🏽♀️ Build\n\n'
@ninja -C Build | sed -e 's~\.\./~~'
configure:
@mkdir -p Build
@cd Build; cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
clean:
@printf '🗑 Clean\n'
@rm -rf Build