mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-04 16:44:08 +00:00
Merge pull request #4974 from YosysHQ/micko/config_exitcode
yosys-config: Propagate exit code for help command
This commit is contained in:
commit
1cfe1e2813
4
Makefile
4
Makefile
|
@ -1049,7 +1049,7 @@ define DOC_USAGE_STDERR
|
||||||
docs/source/generated/$(1): $(TARGETS) docs/source/generated FORCE
|
docs/source/generated/$(1): $(TARGETS) docs/source/generated FORCE
|
||||||
-$(Q) ./$(PROGRAM_PREFIX)$(1) --help 2> $$@
|
-$(Q) ./$(PROGRAM_PREFIX)$(1) --help 2> $$@
|
||||||
endef
|
endef
|
||||||
DOCS_USAGE_STDERR := yosys-config yosys-filterlib
|
DOCS_USAGE_STDERR := yosys-filterlib
|
||||||
|
|
||||||
# The in-tree ABC (yosys-abc) is only built when ABCEXTERNAL is not set.
|
# The in-tree ABC (yosys-abc) is only built when ABCEXTERNAL is not set.
|
||||||
ifeq ($(ABCEXTERNAL),)
|
ifeq ($(ABCEXTERNAL),)
|
||||||
|
@ -1063,7 +1063,7 @@ define DOC_USAGE_STDOUT
|
||||||
docs/source/generated/$(1): $(TARGETS) docs/source/generated
|
docs/source/generated/$(1): $(TARGETS) docs/source/generated
|
||||||
$(Q) ./$(PROGRAM_PREFIX)$(1) --help > $$@ || rm $$@
|
$(Q) ./$(PROGRAM_PREFIX)$(1) --help > $$@ || rm $$@
|
||||||
endef
|
endef
|
||||||
DOCS_USAGE_STDOUT := yosys yosys-smtbmc yosys-witness
|
DOCS_USAGE_STDOUT := yosys yosys-smtbmc yosys-witness yosys-config
|
||||||
$(foreach usage,$(DOCS_USAGE_STDOUT),$(eval $(call DOC_USAGE_STDOUT,$(usage))))
|
$(foreach usage,$(DOCS_USAGE_STDOUT),$(eval $(call DOC_USAGE_STDOUT,$(usage))))
|
||||||
|
|
||||||
docs/usage: $(addprefix docs/source/generated/,$(DOCS_USAGE_STDOUT) $(DOCS_USAGE_STDERR))
|
docs/usage: $(addprefix docs/source/generated/,$(DOCS_USAGE_STDOUT) $(DOCS_USAGE_STDERR))
|
||||||
|
|
|
@ -36,12 +36,12 @@ help() {
|
||||||
echo ""
|
echo ""
|
||||||
echo " $0 --datdir/simlib.v"
|
echo " $0 --datdir/simlib.v"
|
||||||
echo ""
|
echo ""
|
||||||
} >&2
|
} >&$(( $1 + 1))
|
||||||
exit 1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
help
|
help 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "--build" ]; then
|
if [ "$1" = "--build" ]; then
|
||||||
|
@ -83,7 +83,7 @@ for opt; do
|
||||||
tokens=( "${tokens[@]}" '@DATDIR@'"${opt#${prefix}datdir}" ) ;;
|
tokens=( "${tokens[@]}" '@DATDIR@'"${opt#${prefix}datdir}" ) ;;
|
||||||
--help|-\?|-h)
|
--help|-\?|-h)
|
||||||
if [ ${#tokens[@]} -eq 0 ]; then
|
if [ ${#tokens[@]} -eq 0 ]; then
|
||||||
help
|
help 0
|
||||||
else
|
else
|
||||||
tokens=( "${tokens[@]}" "$opt" )
|
tokens=( "${tokens[@]}" "$opt" )
|
||||||
fi ;;
|
fi ;;
|
||||||
|
|
Loading…
Reference in a new issue