diff --git a/Makefile b/Makefile index 744c4804c..123f49daf 100644 --- a/Makefile +++ b/Makefile @@ -305,6 +305,14 @@ ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles)) xmllint --noout --relaxng cfg/cppcheck-cfg.rng $< validateCFG: ${ConfigFilesCHECKED} +# Validation of platforms files: +PlatformFiles := $(wildcard platforms/*.xml) +PlatformFilesCHECKED := $(patsubst %.xml,%.checked,$(PlatformFiles)) +.PHONY: validatePlatforms +%.checked:%.xml + xmllint --noout --relaxng platforms/cppcheck-platforms.rng $< +validatePlatforms: ${PlatformFilesCHECKED} + ###### Build diff --git a/platforms/cppcheck-platforms.rng b/platforms/cppcheck-platforms.rng new file mode 100644 index 000000000..e870ab869 --- /dev/null +++ b/platforms/cppcheck-platforms.rng @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 3c2a47484..3a8259e8a 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -375,7 +375,7 @@ int main(int argc, char **argv) fout << "\t./testrunner\n\n"; fout << "check:\tall\n"; fout << "\t./testrunner -q\n\n"; - fout << "checkcfg:\tcppcheck validateCFG\n"; + fout << "checkcfg:\tcppcheck validateCFG validatePlatforms\n"; fout << "\t./test/cfg/runtests.sh\n\n"; fout << "dmake:\ttools/dmake.o cli/filelister.o $(SRCDIR)/pathmatch.o $(SRCDIR)/path.o externals/simplecpp/simplecpp.o\n"; fout << "\t$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)\n\n"; @@ -407,7 +407,13 @@ int main(int argc, char **argv) fout << "%.checked:%.cfg\n"; fout << "\txmllint --noout --relaxng cfg/cppcheck-cfg.rng $<\n"; fout << "validateCFG: ${ConfigFilesCHECKED}\n\n"; - + fout << "# Validation of platforms files:\n"; + fout << "PlatformFiles := $(wildcard platforms/*.xml)\n"; + fout << "PlatformFilesCHECKED := $(patsubst %.xml,%.checked,$(PlatformFiles))\n"; + fout << ".PHONY: validatePlatforms\n"; + fout << "%.checked:%.xml\n"; + fout << "\txmllint --noout --relaxng platforms/cppcheck-platforms.rng $<\n"; + fout << "validatePlatforms: ${PlatformFilesCHECKED}\n\n"; fout << "\n###### Build\n\n";