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)
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
|
||||
CC := gcc
|
||||
CFLAGS := -Wall -Wextra -Iinclude -DKILO_COMMIT_HASH=$(shell git rev-parse --short HEAD) -MMD -MP -std=c99 -ggdb
|
||||
|
||||
kilo: $(OBJS)
|
||||
gcc $^ -o $@
|
||||
$(CC) $^ -o $@
|
||||
|
||||
$(OBJS): build/%.o: src/%.c
|
||||
@mkdir -p build
|
||||
gcc $(CFLAGS) -c $< -o $@
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
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