Mercurial > ~dholland > hg > ag > index.cgi
view lint/lint-rules.sh @ 20:bb115deb6fb2
Improve agfiles rule.
(1) It didn't depend on $(AGCL) and it absolutely should have.
(2) allow AGFORCE=1 to make it rebuild whether or not it looks out of
date.
(3) Document this.
author | David A. Holland |
---|---|
date | Mon, 13 Jun 2022 00:02:15 -0400 |
parents | 13d2b8934445 |
children |
line wrap: on
line source
#!/bin/sh # lint-rules.sh - generate make rules for lint dir # usage: lint-rules.sh > rules.mk if [ $# != 0 ]; then echo "$0: usage: $0" 1>&2 exit 1 fi SOURCESETS='tool main example' # generate the lists of sources for S in $SOURCESETS; do if [ ! -f $S.srcs ]; then echo "$0: $S.srcs missing - rerun make rules?" exit 1 fi echo $S | tr a-z A-Z | awk '{ printf "%sSRCS=\\\n", $1 }' sed < $S.srcs 's/^/ /;s/$/ \\/;$s/ \\$//' echo done for S in $SOURCESETS; do awk < $S.srcs ' { file=$1; base=file; sub(".*/", "", base); base = set "-" base; ok = sprintf("$(TOP)/lint/ok/%s.ok", base) printf "%s.lint: $(TOP)/%s $(CHECK)\n", base, file; printf "\t@echo \" [CHECK] %s\"\n", base; printf "\t@$(CHECK) --%s \"$(TOP)\" %s > %s.lint\n", set, file, base; printf "\n"; printf "%s.diff: %s.lint %s\n", base, base, ok; printf "\t@diff %s %s.lint | tee %s.diff\n", ok, base, base; printf "\n"; printf "all: %s.diff\n", base; printf "\n"; } ' "set=$S" done