-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (43 loc) · 1.24 KB
/
Makefile
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
#*******************************************************************************
# PROJECT: Bomberman
#
# AUTHORS: Yohann Martin, Aziz Hamide, Gauthier Desplanque, William Weber
#
# DATE CREATED: 01/16/2019
#
# Copyright (c) 2019 Yohann MARTIN (@Astropilot). All rights reserved.
#
# Licensed under the MIT License. See LICENSE file in the project root for full
# license information.
#*******************************************************************************
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g -Iincludes/ -Ilibs/glib/includes
SDL = -lSDL2 -lSDL2_ttf -lSDL2_image -lSDL2_mixer
LIBGLIB = libglib.a
FOLDER = build/
TARGET = bomberman
GLIB = -L$(FOLDER) -lglib
RM = rm -f
SRC = \
$(wildcard src/core/*.c) \
$(wildcard src/ui/*.c) \
$(wildcard src/network/packets/*.c) \
$(wildcard src/logic/*.c) \
$(wildcard src/network/game/*.c) \
src/main.c
OBJ = $(SRC:.c=.o)
all: $(TARGET)
$(TARGET): makeglib $(OBJ)
$(CC) $(CFLAGS) $(OBJ) -o $(FOLDER)$(TARGET) $(SDL) $(GLIB) -lm
makeglib:
cd libs/glib && $(MAKE)
cp libs/glib/$(LIBGLIB) $(FOLDER)
.PHONY: clean fclean re
clean:
$(RM) $(OBJ)
$(RM) $(FOLDER)$(LIBGLIB)
cd libs/glib && $(MAKE) clean
fclean: clean
$(RM) $(FOLDER)$(TARGET)
cd libs/glib && $(MAKE) fclean
re: fclean all