-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (34 loc) · 1.38 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
export ROOT_DIR := $(shell pwd)
-include $(ROOT_DIR)/config/user_config.mk
include $(ROOT_DIR)/config/version.mk
export ARCH
export CC := $(CROSS_COMPILE_$(ARCH))gcc
export CXX := $(CROSS_COMPILE_$(ARCH))g++
export BUILD_DIR := $(ROOT_DIR)/Build-$(ARCH)/gen
export BIN_DIR := $(ROOT_DIR)/Build-$(ARCH)/ARIX
export MAKE := make -s
export INCLUDE_DIR := $(BIN_DIR)/Development/include
export CFLAGS := -Os -std=c11 -I$(INCLUDE_DIR) $(USER_CFLAGS)
export CXXFLAGS := -Os -std=c++11 -I$(INCLUDE_DIR) $(USER_CXXFLAGS)
export LDFLAGS := $(USER_LDFLAGS)
export SFDC := $(ROOT_DIR)/tools/sfdc/sfdc.py
SUBDIRS := libs devs system test
all: echo_target includes $(SUBDIRS)
echo_target:
@echo "Building ARIX for architecture $(ARCH)"
initrd: includes $(SUBDIRS)
@echo "Building the initial ramdisk"
@echo "* Copying kernel image"
@cp $(ROOT_DIR)/initrd/vmlinuz-$(ARCH) $(ROOT_DIR)/Build-$(ARCH)/vmlinuz
@echo "* Copying initrd template"
@cp $(ROOT_DIR)/initrd/arix_base_cpio-$(ARCH).img.gz $(ROOT_DIR)/Build-$(ARCH)/initrd
@echo "* Appending ARIX initrd"
@cd $(ROOT_DIR)/Build-$(ARCH) && find ARIX | cpio -o -H newc 2>/dev/null | gzip >> $(ROOT_DIR)/Build-$(ARCH)/initrd
includes: echo_target
@echo "Generating header files"
@$(MAKE) -C include includes
@$(MAKE) -C libs includes
@$(MAKE) -C devs includes
$(SUBDIRS): includes
@$(MAKE) -C $@ all
.PHONY: echo_target all includes initrd $(SUBDIRS)