-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 1.45 KB
/
Makefile
File metadata and controls
61 lines (45 loc) · 1.45 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
NAME := Particle_System
SRC_DIR := ./src
INC_DIR := ./include
OBJ_DIR := ./obj
LIB_DIR := ./libft
CC := gcc
CFLAGS := -fsanitize=address
SRC := main.c \
cl_processing.c \
init_cl.c \
init_sdl.c \
main_and_event_init.c \
particle_init.c \
SRCS := $(addprefix $(SRC_DIR)/, $(SRC))
OBJ := $(SRC:.c=.o)
OBJS := $(addprefix $(OBJ_DIR)/, $(OBJ))
FT := ./libft/
FT_LIB := $(addprefix $(FT),libft.a)
FT_INC := -I ./libft/include
SDL_INC := -I./frameworks/SDL2.framework/Versions/A/Headers \
-I./frameworks/SDL2_image.framework/Versions/A/Headers \
-I./frameworks/SDL2_ttf.framework/Versions/A/Headers \
-I./frameworks/SDL2_mixer.framework/Versions/A/Headers \
FRAMEWORKS := -F./frameworks \
-rpath ./frameworks \
-framework SDL2 -framework SDL2_ttf -framework SDL2_image -framework SDL2_mixer
FT_LNK := -L ./libft -l ft
all: dirs $(FT_LIB) $(OBJ_DIR) $(NAME)
$(FT_LIB):
make -C $(FT)
dirs: $(OBJ_DIR) $(JC_DIR)
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) -c $< $(CFLAGS) -I $(INC_DIR) $(FT_INC) $(SDL_INC) -o $@
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $(FT_LNK) $(SDL_INC) $(OBJS) $(FRAMEWORKS) -o $(NAME) -framework OpenCL
clean:
rm -f $(OBJS)
make -C $(FT) clean
fclean: clean
rm -f $(NAME)
rm -rf $(OBJ_DIR)
make -C $(FT) fclean
re: fclean all