19 lines
335 B
Makefile
19 lines
335 B
Makefile
CC = gcc
|
|
CFLAGS = -Wall -I$(INCLUDE)
|
|
INCLUDE = include
|
|
SRC_DIR = src
|
|
OBJ_DIR = obj
|
|
SRC = $(wildcard $(SRC_DIR)/*.c)
|
|
OBJ = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRC))
|
|
BIN = ./main
|
|
|
|
all: $(BIN)
|
|
|
|
$(BIN): $(OBJ)
|
|
$(CC) -o $@ $^
|
|
|
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c MKOBJ
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
clean:
|
|
rm -f $(OBJ_DIR)/*.o $(BIN)
|