X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/0305d25eb08b0128d759cc70370524f48bb47290..e0c653e7e660c353c59b054de571474450aa4c92:/src/local.mk?ds=inline diff --git a/src/local.mk b/src/local.mk index d54d5286..a19d70a1 100644 --- a/src/local.mk +++ b/src/local.mk @@ -110,7 +110,7 @@ BUILT_SOURCES += \ src/scan-gram.c \ src/scan-skel.c -MOSTLYCLEANFILES = src/yacc +MOSTLYCLEANFILES += src/yacc src/yacc: rm -f $@ $@.tmp @@ -118,37 +118,3 @@ src/yacc: echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@.tmp chmod a+x $@.tmp mv $@.tmp $@ - -echo: - echo $(src_bison_SOURCES) $(noinst_HEADERS) - -# The following rule is not designed to be portable, -# and relies on tools that not everyone has. - -# Most functions in src/*.c should have static scope. -# Any that don't must be marked with `extern', but `main' -# and `usage' are exceptions. They're always extern, but -# don't need to be marked. -# -# The second nm|grep checks for file-scope variables with `extern' scope. -sc_tight_scope: $(all_programs) - @t=exceptions-$$$$; \ - trap 's=$$?; rm -f $$t; exit $$s' 0 1 2 13 15; \ - ( printf '^main$$\n^usage$$\n'; \ - grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \ - | grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \ - if nm -e *.$(OBJEXT) \ - | sed -n 's/.* T //p' \ - | grep -Ev -f $$t; then \ - echo 'the above functions should have static scope' 1>&2; \ - exit 1; \ - fi; \ - ( printf '^program_name$$\n'; \ - sed -n 's/^extern .*[* ]\([a-zA-Z_][a-zA-Z_0-9]*\);$$/^\1$$/p' \ - $$(ls $(SOURCES) | grep '\.h$$') /dev/null) > $$t; \ - if nm -e *.$(OBJEXT) \ - | sed -n 's/.* [BD] //p' \ - | grep -Ev -f $$t; then \ - echo 'the above variables should have static scope' 1>&2; \ - exit 1; \ - fi