-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (40 loc) · 1.43 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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: mraasvel <[email protected]> +#+ #
# +#+ #
# Created: 2021/04/13 22:14:27 by mraasvel #+# #+# #
# Updated: 2021/04/14 16:41:50 by mraasvel ######## odam.nl #
# #
# **************************************************************************** #
include settings.mk
.PHONY: all
all:
$(MAKE) -j4 -C $(LFTDIR)
$(MAKE) -j4 $(NAME)
# Compilation
$(NAME): $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LFLAGS)
$(ODIR)%.o: $(SDIR)/%.c
@mkdir -p $(@D)
$(CC) -c -o $@ $< $(CFLAGS) $(IFLAGS)
$(DDIR)%.d: $(SDIR)/%.c
@mkdir -p $(@D)
$(CC) $< -MM -MF $@ -MT $(ODIR)$*.o $(IFLAGS)
# Cleanup
.PHONY: clean fclean cleanall re
clean:
$(RM) $(OBJ)
fclean:
$(MAKE) clean
$(RM) $(NAME)
cleanall: fclean
$(RM) -r $(DDIR)
$(RM) -r $(ODIR)
$(MAKE) fclean -C $(LFTDIR)
re: fclean
$(MAKE) all
# Header dependencies
-include $(DEP)