commit e0e9557e7144e9dd08469b2bbd26ef205e2effa8 Author: Mylloon Date: Sun Nov 13 17:34:17 2022 +0100 add makefile and main fn diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..68b48b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o + +othello diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5665c29 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +CXX = gcc +CXXFLAGS = -std=c99 -pedantic +RM = rm + +SOURCES = $(wildcard src/*.c) +OBJETS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES))) + +EXE = othello + +%.c.o: src/%.c + $(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS) + +main: CXXFLAGS += -O3 +main: compilation + +dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes -fanalyzer -fsanitize=undefined -g +dev: compilation + +compilation: $(OBJETS) + $(CXX) -o $(EXE) $(OBJETS) + +all: + main + +clean: + $(RM) $(OBJETS) $(EXE) diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..b552c8e --- /dev/null +++ b/src/main.c @@ -0,0 +1 @@ +int main(void) {}