Initial
This commit is contained in:
commit
b93903166a
3 changed files with 48 additions and 0 deletions
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
*.o
|
||||||
|
*.d
|
||||||
|
*a.out*
|
||||||
|
*.elf
|
||||||
|
build
|
||||||
|
.cache/
|
||||||
|
words.txt
|
||||||
|
compile_commands.json
|
||||||
|
*vscode*
|
36
Makefile
Normal file
36
Makefile
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
CXX = g++
|
||||||
|
CXXFLAGS = -Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -std=c++17
|
||||||
|
#CXXFLAGS += -Werror
|
||||||
|
|
||||||
|
SRC = $(wildcard *.cc)
|
||||||
|
HDR = $(wildcard *.h)
|
||||||
|
OBJ = $(SRC:.cc=.o)
|
||||||
|
|
||||||
|
all: main.elf
|
||||||
|
|
||||||
|
main.elf: $(OBJ)
|
||||||
|
@echo "Building & linking $@"
|
||||||
|
@$(CXX) $(CXXFLAGS) $^ -o $@
|
||||||
|
|
||||||
|
words.txt:
|
||||||
|
cat /usr/share/dict/words > words.txt
|
||||||
|
|
||||||
|
%.o:%.cc
|
||||||
|
@echo "Building $@"
|
||||||
|
@$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
|
lint: clang-tidy cppcheck clang-format
|
||||||
|
|
||||||
|
clang-tidy:
|
||||||
|
clang-tidy $(SRC) -- $(CXXFLAGS)
|
||||||
|
|
||||||
|
cppcheck:
|
||||||
|
cppcheck --enable=all --language=c++ --std=c++17 --suppress=missingIncludeSystem -I/usr/include $(SRC) $(HDR)
|
||||||
|
|
||||||
|
clang-format:
|
||||||
|
clang-format -i $(SRC) $(HDR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o *.elf words.txt
|
||||||
|
|
||||||
|
.PHONY: clean all lint clang-tidy cppcheck clang-format
|
3
main.cc
Normal file
3
main.cc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) { std::cout << "Hello, ordle!" << std::endl; }
|
Loading…
Reference in a new issue