aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-01-07 18:07:35 +0100
committerHampusM <hampus@hampusmat.com>2022-01-07 18:07:35 +0100
commit097aa95c1f0cb159e7d9d0a3edf9284c421ee298 (patch)
tree417d423ef1420634612f1db9f6f97d812f56ec01
parent02dee3370f1420b208c546194ac67322fe563a24 (diff)
Revert "build: use Makefile instead of Cmake"
This reverts commit 813c98b028c9ba484fb5b21a60067ae35cc925ff.
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt13
-rw-r--r--Makefile22
3 files changed, 14 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index b0d96bb..69b610c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
-mazerator
+build
.vscode
.cache
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..5847c70
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.0.0)
+
+set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
+
+set(CMAKE_C_STANDARD 11)
+
+project(mazerator_project C)
+
+file(GLOB SOURCES src/*.c)
+
+add_executable(mazerator ${SOURCES})
+
+SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wall)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 82c2f43..0000000
--- a/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-CC=gcc
-CSTD=c17
-CFLAGS=-Wall -O2 --std=$(CSTD)
-CDEBUGFLAGS=-Wall -g -O0 --std=$(CSTD) # -fno-stack-protector
-
-SRCDIR=src
-SRCS=$(wildcard $(SRCDIR)/*.c)
-
-TARGET=mazerator
-
-.PHONY: debug clean
-
-all: $(TARGET)
-
-$(TARGET): $(SRCS)
- $(CC) $(CFLAGS) $(SRCS) -o $(TARGET)
-
-debug:
- $(CC) $(CDEBUGFLAGS) $(SRCS) -o $(TARGET)
-
-clean:
- $(RM) $(TARGET)