xref: /trunk/Makefile (revision cc42a290e6c9de1a4f4c7a2f95b3d52b3477f4bc)
1*cc42a290SJohn Bampton# Licensed to the Apache Software Foundation (ASF) under one
2*cc42a290SJohn Bampton# or more contributor license agreements.  See the NOTICE file
3*cc42a290SJohn Bampton# distributed with this work for additional information
4*cc42a290SJohn Bampton# regarding copyright ownership.  The ASF licenses this file
5*cc42a290SJohn Bampton# to you under the Apache License, Version 2.0 (the
6*cc42a290SJohn Bampton# "License"); you may not use this file except in compliance
7*cc42a290SJohn Bampton# with the License.  You may obtain a copy of the License at
8*cc42a290SJohn Bampton#
9*cc42a290SJohn Bampton#   http://www.apache.org/licenses/LICENSE-2.0
10*cc42a290SJohn Bampton#
11*cc42a290SJohn Bampton# Unless required by applicable law or agreed to in writing,
12*cc42a290SJohn Bampton# software distributed under the License is distributed on an
13*cc42a290SJohn Bampton# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14*cc42a290SJohn Bampton# KIND, either express or implied.  See the License for the
15*cc42a290SJohn Bampton# specific language governing permissions and limitations
16*cc42a290SJohn Bampton# under the License.
17*cc42a290SJohn Bampton
18*cc42a290SJohn BamptonPYTHON := $(shell command -v python || command -v python3 || echo python)
19*cc42a290SJohn BamptonPIP := $(PYTHON) -m pip
20*cc42a290SJohn Bampton
21*cc42a290SJohn Bampton.PHONY: check checkinstall checkupdate install
22*cc42a290SJohn Bampton
23*cc42a290SJohn Bamptoncheck: checkinstall
24*cc42a290SJohn Bampton    @echo "Running pre-commit checks..."
25*cc42a290SJohn Bampton    pre-commit run --all-files
26*cc42a290SJohn Bampton
27*cc42a290SJohn Bamptoncheckinstall: install
28*cc42a290SJohn Bampton    @echo "Installing pre-commit hooks..."
29*cc42a290SJohn Bampton    pre-commit install
30*cc42a290SJohn Bampton
31*cc42a290SJohn Bamptoncheckupdate:
32*cc42a290SJohn Bampton    @echo "Updating pre-commit hooks..."
33*cc42a290SJohn Bampton    pre-commit autoupdate
34*cc42a290SJohn Bampton
35*cc42a290SJohn Bamptoninstall:
36*cc42a290SJohn Bampton    @echo "Installing dependencies..."
37*cc42a290SJohn Bampton    @if [ -f requirements-dev.txt ]; then \
38*cc42a290SJohn Bampton        $(PIP) install -r requirements-dev.txt; \
39*cc42a290SJohn Bampton    else \
40*cc42a290SJohn Bampton        echo "Error: requirements-dev.txt not found."; \
41*cc42a290SJohn Bampton        exit 1; \
42*cc42a290SJohn Bampton    fi
43