make: Add uninstall target
This commit is contained in:
parent
402d0c565f
commit
f228897641
17
Makefile
17
Makefile
|
@ -300,6 +300,23 @@ ifdef CFGDIR
|
||||||
install -m 644 cfg/* ${DESTDIR}${CFGDIR}
|
install -m 644 cfg/* ${DESTDIR}${CFGDIR}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
@if test -d ${BIN}; then \
|
||||||
|
files="cppcheck cppcheck-htmlreport \
|
||||||
|
`ls -d addons/*.py addons/*/*.py 2>/dev/null | sed 's,^.*/,,'`"; \
|
||||||
|
echo '(' cd ${BIN} '&&' rm -f $$files ')'; \
|
||||||
|
( cd ${BIN} && rm -f $$files ); \
|
||||||
|
fi
|
||||||
|
ifdef CFGDIR
|
||||||
|
@if test -d ${DESTDIR}${CFGDIR}; then \
|
||||||
|
files="`cd cfg 2>/dev/null && ls`"; \
|
||||||
|
if test -n "$$files"; then \
|
||||||
|
echo '(' cd ${DESTDIR}${CFGDIR} '&&' rm -f $$files ')'; \
|
||||||
|
( cd ${DESTDIR}${CFGDIR} && rm -f $$files ); \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
endif
|
||||||
|
|
||||||
# Validation of library files:
|
# Validation of library files:
|
||||||
ConfigFiles := $(wildcard cfg/*.cfg)
|
ConfigFiles := $(wildcard cfg/*.cfg)
|
||||||
ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles))
|
ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles))
|
||||||
|
|
|
@ -400,6 +400,22 @@ int main(int argc, char **argv)
|
||||||
fout << "\tinstall -d ${DESTDIR}${CFGDIR}\n";
|
fout << "\tinstall -d ${DESTDIR}${CFGDIR}\n";
|
||||||
fout << "\tinstall -m 644 cfg/* ${DESTDIR}${CFGDIR}\n";
|
fout << "\tinstall -m 644 cfg/* ${DESTDIR}${CFGDIR}\n";
|
||||||
fout << "endif\n\n";
|
fout << "endif\n\n";
|
||||||
|
fout << "uninstall:\n";
|
||||||
|
fout << "\t@if test -d ${BIN}; then \\\n";
|
||||||
|
fout << "\t files=\"cppcheck cppcheck-htmlreport \\\n";
|
||||||
|
fout << "\t `ls -d addons/*.py addons/*/*.py 2>/dev/null | sed 's,^.*/,,'`\"; \\\n";
|
||||||
|
fout << "\t echo '(' cd ${BIN} '&&' rm -f $$files ')'; \\\n";
|
||||||
|
fout << "\t ( cd ${BIN} && rm -f $$files ); \\\n";
|
||||||
|
fout << "\tfi\n";
|
||||||
|
fout << "ifdef CFGDIR \n";
|
||||||
|
fout << "\t@if test -d ${DESTDIR}${CFGDIR}; then \\\n";
|
||||||
|
fout << "\t files=\"`cd cfg 2>/dev/null && ls`\"; \\\n";
|
||||||
|
fout << "\t if test -n \"$$files\"; then \\\n";
|
||||||
|
fout << "\t echo '(' cd ${DESTDIR}${CFGDIR} '&&' rm -f $$files ')'; \\\n";
|
||||||
|
fout << "\t ( cd ${DESTDIR}${CFGDIR} && rm -f $$files ); \\\n";
|
||||||
|
fout << "\t fi; \\\n";
|
||||||
|
fout << "\tfi\n";
|
||||||
|
fout << "endif\n\n";
|
||||||
fout << "# Validation of library files:\n";
|
fout << "# Validation of library files:\n";
|
||||||
fout << "ConfigFiles := $(wildcard cfg/*.cfg)\n";
|
fout << "ConfigFiles := $(wildcard cfg/*.cfg)\n";
|
||||||
fout << "ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles))\n";
|
fout << "ConfigFilesCHECKED := $(patsubst %.cfg,%.checked,$(ConfigFiles))\n";
|
||||||
|
|
Loading…
Reference in New Issue