Skip to content
Snippets Groups Projects
Commit aa30d328 authored by Patrick Baudin's avatar Patrick Baudin
Browse files

change 'xargs --null' -> 'xargs -0'

parent 60561f29
No related branches found
No related tags found
No related merge requests found
...@@ -52,17 +52,21 @@ TO_UTF8 ?= iconv -t UTF-8 -f ...@@ -52,17 +52,21 @@ TO_UTF8 ?= iconv -t UTF-8 -f
OCP_INDENT ?= ocp-indent OCP_INDENT ?= ocp-indent
CLANG_FORMAT ?= clang-format CLANG_FORMAT ?= clang-format
# wc, tail, head, cmp
# Default values necessary for # Default values necessary for
# LINT_MAKEFILE=<this-makefile> make -f <this-makefile> <lint-target>` # LINT_MAKEFILE=<this-makefile> make -f <this-makefile> <lint-target>`
# Otherwise theses variables are defined into share/Makefile.common # Otherwise theses variables are defined into share/Makefile.common
SED ?= LC_ALL=C sed SED ?= LC_ALL=C sed
ISED ?= sed -i ISED ?= sed -i
FIND ?= find
GIT ?= git GIT ?= git
MKDIR ?= mkdir -p MKDIR ?= mkdir -p
MV ?= mv MV ?= mv
RM ?= rm -f RM ?= rm -f
RMDIR ?= rm -rf
TOUCH ?= touch TOUCH ?= touch
XARGS ?= xargs --no-run-if-empty
############ ############
...@@ -136,7 +140,7 @@ endif ...@@ -136,7 +140,7 @@ endif
.PHONY: clean-lint .PHONY: clean-lint
clean-lint: clean-lint:
echo "Cleaning LINT targets..." echo "Cleaning LINT targets..."
rm -rf .lint $(RMDIR) .lint
clean:: clean-lint clean:: clean-lint
...@@ -157,7 +161,7 @@ LINT.clean-targets+= \ ...@@ -157,7 +161,7 @@ LINT.clean-targets+= \
# Generic rule # Generic rule
$(LINT.clean-targets): $(LINT.clean-targets):
echo "[LINT] Cleaning $(patsubst clean-%,%,$@) targets..." echo "[LINT] Cleaning $(patsubst clean-%,%,$@) targets..."
find .lint -type f -name \*.$(patsubst clean-%,%,$@) | xargs -n 10 $(RM) $(FIND) .lint -type f -name \*.$(patsubst clean-%,%,$@) | $(XARGS) -n 10 $(RM)
############################### ###############################
...@@ -180,7 +184,7 @@ $(LINT.check-targets): ...@@ -180,7 +184,7 @@ $(LINT.check-targets):
$(GIT) ls-files $(LINT.dir) -z \ $(GIT) ls-files $(LINT.dir) -z \
| $(GIT) check-attr --stdin -z $@ \ | $(GIT) check-attr --stdin -z $@ \
| $(SED) -zne 'x;n;n;s/^set$$//;t print;b;:print;x;p' \ | $(SED) -zne 'x;n;n;s/^set$$//;t print;b;:print;x;p' \
| xargs --null -IXX sh -c '$(LINT.make) LINT_FILE="XX" $@ || exit 255' | $(XARGS) -0 -IXX sh -c '$(LINT.make) LINT_FILE="XX" $@ || exit 255'
#### fix-XXX targets #### fix-XXX targets
...@@ -195,7 +199,7 @@ $(LINT.fix-targets): ...@@ -195,7 +199,7 @@ $(LINT.fix-targets):
$(GIT) ls-files $(LINT.dir) -z \ $(GIT) ls-files $(LINT.dir) -z \
| $(GIT) check-attr --stdin -z $(patsubst fix-%,check-%,$@) \ | $(GIT) check-attr --stdin -z $(patsubst fix-%,check-%,$@) \
| $(SED) -zne 'x;n;n;s/^set$$//;t print;b;:print;x;p' \ | $(SED) -zne 'x;n;n;s/^set$$//;t print;b;:print;x;p' \
| xargs --null -IXX sh -c '$(LINT.make) LINT_FILE="XX" $@ || exit 255' | $(XARGS) -0 -IXX sh -c '$(LINT.make) LINT_FILE="XX" $@ || exit 255'
else # LINT_FILE are given else # LINT_FILE are given
......
...@@ -24,11 +24,24 @@ ...@@ -24,11 +24,24 @@
# TESTING # # TESTING #
########### ###########
################################
## Default variables
# Defines where to find the ptest_config files # Defines where to find the ptest_config files
PURGED_PTEST_DIRS?=tests $(wildcard src/plugins/*/tests) PURGED_PTEST_DIRS?=tests $(wildcard src/plugins/*/tests)
PTEST_OPTS?= PTEST_OPTS?=
PTEST_DIRS?=$(PURGED_PTEST_DIRS) PTEST_DIRS?=$(PURGED_PTEST_DIRS)
############
# Default values necessary for make -f <this-makefile>
XARGS ?= xargs --no-run-if-empty
GREP ?= grep
RM ?= rm -f
RMDIR ?= rm -rf
##########################################################################
# Defines the related dune targets # Defines the related dune targets
PTEST_ALIASES=$(addsuffix /ptests,$(addprefix @, tests src/plugins)) PTEST_ALIASES=$(addsuffix /ptests,$(addprefix @, tests src/plugins))
# TODO: uncomments when a dune file is at least generated for all PTEST_DIRS # TODO: uncomments when a dune file is at least generated for all PTEST_DIRS
...@@ -58,7 +71,7 @@ else ...@@ -58,7 +71,7 @@ else
# PTESTS is internal # PTESTS is internal
PTESTS=dune exec $(DUNE_BUILD_OPTS) --root ptests -- frama-c-ptests PTESTS=dune exec $(DUNE_BUILD_OPTS) --root ptests -- frama-c-ptests
#PTESTS=dune exec --root ptests -- frama-c-ptests -v #PTESTS=dune exec $(DUNE_BUILD_OPTS) --root ptests -- frama-c-ptests -v
# Note: the public name of ptest.exe is frama-c-ptests # Note: the public name of ptest.exe is frama-c-ptests
$(FRAMAC_PTESTS): ptests/ptests.ml $(FRAMAC_PTESTS): ptests/ptests.ml
...@@ -96,18 +109,18 @@ wtests-help: ...@@ -96,18 +109,18 @@ wtests-help:
$(WTESTS) --help $(WTESTS) --help
########################################################################## ##########################################################################
## Removes all dune files generated for testing: xargs -n 10 avoids a too long line ## Removes all dune files generated for testing
.PHONY: purge-tests .PHONY: purge-tests
purge-tests: purge-tests:
find $(PURGED_PTEST_DIRS) -name dune \ find $(PURGED_PTEST_DIRS) -name dune \
| grep -e "/oracle.*/dune\|/result.*/dune" \ | $(GREP) -e "/oracle.*/dune\|/result.*/dune" \
| xargs --no-run-if-empty -n 10 rm | $(XARGS) -n 10 $(RM)
# Force the full cleaning of the testing environment # Force the full cleaning of the testing environment
.PHONY: clean-tests .PHONY: clean-tests
clean-tests: purge-tests clean-tests: purge-tests
rm -rf $(addprefix _build/default/,$(PURGED_PTEST_DIRS)) $(RMDIR) $(addprefix _build/default/,$(PURGED_PTEST_DIRS))
########################################################################## ##########################################################################
## Generates all dune files used for testing ## Generates all dune files used for testing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment