codeql/ruby/Makefile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 строки
2.2 KiB
Makefile
Исходник Обычный вид История

2021-07-12 19:28:50 +03:00
all: extractor dbscheme
ifeq ($(OS),Windows_NT)
EXE = .exe
CODEQL_PLATFORM = win64
else
EXE =
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CODEQL_PLATFORM = linux64
endif
ifeq ($(UNAME_S),Darwin)
CODEQL_PLATFORM = osx64
endif
endif
FILES=codeql-extractor.yml\
tools/qltest.cmd\
tools/index-files.sh\
tools/index-files.cmd\
tools/autobuild.sh\
tools/qltest.sh\
tools/autobuild.cmd\
ql/lib/ruby.dbscheme.stats\
ql/lib/ruby.dbscheme
2021-07-12 19:28:50 +03:00
BIN_FILES=target/release/codeql-extractor-ruby$(EXE)
2021-07-12 19:28:50 +03:00
extractor-common:
2021-08-02 17:12:23 +03:00
rm -rf build
mkdir build
mkdir build/codeql-extractor-ruby
cp codeql-extractor.yml ql/lib/ruby.dbscheme ql/lib/ruby.dbscheme.stats build/codeql-extractor-ruby
2021-07-12 19:28:50 +03:00
cp -r tools build/codeql-extractor-ruby/
.PHONY: tools
tools: $(BIN_FILES)
rm -rf tools/bin
mkdir tools/bin
cp -r target/release/codeql-extractor-ruby$(EXE) tools/bin/extractor$(EXE)
2021-07-12 19:28:50 +03:00
target/release/%$(EXE):
cd extractor && cargo build --release
2021-07-12 19:28:50 +03:00
dbscheme:
cd extractor && cargo build --release
extractor/target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
2021-08-11 17:17:09 +03:00
codeql query format -i ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
2021-07-12 19:28:50 +03:00
.PHONY: extractor
extractor: $(FILES) $(BIN_FILES)
rm -rf extractor-pack
2021-08-02 17:12:23 +03:00
mkdir extractor-pack
mkdir extractor-pack/tools
mkdir extractor-pack/tools/$(CODEQL_PLATFORM)
2021-07-12 19:28:50 +03:00
cp codeql-extractor.yml extractor-pack/codeql-extractor.yml
cp tools/qltest.cmd extractor-pack/tools/qltest.cmd
cp tools/index-files.sh extractor-pack/tools/index-files.sh
cp tools/index-files.cmd extractor-pack/tools/index-files.cmd
cp tools/autobuild.sh extractor-pack/tools/autobuild.sh
cp tools/qltest.sh extractor-pack/tools/qltest.sh
cp tools/autobuild.cmd extractor-pack/tools/autobuild.cmd
cp ql/lib/ruby.dbscheme.stats extractor-pack/ruby.dbscheme.stats
cp ql/lib/ruby.dbscheme extractor-pack/ruby.dbscheme
cp extractor/target/release/codeql-extractor-ruby$(EXE) extractor-pack/tools/$(CODEQL_PLATFORM)/extractor$(EXE)
2021-08-31 15:22:26 +03:00
test: extractor dbscheme
2021-11-23 18:18:33 +03:00
codeql test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path extractor-pack --consistency-queries ql/consistency-queries ql/test