-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 774 Bytes
/
Makefile
File metadata and controls
44 lines (35 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Basic Makefile for stat-system project
# Compiler and flags
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g -Iinclude
NAME = stat-system
OBJ_DIR = obj
# Source files
SRCS = main.c \
src/utils/utils.c \
src/utils/print_stats.c \
src/entities/player.c \
src/entities/enemy.c \
src/core/loop.c \
src/fight/fight.c \
src/fight/fight_utils.c \
src/utils/debug.c \
src/core/commands.c
OBJS = $(SRCS:%.c=$(OBJ_DIR)/%.o)
# Default target
all: $(NAME)
# Main executable
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -lreadline -o $(NAME)
# Object files
$(OBJ_DIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -Iinclude -c $< -o $@
# Clean targets
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean all
# Phony targets
.PHONY: all clean fclean re