File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -300,6 +300,23 @@ ifdef CFGDIR
300300 install -m 644 cfg/* ${DESTDIR}${CFGDIR}
301301endif
302302
303+ uninstall :
304+ @if test -d ${BIN} ; then \
305+ files=" cppcheck cppcheck-htmlreport \
306+ ` ls -d addons/* .py addons/* /* .py 2> /dev/null | sed ' s,^.*/,,' ` " ; \
307+ echo ' (' cd ${BIN} ' &&' rm -f $$ files ' )' ; \
308+ ( cd ${BIN} && rm -f $$ files ); \
309+ fi
310+ ifdef CFGDIR
311+ @if test -d ${DESTDIR}${CFGDIR}; then \
312+ files="`cd cfg 2>/dev/null && ls`"; \
313+ if test -n "$$files"; then \
314+ echo '(' cd ${DESTDIR}${CFGDIR} '&&' rm -f $$files ')'; \
315+ ( cd ${DESTDIR}${CFGDIR} && rm -f $$files ); \
316+ fi; \
317+ fi
318+ endif
319+
303320# Validation of library files:
304321ConfigFiles := $(wildcard cfg/* .cfg)
305322ConfigFilesCHECKED := $(patsubst % .cfg,% .checked,$(ConfigFiles ) )
Original file line number Diff line number Diff line change @@ -400,6 +400,22 @@ int main(int argc, char **argv)
400400 fout << " \t install -d ${DESTDIR}${CFGDIR}\n " ;
401401 fout << " \t install -m 644 cfg/* ${DESTDIR}${CFGDIR}\n " ;
402402 fout << " endif\n\n " ;
403+ fout << " uninstall:\n " ;
404+ fout << " \t @if test -d ${BIN}; then \\\n " ;
405+ fout << " \t files=\" cppcheck cppcheck-htmlreport \\\n " ;
406+ fout << " \t `ls -d addons/*.py addons/*/*.py 2>/dev/null | sed 's,^.*/,,'`\" ; \\\n " ;
407+ fout << " \t echo '(' cd ${BIN} '&&' rm -f $$files ')'; \\\n " ;
408+ fout << " \t ( cd ${BIN} && rm -f $$files ); \\\n " ;
409+ fout << " \t fi\n " ;
410+ fout << " ifdef CFGDIR \n " ;
411+ fout << " \t @if test -d ${DESTDIR}${CFGDIR}; then \\\n " ;
412+ fout << " \t files=\" `cd cfg 2>/dev/null && ls`\" ; \\\n " ;
413+ fout << " \t if test -n \" $$files\" ; then \\\n " ;
414+ fout << " \t echo '(' cd ${DESTDIR}${CFGDIR} '&&' rm -f $$files ')'; \\\n " ;
415+ fout << " \t ( cd ${DESTDIR}${CFGDIR} && rm -f $$files ); \\\n " ;
416+ fout << " \t fi; \\\n " ;
417+ fout << " \t fi\n " ;
418+ fout << " endif\n\n " ;
403419 fout << " # Validation of library files:\n " ;
404420 fout << " ConfigFiles := $(wildcard cfg/*.cfg)\n " ;
405421 fout << " ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles))\n " ;
You can’t perform that action at this time.
0 commit comments