-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 1.86 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright (c) 2019-2020 SRI International.
# All rights reserved.
#
# This file is part of the Parsley parser.
#
# Parsley is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Parsley is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Get docker path or an empty string
DOCKER := $(shell command -v docker)
# Try to detect current branch if not provided from environment
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
# Commit hash from git
COMMIT=$(shell git rev-parse --short HEAD)
.PHONY: all release clean test fmt
all:
cargo build
release:
cargo build --release
test:
cargo test
# Requires cargo install afl
kuduafl:
RUSTFLAGS="-A unused_imports" cargo afl build --features kuduafl --target-dir target/kudu
runafl:
cargo afl fuzz -i tests/test_files -o out target/kudu/debug/pdf_printer
fmt:
cargo +nightly fmt
clippy:
cargo clippy
clean:
cargo clean
# Test if the dependencies we need to run this Makefile are installed
deps:
ifndef DOCKER
@echo "Docker is not available. Please install docker"
@exit 1
endif
docker: deps release etc/docker/Dockerfile
docker build --build-arg=COMMIT=$(COMMIT) --build-arg=BRANCH=$(BRANCH) -t 'pdf_printer' -f etc/docker/Dockerfile .
docker tag pdf_printer safedocs-ta2-docker.cse.sri.com/pdf_printer:latest
deploy: docker
docker push safedocs-ta2-docker.cse.sri.com/pdf_printer:latest