Skip to content
This repository was archived by the owner on Apr 22, 2021. It is now read-only.

Commit 4b8e84c

Browse files
committed
Frameworks refreshed. Makefile updated
Now can compile game without preinstalled dependencies.
1 parent 4acb9ed commit 4b8e84c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+61
-21
lines changed

Makefile

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,59 @@
1-
NAME = endgame
1+
NAME = endgame
22

3-
SRCS = src/*.c
4-
INC = inc/*.h
5-
SDL = -F resource/framework -I resource/framework/SDL2.framework/SDL2
3+
SRC_DIR = src
64

7-
CFLAGS = -std=c11 -Wall -Wextra -Wpedantic\
8-
-framework SDL2_ttf \
9-
-rpath resource/framework -framework SDL2 \
10-
-framework SDL2_image \
11-
-framework SDL2_mixer \
5+
OBJ_DIR = obj
6+
7+
INC_DIR = inc
8+
9+
SDL = -F resource/framework -I resource/framework/SDL2.framework/SDL2 -I resource/framework/SDL2_image.framework/SDL2_image \
10+
-I resource/framework/SDL2_mixer.framework/SDL2_mixer -I resource/framework/SDL2_ttf.framework/SDL2_ttf
11+
12+
SRC_FILES = $(wildcard $(SRC_DIR)/*.c)
13+
14+
OBJ_FILES = $(addprefix $(OBJ_DIR)/, $(notdir $(SRC_FILES:%.c=%.o)))
15+
16+
INC_FILES = $(wildcard $(INC_DIR)/*.h)
17+
18+
CC = clang
19+
20+
CFLAGS = -std=c11 $(addprefix -W, all extra error pedantic) -g \
21+
22+
SDL_FLAGS = -rpath resource/framework -framework SDL2 \
23+
-framework SDL2_image \
1224
-I resource/framework/SDL2_image.framework/Headers \
25+
-framework SDL2_mixer \
26+
-I resource/framework/SDL2_mixer.framework/Headers \
27+
-framework SDL2_ttf \
1328
-I resource/framework/SDL2_ttf.framework/Headers \
14-
-I resource/framework/SDL2_mixer.framework/Headers
1529

16-
all: $(NAME)
30+
MKDIR = mkdir -p
31+
RM = rm -rf
32+
33+
all: $(NAME) clean
1734

18-
$(NAME): install clean
35+
$(NAME): $(OBJ_FILES)
36+
@$(CC) $(CFLAGS) $^ -o $@ -I $(INC_DIR) $(SDL_FLAGS) $(SDL)
37+
@printf "\r\33[2K$@\t \033[32;1mcreated\033[0m\n"
1938

20-
install:
21-
@cp $(SRCS) .
22-
@cp $(INC) .
23-
@clang $(CFLAGS) -o $(NAME) $(SRCS) $(LIBS) $(SDL) -I inc
39+
$(OBJ_FILES): | $(OBJ_DIR)
2440

25-
uninstall: clean
26-
@rm -rf $(NAME)
41+
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(INC_FILES)
42+
@$(CC) $(CFLAGS) -c $< -o $@ -I $(INC_DIR) $(SDL)
43+
@printf "\r\33[2K$(NAME)\033[33;1m\t compile \033[0m$(<:$(SRC_DIR)/%.c=%)\r"
44+
45+
$(OBJ_DIR):
46+
@$(MKDIR) $@
2747

2848
clean:
29-
@rm -rf *.h
30-
@rm -rf *.c
49+
@$(RM) $(OBJ_DIR)
50+
@printf "$(OBJ_DIR) in $(NAME)\t \033[31;1mdeleted\033[0m\n"
51+
52+
uninstall:
53+
@$(RM) $(OBJ_DIR)
54+
@$(RM) $(NAME)
55+
@@printf "$(NAME)\t \033[31;1muninstalled\033[0m\n"
56+
57+
reinstall: uninstall all
3158

32-
reinstall: uninstall all
59+
.PHONY: all uninstall clean reinstall

resource/framework/SDL2.framework/Headers

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Headers

resource/framework/SDL2.framework/Resources

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Resources

resource/framework/SDL2.framework/SDL2

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/SDL2

resource/framework/SDL2.framework/Versions/Current

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SDL2_imageFilter.lo - a libtool object file
2+
# Generated by libtool (GNU libtool) 2.4
3+
#
4+
# Please DO NOT delete this file!
5+
# It is necessary for linking the library.
6+
7+
# Name of the PIC object.
8+
pic_object='.libs/SDL2_imageFilter.o'
9+
10+
# Name of the non-PIC object
11+
non_pic_object='SDL2_imageFilter.o'
12+

0 commit comments

Comments
 (0)