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

28 lines
517 B
Makefile
Raw Normal View History

HASH := $(shell git rev-parse --short HEAD)
2023-08-31 02:33:55 +00:00
SRCS := $(wildcard src/*.c)
OBJS := $(SRCS:src/%.c=build/%.o)
DEPS := $(OBJS:%.o=%.d)
2023-08-22 21:32:16 +00:00
2023-08-31 02:33:55 +00:00
WARNING_FLAGS := -Wall -Wextra
2023-08-31 04:19:35 +00:00
INCLUDE_FLAGS := -I include
2023-08-31 02:33:55 +00:00
2023-08-31 04:19:35 +00:00
CC := clang
CFLAGS := $(WARNING_FLAGS) $(INCLUDE_FLAGS) -DKILO_COMMIT_HASH=$(HASH) -MMD -MP -std=c99 -g
2023-08-31 02:33:55 +00:00
kilo: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@
$(OBJS): build/%.o: src/%.c
@mkdir -p build
$(CC) $(CFLAGS) -c $< -o $@
2023-08-24 13:00:53 +00:00
.PHONY: install clean
install: kilo
cp kilo ~/bin
2023-08-24 13:00:53 +00:00
clean:
2023-08-31 02:33:55 +00:00
rm -rf build
2023-08-24 13:00:53 +00:00
rm -f ./kilo
2023-08-31 02:33:55 +00:00
-include $(DEPS)