代码拉取完成,页面将自动刷新
#
# 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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。