Archived
1
Fork 0

Fix Makefile

This commit is contained in:
Hadeed 2023-09-25 09:13:59 +05:00
parent 19716973cf
commit b755aad0b4
2 changed files with 3 additions and 7 deletions

View file

@ -2,14 +2,15 @@ SRCS := $(wildcard src/*.c)
OBJS := $(SRCS:src/%.c=build/%.o) OBJS := $(SRCS:src/%.c=build/%.o)
DEPS := $(OBJS:.o=.d) DEPS := $(OBJS:.o=.d)
CC := gcc
CFLAGS := -Wall -Wextra -Iinclude -DKILO_COMMIT_HASH=$(shell git rev-parse --short HEAD) -MMD -MP -std=c99 -ggdb CFLAGS := -Wall -Wextra -Iinclude -DKILO_COMMIT_HASH=$(shell git rev-parse --short HEAD) -MMD -MP -std=c99 -ggdb
kilo: $(OBJS) kilo: $(OBJS)
gcc $^ -o $@ $(CC) $^ -o $@
$(OBJS): build/%.o: src/%.c $(OBJS): build/%.o: src/%.c
@mkdir -p build @mkdir -p build
gcc $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
clean: clean:
rm -rf build kilo rm -rf build kilo

View file

@ -1,5 +0,0 @@
#include <stdio.h>
int main() {
printf("hello world\n");
}