1 include lunabuild.mkinc
3 include $(lbuild_mkinc)
5 libc_include := $(CURDIR)/includes
11 src_dirs += arch/$(ARCH)
13 obj_files := $(addsuffix .o, $(_LBUILD_SRCS))
15 build_lib := $(BUILD_DIR)/lib
16 build_include := $(BUILD_DIR)/includes
18 libc_include_opt = $(addprefix -I, $(libc_include))
19 global_include_opt = $(addprefix -I, $(INCLUDES) $(_LBUILD_INCS))
21 check_folders := $(src_dirs)
22 check_folders += $(build_lib) $(build_include)
28 @if [ ! -d "$*" ]; then \
29 echo "'$*' is not exists" && exit 1;\
33 @$(call status_,CC,$@)
34 @$(CC) $(CFLAGS) $(libc_include_opt) $(global_include_opt) -c $< -o $@
37 @$(call status_,AS,$@)
38 @$(CC) $(CFLAGS) $(libc_include_opt) $(global_include_opt) -c $< -o $@
40 $(build_lib)/$(BUILD_NAME): $(obj_files)
41 @$(call status_,AR,$(*F))
48 headers: $(libc_include)
49 @$(call status_,INSTALL,$(<F))
50 @cp -r $(libc_include)/* $(build_include)/
52 all: $(addsuffix .check, $(check_folders)) $(build_lib)/$(BUILD_NAME) headers
53 @cp arch/$(ARCH)/crt0.S.o $(build_lib)/crt0.o