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

20 lines
373 B
Makefile
Raw Permalink Normal View History

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-09-25 04:13:59 +00:00
CC := gcc
CFLAGS := -Wall -Wextra -Iinclude -DKILO_COMMIT_HASH=$(shell git rev-parse --short HEAD) -MMD -MP -std=c99 -ggdb
2023-08-31 02:33:55 +00:00
kilo: $(OBJS)
2023-09-25 04:13:59 +00:00
$(CC) $^ -o $@
2023-08-31 02:33:55 +00:00
$(OBJS): build/%.o: src/%.c
@mkdir -p build
2023-09-25 04:13:59 +00:00
$(CC) $(CFLAGS) -c $< -o $@
2023-08-24 13:00:53 +00:00
clean:
rm -rf build kilo
2023-08-31 02:33:55 +00:00
.PHONY: clean
2023-08-31 02:33:55 +00:00
-include $(DEPS)