0
Ich habe folgendes Makefile
:Befehl ausführen eins nach dem anderen
CC := clang++
CFLAGS := -std=c++1z
BINARY := -g -Wall -Wextra -Wformat -Werror -pedantic
OPTIMIZE := -Ofast -march=native -ffast-math
CPPCOREGUIDELINES := clang-tidy
SRC := $(wildcard *.cpp)
BIN := $(patsubst %.cpp,bin/%,$(SRC))
all: clean cpp
clean:
mkdir -p ./bin
rm -f bin/*
cpp: $(BIN)
$(BIN): bin/%: %.cpp
$(CC) $(CFLAGS) $(BINARY) $(OPTIMIZE) $^ -o [email protected]
checks: $(SRC)
$(CPPCOREGUIDELINES) $^ -- $(CFLAGS) $(BINARY) $(OPTIMIZE)
Welche Ausführung checks
wie folgt aus: wie diese
$ make checks
clang-tidy 007-pointer.cpp 008-arrays-introduction-smarter.cpp -- -std=c++1z -g -Wall -Wextra -Wformat -Werror -pedantic -Ofast -march=native -ffast-math
81 warnings generated.
393 warnings generated.
C:\www\cpp\hackerrank\007-pointer.cpp:16:3: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
scanf("%d %d", &a, &b);
^
C:\www\cpp\hackerrank\007-pointer.cpp:18:3: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
printf("%d\n%d", a, b);
^
C:\www\cpp\hackerrank\008-arrays-introduction-smarter.cpp:19:12: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cin >> t[i];
^
C:\www\cpp\hackerrank\008-arrays-introduction-smarter.cpp:22:13: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cout << t[i] << " ";
^
...
I checks
nacheinander nach jeder Datei ausgeführt werden soll:
$ make checks
clang-tidy 007-pointer.cpp -- -std=c++1z -g -Wall -Wextra -Wformat -Werror -pedantic -Ofast -march=native -ffast-math
81 warnings generated.
C:\www\cpp\hackerrank\007-pointer.cpp:16:3: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
scanf("%d %d", &a, &b);
^
C:\www\cpp\hackerrank\007-pointer.cpp:18:3: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
printf("%d\n%d", a, b);
^
clang-tidy 008-arrays-introduction-smarter.cpp -- -std=c++1z -g -Wall -Wextra -Wformat -Werror -pedantic -Ofast -march=native -ffast-math
312 warnings generated.
C:\www\cpp\hackerrank\008-arrays-introduction-smarter.cpp:19:12: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cin >> t[i];
^
C:\www\cpp\hackerrank\008-arrays-introduction-smarter.cpp:22:13: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cout << t[i] << " ";
^
...
Wie kann ich das tun?
Danke! Funktioniert einwandfrei. – Lanti
@Lanti Es ist auch parallel mit '-j'. –