1 Star 3 Fork 0

个人收藏室/semgrep

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
#
# This makefile is targeted at developers.
# For a one-shot production build, look into Dockerfile.
#
# Used to select commands with different usage under GNU/Linux and *BSD/Darwin
# such as 'sed'.
ifeq ($(shell uname -s),Linux)
LINUX = true
else
LINUX = false
endif
# :(
ifeq ($(LINUX),true)
SED = sed -i -e
else
SED = sed -i ''
endif
# Routine build. It assumes all dependencies and configuration are already
# in place and correct. It should be fast since it's called often during
# development.
#
.PHONY: build
build:
$(MAKE) build-spacegrep
$(MAKE) build-core
cd semgrep && pipenv install --dev
.PHONY: install
install:
$(MAKE) -C spacegrep install
$(MAKE) -C semgrep-core install
python3.7 -m pip install semgrep
.PHONY: build-core
build-core: build-ocaml-tree-sitter
$(MAKE) -C semgrep-core
.PHONY: build-ocaml-tree-sitter
build-ocaml-tree-sitter:
$(MAKE) -C ocaml-tree-sitter
$(MAKE) -C ocaml-tree-sitter install
.PHONY: build-spacegrep
build-spacegrep:
$(MAKE) -C spacegrep
# Update and rebuild everything within the project.
#
# At the moment, this is useful when ocaml-tree-sitter get updated,
# since semgrep-core is not rebuilt automatically when they change.
#
.PHONY: rebuild
rebuild:
git submodule update --init --recursive
-$(MAKE) clean
$(MAKE) config
$(MAKE) build
# This is a best effort to install some external dependencies.
# Should run infrequently.
#
.PHONY: setup
setup:
git submodule update --init --recursive
opam update -y
opam install -y --deps-only ./semgrep-core/pfff
cd ocaml-tree-sitter && ./scripts/install-tree-sitter-lib
opam install -y --deps-only ./ocaml-tree-sitter
opam install -y --deps-only ./semgrep-core
opam install -y --deps-only ./spacegrep
# Install development dependencies in addition to build dependencies.
#
.PHONY: dev-setup
dev-setup:
$(MAKE) setup
opam install -y --deps-only ./semgrep-core/dev
# This needs to run initially or when something changed in the external
# build environment. This typically looks for the location of libraries
# and header files outside of the project.
#
.PHONY: config
config:
cd ocaml-tree-sitter && ./configure
# Remove from the project tree everything that's not under source control
# and was not created by 'make setup'.
#
.PHONY: clean
clean:
-$(MAKE) -C ocaml-tree-sitter clean
-$(MAKE) -C semgrep-core clean
-$(MAKE) -C semgrep clean
# Same as 'make clean' but may remove additional files, such as external
# libraries installed locally.
#
# Specifically, this removes all files that are git-ignored. New source files
# are preserved, so this command is considered safe.
#
.PHONY: gitclean
gitclean:
git clean -dfX
git submodule foreach --recursive git clean -dfX
.PHONY: bump
bump:
$(SED) 's/__VERSION__ = ".*"/__VERSION__ = "$(SEMGREP_VERSION)"/g' semgrep/semgrep/__init__.py
$(SED) 's/^ install_requires=\["semgrep==.*"\],$$/ install_requires=["semgrep==$(SEMGREP_VERSION)"],/g' setup.py
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/software-reverse-engineering/semgrep.git
[email protected]:software-reverse-engineering/semgrep.git
software-reverse-engineering
semgrep
semgrep
EJ-2307-php-metavar

搜索帮助