Skip to content

Commit

Permalink
cassandane: Do syntax checks only for changed files
Browse files Browse the repository at this point in the history
Instead of `make` inside of cassandane always re-checking syntax,
only check syntax if one of the files has actually changed.

This is more in the spirit of make with only rebuilding things on
changes, and also makes `cyd test` much faster...
  • Loading branch information
wolfsage committed Jan 3, 2025
1 parent d2e2787 commit 76dff26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 1 addition & 0 deletions cassandane/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ reports.old
cass.errs
cassandane.ini
.cassandane.ini
.cassandane-syntax-check
19 changes: 6 additions & 13 deletions cassandane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,11 @@ ifndef NOCYRUS
CYRUS_PERL_PATHS := $(shell $(PERL) utils/cyrus-perl-paths.pl)
endif

SYNTAX_rules =
syntax: .cassandane-syntax-check

define SYNTAX_template
$(1)_syntax: $(1)
@$(PERL) $(CYRUS_PERL_PATHS) -c $(1)
SYNTAX_rules += $(1)_syntax
endef
.cassandane-syntax-check: $(SCRIPTS) $(MODULES)
rm -f .cassandane-syntax-check
$(foreach path,$?,$(PERL) $(CYRUS_PERL_PATHS) -c $(path) || exit;)
touch .cassandane-syntax-check

$(foreach s,$(SCRIPTS),$(eval $(call SYNTAX_template,$(s))))

$(foreach m,$(MODULES),$(eval $(call SYNTAX_template,$(m))))

syntax: $(SYNTAX_rules)

.PHONY: all syntax $(SYNTAX_rules)
.PHONY: syntax

0 comments on commit 76dff26

Please sign in to comment.