Fix Makefile
This commit is contained in:
parent
19716973cf
commit
b755aad0b4
2 changed files with 3 additions and 7 deletions
5
Makefile
5
Makefile
|
@ -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
|
||||||
|
|
5
hello.c
5
hello.c
|
@ -1,5 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
printf("hello world\n");
|
|
||||||
}
|
|
Reference in a new issue