-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
95 lines (69 loc) · 3.44 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
NAME = MemSubLoader
CC = g++
CFLAGS = -Wall
RC = windres
LINKS = -lgdi32 -luser32 -lkernel32 -lcomctl32 -lshlwapi -lcomdlg32 -lgdiplus -lole32 -luuid bin/Release/OutlineText.dll bin/Release/JsonCpp.dll
LIBLINKS = -I./includes -I./resources -I./lib -I./lib/json -I./lib/OutlineText
SRC_PATH = srcs/
OBJ_PATH = bin/
RES_PATH = resources/
OUT_PATH = bin/Release/
C_EXTENSION = .cpp
# 눈_눈 SOURCES 눈_눈
MAIN_PATH =
MAIN_FILES = main game mainWindow settingsWindow subtitlesWindow configuratorWindow utils Win32InputBox
SRCS_FILES += $(addprefix $(MAIN_PATH), $(MAIN_FILES))
SRCS_FILES_EXT += $(addsuffix $(C_EXTENSION), $(SRCS_FILES))
SRCS += $(addprefix $(SRC_PATH), $(SRCS_FILES_EXT))
OBJS = $(addprefix $(OBJ_PATH), $(SRCS_FILES_EXT:cpp=o))
LIB_OUTLINE_TEXT_PATH = lib/OutlineText/
LIB_OUTLINE_TEXT_FILES = BmpOutlineText CanvasHelper DiffusedShadowStrategy DrawGradient ExtrudeStrategy\
GDIPath IOutlineText ITextStrategy MaskColor NonSystemFontLoader OutlineText PngOutlineText stdafx TextDblGlowStrategy\
TextDblOutlineStrategy TextGlowStrategy TextGradOutlineLastStrategy TextGradOutlineStrategy TextImplGetHeight TextNoOutlineStrategy\
TextOnlyOutlineStrategy TextOutlineStrategy
LIB_OUTLINE_TEXT_SRCS_FILES = $(addprefix $(LIB_OUTLINE_TEXT_PATH), $(LIB_OUTLINE_TEXT_FILES))
LIB_OUTLINE_TEXT_SRCS_FILES_EXT += $(addsuffix $(C_EXTENSION), $(LIB_OUTLINE_TEXT_SRCS_FILES))
LIB_OUTLINE_TEXT_SRCS += $(addprefix $(LIB_OUTLINE_TEXT_PATH), $(LIB_OUTLINE_TEXT_SRCS_FILES_EXT))
LIB_OUTLINE_TEXT_OBJS = $(addprefix $(OBJ_PATH), $(LIB_OUTLINE_TEXT_SRCS_FILES_EXT:cpp=o))
LIB_JSON_CPP_PATH = lib/json/
LIB_JSON_CPP_FILES = jsoncpp
LIB_JSON_CPP_SRCS_FILES = $(addprefix $(LIB_JSON_CPP_PATH), $(LIB_JSON_CPP_FILES))
LIB_JSON_CPP_SRCS_FILES_EXT += $(addsuffix $(C_EXTENSION), $(LIB_JSON_CPP_SRCS_FILES))
LIB_JSON_CPP_SRCS += $(addprefix $(LIB_JSON_CPP_PATH), $(LIB_JSON_CPP_SRCS_FILES_EXT))
LIB_JSON_CPP_OBJS = $(addprefix $(OBJ_PATH), $(LIB_JSON_CPP_SRCS_FILES_EXT:cpp=o))
RC_FILES = MemSubLoader.rc
RC_SRCS = $(addprefix $(RES_PATH), $(RC_FILES))
RC_OBJS = $(addprefix $(OBJ_PATH), $(RC_FILES:rc=o))
# (҂◡_◡) UTILS (҂◡_◡)
RM = rm -rf
# ( ಠ ʖ̯ ಠ) RULES ( ಠ ʖ̯ ಠ)
all: folders libOutlineText libJsonCpp $(NAME)
$(NAME): $(OBJS) $(RC_OBJS)
$(CC) $(CFLAGS) -o $(OUT_PATH)$(NAME) $(OBJS) $(RC_OBJS) $(LINKS)
folders:
@mkdir -p $(dir $(OBJ_PATH)$(LIB_OUTLINE_TEXT_PATH))
@mkdir -p $(dir $(OBJ_PATH)$(LIB_JSON_CPP_PATH))
@mkdir -p $(dir $(OBJ_PATH)$(LIB_INPUT_BOX_PATH))
@mkdir -p $(dir ${OUT_PATH})
libOutlineText: $(LIB_OUTLINE_TEXT_OBJS)
$(CC) ${CFLAGS} -shared $(LIB_OUTLINE_TEXT_OBJS) -lgdiplus -lgdi32 -Wl,--export-all-symbols -o $(OUT_PATH)OutlineText.dll
libJsonCpp: $(LIB_JSON_CPP_OBJS)
$(CC) ${CFLAGS} -shared $(LIB_JSON_CPP_OBJS) -Wl,--export-all-symbols -o $(OUT_PATH)JsonCpp.dll
$(RC_OBJS): $(RC_SRCS)
$(RC) -i $< -o $@
.c.o:
@$(CC) $(FLAGS) -c ${LIBLINKS} $< -o ${<:.cpp=.o}
$(OBJ_PATH)%.o: $(SRC_PATH)%.cpp
${CC} ${CFLAGS} $(LIBLINKS) -c $< -o $@
$(OBJ_PATH)$(LIB_OUTLINE_TEXT_PATH)%.o: $(LIB_OUTLINE_TEXT_PATH)%.cpp
${CC} ${CFLAGS} $(LIBLINKS) -c $< -o $@
$(OBJ_PATH)$(LIB_JSON_CPP_PATH)%.o: $(LIB_JSON_CPP_PATH)%.cpp
${CC} ${CFLAGS} $(LIBLINKS) -c $< -o $@
$(OBJ_PATH)$(LIB_INPUT_BOX_PATH)%.o: $(LIB_INPUT_BOX_PATH)%.cpp
${CC} ${CFLAGS} $(LIBLINKS) -c $< -o $@
clean:
@$(RM) -r $(OBJ_PATH)
fclean: clean
@$(RM) $(NAME)
re: fclean all
.phony: all clean fclean re libOutlineText libJsonCpp folders