Archived
1
Fork 0

Update Makefile

This commit is contained in:
Hadeed 2023-08-31 07:33:55 +05:00
parent a74e6caae1
commit 2969a7479e
3 changed files with 20 additions and 5 deletions

5
.gitignore vendored
View file

@ -1,5 +1,6 @@
.nvim.lua build/
kilo kilo
compile_commands.json
.ccls-cache .ccls-cache
.nvim.lua
compile_commands.json

View file

@ -1,7 +1,21 @@
CFLAGS := -ggdb -Wall -Wextra -Wstrict-prototypes -std=c99 SRCS := $(wildcard src/*.c)
OBJS := $(SRCS:src/%.c=build/%.o)
DEPS := $(OBJS:%.o=%.d)
kilo: kilo.c WARNING_FLAGS := -Wall -Wextra
$(CC) $(CFLAGS) kilo.c -o kilo INCLUDE_FLAGS := -I headers
CFLAGS := $(WARNING_FLAGS) $(INCLUDE_FLAGS) -MMD -MP -std=c99
kilo: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@
$(OBJS): build/%.o: src/%.c
@mkdir -p build
$(CC) $(CFLAGS) -c $< -o $@
clean: clean:
rm -rf build
rm -f ./kilo rm -f ./kilo
-include $(DEPS)

View file