add makefile and main fn

This commit is contained in:
Mylloon 2022-11-13 17:34:17 +01:00
commit e0e9557e71
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 30 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*.o
othello

26
Makefile Normal file
View file

@ -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)

1
src/main.c Normal file
View file

@ -0,0 +1 @@
int main(void) {}