diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | src/CMakeLists.txt | 7 |
5 files changed, 22 insertions, 23 deletions
@@ -1,2 +1,2 @@ -mazerator -.vscode
\ No newline at end of file +build +.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a817aba --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0.0) + +set(CMAKE_C_STANDARD 11) + +project(mazerator_project C) + +add_subdirectory(src) diff --git a/Makefile b/Makefile deleted file mode 100644 index f4b0180..0000000 --- a/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -TARGET=mazerator -SRCS=$(TARGET).c maze.c position_stack.c utils.c -CC=gcc -CFLAGS=-Wall -CFLAGS_DEBUG=-fdiagnostics-color=always -g - -all: $(TARGET) - -$(TARGET): $(TARGET).c - $(CC) $(CFLAGS) -O2 $(SRCS) -o $(TARGET) - -.PHONY: debug clean - -debug: $(TARGET).c - $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCS) -o $(TARGET) - -clean: - $(RM) $(TARGET) @@ -6,16 +6,19 @@ Building -------- It's simple. Just run - make + $ mkdir build + $ cd build + $ cmake .. + $ make Usage ----- Run - ./mazerator + $ ./bin/mazerator You can get information about options and such by running - ./mazerator --help + $ ./bin/mazerator --help diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..090164c --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,7 @@ +project(mazerator C) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../bin) + +add_executable(mazerator mazerator.c maze.c utils.c position_stack.c) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") |