19 lines
278 B
Makefile
19 lines
278 B
Makefile
CC=gcc
|
|
CFLAGS=-g -Wall -Iinclude
|
|
SRC=src
|
|
OBJ=obj
|
|
SRCS=$(wildcard $(SRC)/*.c)
|
|
OBJS=$(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SRCS))
|
|
|
|
BIN=./main
|
|
|
|
all:$(BIN)
|
|
|
|
$(BIN): $(OBJS)
|
|
$(CC) $(CFLAGS) $(OBJS) -o $@
|
|
|
|
$(OBJ)/%.o: $(SRC)/%.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
clean:
|
|
$(RM) -r $(OBJ)/*
|