commit b93903166aad6947bc22c9278ffe3b41067561e2 Author: Imbus <> Date: Sat Dec 14 14:02:21 2024 +0100 Initial diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..07414c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.o +*.d +*a.out* +*.elf +build +.cache/ +words.txt +compile_commands.json +*vscode* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4470fc3 --- /dev/null +++ b/Makefile @@ -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 diff --git a/main.cc b/main.cc new file mode 100644 index 0000000..6a63614 --- /dev/null +++ b/main.cc @@ -0,0 +1,3 @@ +#include + +int main(int argc, char *argv[]) { std::cout << "Hello, ordle!" << std::endl; }