-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (37 loc) · 926 Bytes
/
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
include configs/base.mk
include configs/os.mk
include configs/colors.mk
.PHONY: $(LIBS_DIRS) make_optional all multi STATUS_START
multi: make_optional $(LIBS_DIRS) STATUS_START
@$(MAKE) -e $(MAKE_PARALLEL_FLAGS) all
all: $(NAME)
$(NAME): $(OBJS) $(ASMS)
ifneq (,$(OBJS))
@$(CC) $(addprefix -D,$(DEFINES)) \
$(IFLAGS) \
$(OBJS) \
$(CFLAGS) \
$(CFLAGS_OPTIONAL) \
$(CFLAGS_LIBS) \
$(LIBS_NAMES) \
-o $(NAME)
endif
@$(MAKE) STATUS_END
define compilation
$(CC) $(addprefix -D,$(DEFINES)) \
$(CFLAGS) $(CFLAGS_OPTIONAL) $(IFLAGS) \
-c $$1 -o $$2
$(ECHO) " | $$2: $(MSG_SUCCESS)"
endef
-include $(OBJS:.o=.d)
$(OBJS): %.o: %.c
@$(call compilation,$<,$@)
$(ASMS): %.S: %.c
@$(call compilation,$<,$@)
$(LIBS_DIRS):
ifeq (,$(filter $(MAKECMDGOALS), pre debug))
@$(MAKE) -C $@ $(MAKECMDGOALS)
endif
-include configs/rules/STATUS.mk
-include configs/rules/cleaners.mk
-include configs/rules/optional.mk