1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2025-08-07 22:42:54 +03:00

cppcheck.mak: Add install and uninstall targets

If someone has their heart set on Cppcheck, this makes it even easier to
install just as it used to be distributed.
This commit is contained in:
Christopher Wellons
2024-09-28 11:35:49 -04:00
parent 6a54545b4f
commit f0314ce4c5

View File

@@ -1,8 +1,26 @@
# Build and install Cppcheck inside w64devkit
#
# Invoke in a Cppcheck source tree:
# $ make -j$(nproc) -f path/to/cppcheck.mak install
#
# Alternatively, use the default target and run it in place in the
# source tree without installing.
ext := $(shell find externals -mindepth 1 -type d) ext := $(shell find externals -mindepth 1 -type d)
src := $(shell find cli lib externals -name '*.cpp') src := $(shell find cli lib externals -name '*.cpp')
obj := $(src:.cpp=.o) obj := $(src:.cpp=.o)
CXXFLAGS := -w -Os -Ilib $(addprefix -I,$(ext)) CXXFLAGS := -w -O2 -Ilib $(addprefix -I,$(ext))
cppcheck.exe: $(obj) cppcheck.exe: $(obj)
$(CXX) -s -o $@ $(obj) -lshlwapi $(CXX) -s -o $@ $(obj) -lshlwapi
cppcheck: $(obj)
$(CXX) -pthread -s -o $@ $(obj) install: cppcheck.exe
mkdir -p "$$W64DEVKIT_HOME"/share/cppcheck
cp -r cppcheck.exe cfg/ "$$W64DEVKIT_HOME"/share/cppcheck/
$(CC) -DEXE=../share/cppcheck/cppcheck.exe -DCMD=cppcheck \
-Oz -s -nostartfiles -o "$$W64DEVKIT_HOME"/bin/cppcheck.exe \
"$$W64DEVKIT_HOME"/src/alias.c
uninstall:
rm -rf "$$W64DEVKIT_HOME"/share/cppcheck/ \
"$$W64DEVKIT_HOME"/bin/cppcheck.exe