Archived
1
Fork 0
This repository has been archived on 2024-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
kilo/Makefile
Hadeed Ahmad 58de733df4 Fix the bug I was crying about in the last commit
It was a pretty simple fix. I used gdb to find it, was fun.
2023-09-24 04:37:17 +05:00

27 lines
517 B
Makefile

HASH := $(shell git rev-parse --short HEAD)
SRCS := $(wildcard src/*.c)
OBJS := $(SRCS:src/%.c=build/%.o)
DEPS := $(OBJS:%.o=%.d)
WARNING_FLAGS := -Wall -Wextra
INCLUDE_FLAGS := -I include
CC := clang
CFLAGS := $(WARNING_FLAGS) $(INCLUDE_FLAGS) -DKILO_COMMIT_HASH=$(HASH) -MMD -MP -std=c99 -g
kilo: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@
$(OBJS): build/%.o: src/%.c
@mkdir -p build
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: install clean
install: kilo
cp kilo ~/bin
clean:
rm -rf build
rm -f ./kilo
-include $(DEPS)