summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 19 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 051694e9a..218fc4ae1 100644
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,9 @@ LIBS := -lzmq
CFLAGS :=
BUILD_ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH)
J2LINT := $(shell command -v j2lint 2> /dev/null)
-PYLINT_FILES := $(shell git ls-files *.py src/migration-scripts)
+PYLINT_FILES := $(shell git ls-files *.py src/migration-scripts src/services)
LIBVYOSCONFIG_BUILD_PATH := /tmp/libvyosconfig/_build/libvyosconfig.so
+LIBVYOSCONFIG_STATUS := $(shell git submodule status)
config_xml_src = $(wildcard interface-definitions/*.xml.in)
config_xml_obj = $(config_xml_src:.xml.in=.xml)
@@ -23,12 +24,13 @@ op_xml_obj = $(op_xml_src:.xml.in=.xml)
.PHONY: libvyosconfig
.ONESHELL:
libvyosconfig:
- if ! [ -f $(LIBVYOSCONFIG_BUILD_PATH) ]; then
- rm -rf /tmp/libvyosconfig && \
- git clone https://github.com/vyos/libvyosconfig.git /tmp/libvyosconfig || exit 1
- cd /tmp/libvyosconfig && \
- git checkout 55b2d352333e3cfcb54d2057b73cef6ebe8331f9 || exit 1
- eval $$(opam env --root=/opt/opam --set-root) && ./build.sh
+ if test ! -f $(LIBVYOSCONFIG_BUILD_PATH); then
+ if ! echo $(firstword $(LIBVYOSCONFIG_STATUS))|grep -Eq '^[a-z0-9]'; then
+ git submodule sync; git submodule update --init --remote
+ fi
+ rm -rf /tmp/libvyosconfig && mkdir /tmp/libvyosconfig
+ cp -r libvyosconfig /tmp && cd /tmp/libvyosconfig && \
+ eval $$(opam env --root=/opt/opam --set-root) && ./build.sh || exit 1
fi
.PHONY: interface_definitions
@@ -67,7 +69,7 @@ op_mode_definitions: $(op_xml_obj)
find $(BUILD_DIR)/op-mode-definitions/ -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-op-templates {} $(CURDIR)/schema/op-mode-definition.rng $(OP_TMPL_DIR) || exit 1
- $(CURDIR)/python/vyos/xml_ref/generate_op_cache.py --xml-dir $(BUILD_DIR)/op-mode-definitions || exit 1
+ $(CURDIR)/python/vyos/xml_ref/generate_op_cache.py --check-path-ambiguity --xml-dir $(BUILD_DIR)/op-mode-definitions || exit 1
# XXX: tcpdump, ping, traceroute and mtr must be able to recursivly call themselves as the
# options are provided from the scripts themselves
@@ -87,7 +89,14 @@ vyshim:
$(MAKE) -C $(SHIM_DIR)
.PHONY: all
-all: clean libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json
+all: clean copyright libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json
+
+.PHONY: copyright
+copyright:
+ @if git grep -q -E "Copyright( \(C\))? (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers"; then \
+ echo "Error: Legacy copyright notice found."; \
+ exit 1; \
+ fi
.PHONY: clean
clean:
@@ -98,7 +107,7 @@ clean:
.PHONY: test
test: generate-configd-include-json
- set -e; python3 -m compileall -q -x '/vmware-tools/scripts/, /ppp/' .
+ set -e; python3 -m compileall -q -x '/vmware-tools/scripts/' .
PYTHONPATH=python/ python3 -m "nose" --with-xunit src --with-coverage --cover-erase --cover-xml --cover-package src/conf_mode,src/op_mode,src/completion,src/helpers,src/validators,src/tests --verbose
.PHONY: check_migration_scripts_executable