-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (20 loc) · 807 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (20 loc) · 807 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
NAME := zen_engine.a
CFLAGS := -Wall -Werror -Wextra -g
HEADERS := -I ./include
SRCS := $(shell find ./src -iname "*.c")
OBJS := $(SRCS:.c=.o)
all: $(NAME) clean
%.o: %.c
@$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS) && printf "[Zen Engine] Compiling: $(notdir $<)\n"
$(NAME): $(OBJS)
@if [ ! -d ./build ]; then mkdir -p ./build && printf "[Zen Engine] Created ./build directory\n"; fi
@ar -rcs ./build/$(NAME) $(OBJS)
@printf "[Zen Engine] ./build/$(NAME) has been built\n"
clean:
@rm -f $(OBJS)
@printf "[Zen Engine] Cleaned .o files\n"
fclean:
@if [ -f ./build/$(NAME) ]; then rm -f ./build/$(NAME) && printf "[Zen Engine] Deleted ./build/$(NAME)\n"; fi
@if [ -d ./build/ ]; then rm -d ./build && printf "[Zen Engine] Deleted ./build directory\n"; fi
re: fclean all
.PHONY: all clean fclean re