-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 1.14 KB
/
Makefile
File metadata and controls
41 lines (32 loc) · 1.14 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
.PHONY: clean create-proto compile-proto run
install-protoc-linux:
sudo apt-get update
sudo apt-get install -y protobuf-compiler
export PATH="$PATH:$(go env GOPATH)/bin"
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
protoc --version
clean-output-java:
rm -rf ./output/java/*
clean-output-golang:
rm -rf ./output/golang/*
clean-output-proto:
rm -rf ./output/proto/*
clean-bin:
rm -rf ./bin/*
clean-docs:
rm -rf ./docs/*
clean-all: clean-output clean-bin clean-docs
build-docs: clean-docs
go run doc-generator/doc-generator.go
build-project: clean-bin
mkdir -p ./bin/
go build -o ./bin/ocsf-tool
test-compile-proto: clean-output-java clean-output-golang
mkdir -p ./output/java
mkdir -p ./output/golang
find ./output/proto -type f -name "*.proto" | xargs protoc --proto_path=./output/proto --java_out=./output/java --go_opt=paths=source_relative --go_out=./output/golang
test-create-proto: clean-output-proto
# ./bin/ocsf-tool config extensions linux
# ./bin/ocsf-tool config profiles cloud container
./bin/ocsf-tool generate-proto file_activity security_finding
run: build-docs build-project test-create-proto test-compile-proto