-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 979 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
include configs/base.mk
include configs/os.mk
include configs/colors.mk
.PHONY: make_optional all multi STATUS_START
multi: make_optional STATUS_START
@$(MAKE) -e $(MAKE_PARALLEL_FLAGS) all
all: $(NAME)
$(NAME): $(OBJS) $(ASMS)
ifneq (,$(OBJS))
ifeq (.a,$(suffix $(NAME)))
@$(AR) $(ARFLAGS) $(NAME) $(OBJS)
else
@$(CC) $(CFLAGS) $(CFLAGS_OPTIONAL) $(CFLAGS_SHARED) $(OBJS) -o $(NAME)
endif
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,$<,$@)
-include configs/rules/STATUS.mk
-include configs/rules/cleaners.mk
.PHONY: re pre clean_asms clean_deps clean fclean
-include configs/rules/optional.mk
.PHONY: debug debug_all sanitize sanitize_all assembly assembly_all debug_assembly debug_assembly_all pedantic pedantic_all