basic makefile and gitignore

This commit is contained in:
Mylloon 2024-04-03 12:59:24 +02:00
parent 9c8472ec30
commit 906afb2600
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 32 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.o
*.exe

30
Makefile Normal file
View file

@ -0,0 +1,30 @@
CC = x86_64-w64-mingw32-gcc
RM = rm
SOURCES = $(wildcard src/*.c)
OBJETS = $(patsubst %.c,%.o,$(notdir $(SOURCES)))
CFLAGS = -std=gnu17 -pedantic
LDFLAGS =
EXE = rvuw
EXE_EXT = exe
%.o: src/%.c
$(CC) -c $< -o $@ $(CFLAGS)
compilation: $(OBJETS)
$(CC) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LDFLAGS)
main: CFLAGS += -O3
main: compilation
dev: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes
dev: CFLAGS += -fanalyzer -g -Og
dev: compilation
all:
main
clean:
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)