|
|
e0aa75 |
libc_src_dirs = $(SOURCE_DIR)/src/*/
|
|
|
e0aa75 |
libc_src_dirs += $(SOURCE_DIR)/crt/
|
|
|
e0aa75 |
libc_src_dirs += $(SOURCE_DIR)/ldso/
|
|
|
3ae283 |
|
|
|
e0aa75 |
ifeq ($(PORT_DIR),$(PROJECT_DIR))
|
|
|
e0aa75 |
libc_src_dirs += $(PROJECT_DIR)/src/*/
|
|
|
e0aa75 |
libc_src_dirs += $(PROJECT_DIR)/crt/
|
|
|
e0aa75 |
libc_src_dirs += $(PROJECT_DIR)/ldso/
|
|
|
e0aa75 |
endif
|
|
|
3ae283 |
|
|
|
e0aa75 |
libc_src_files = $(wildcard $(addsuffix *.c,$(libc_src_dirs)))
|
|
|
e0aa75 |
libc_src_sorted = $(sort $(libc_src_files))
|
|
|
3ae283 |
|
|
|
e0aa75 |
libc_src_merged = $(subst $(SOURCE_DIR)/,./, \
|
|
|
e0aa75 |
$(subst $(PROJECT_DIR)/,./, \
|
|
|
e0aa75 |
$(libc_src_sorted)))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_arch_dirs = $(wildcard $(addsuffix $(ARCH)/, $(libc_src_dirs)))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_arch_files_c = $(wildcard $(addsuffix *.c,$(libc_arch_dirs)))
|
|
|
e0aa75 |
libc_arch_files_s = $(wildcard $(addsuffix *.s,$(libc_arch_dirs)))
|
|
|
e0aa75 |
libc_arch_files_S = $(wildcard $(addsuffix *.S,$(libc_arch_dirs)))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_arch_files = $(subst $(SOURCE_DIR)/,./, \
|
|
|
e0aa75 |
$(subst $(PROJECT_DIR)/,./, \
|
|
|
e0aa75 |
$(libc_arch_files_c) \
|
|
|
e0aa75 |
$(libc_arch_files_s) \
|
|
|
e0aa75 |
$(libc_arch_files_S)))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_arch_substs_c = $(subst /$(ARCH)/,/,$(libc_arch_files_c))
|
|
|
e0aa75 |
libc_arch_substs_s = $(subst /$(ARCH)/,/,$(libc_arch_files_s))
|
|
|
e0aa75 |
libc_arch_substs_S = $(subst /$(ARCH)/,/,$(libc_arch_files_S))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_arch_substs = $(subst $(SOURCE_DIR)/,./, \
|
|
|
e0aa75 |
$(subst $(PROJECT_DIR)/,./, \
|
|
|
e0aa75 |
$(libc_arch_substs_c) \
|
|
|
e0aa75 |
$(libc_arch_substs_s:%.s=%.c) \
|
|
|
e0aa75 |
$(libc_arch_substs_S:%.S=%.c)))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_pure_files = $(filter-out $(libc_arch_substs), $(libc_src_merged))
|
|
|
e0aa75 |
libc_all_files = $(libc_pure_files) $(libc_arch_files)
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_crt_files_c = $(filter ./crt/%.c, $(libc_all_files))
|
|
|
e0aa75 |
libc_crt_files_s = $(filter ./crt/%.s, $(libc_all_files))
|
|
|
e0aa75 |
libc_crt_files_S = $(filter ./crt/%.S, $(libc_all_files))
|
|
|
e0aa75 |
libc_crt_files = $(filter ./crt/%, $(libc_all_files))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_ldso_files = $(filter ./ldso/%, $(libc_all_files))
|
|
|
e0aa75 |
libc_ldso_files += $(filter ./src/ldso/%, $(libc_all_files))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_ldso_files_c = $(filter %.c, $(libc_ldso_files))
|
|
|
e0aa75 |
libc_ldso_files_s = $(filter %.s, $(libc_ldso_files))
|
|
|
e0aa75 |
libc_ldso_files_S = $(filter %.S, $(libc_ldso_files))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_excl_files = $(libc_crt_files) $(libc_ldso_files)
|
|
|
e0aa75 |
libc_core_files = $(filter-out $(libc_excl_files), $(libc_all_files))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_core_files_c = $(filter %.c, $(libc_core_files))
|
|
|
e0aa75 |
libc_core_files_s = $(filter %.s, $(libc_core_files))
|
|
|
e0aa75 |
libc_core_files_S = $(filter %.S, $(libc_core_files))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_tree_dirs = $(subst $(SOURCE_DIR)/,./, \
|
|
|
e0aa75 |
$(subst $(PORT_DIR)/,./, \
|
|
|
e0aa75 |
$(wildcard $(SOURCE_DIR)/src/*/) \
|
|
|
e0aa75 |
$(wildcard $(PORT_DIR)/src/*/) \
|
|
|
e0aa75 |
$(wildcard $(SOURCE_DIR)/src/*/$(ARCH)/) \
|
|
|
e0aa75 |
$(wildcard $(PORT_DIR)/src/*/$(ARCH)/)))
|
|
|
e0aa75 |
|
|
|
e0aa75 |
libc_tree_dirs += ./crt/ ./crt/$(ARCH)/
|
|
|
e0aa75 |
libc_tree_dirs += ./ldso/ ./ldso/$(ARCH)/
|