1 | |
---|
2 | #put your absolute path to almos-mkh dir here |
---|
3 | ALMOSMKH_DIR = /Users/alain/soc/almos-mkh |
---|
4 | |
---|
5 | LIBC_NAME = mini-libc |
---|
6 | #LIBC_NAME = newlib |
---|
7 | |
---|
8 | ARCH_NAME = tsar_mips32 |
---|
9 | #ARCH_NAME = x86_64 |
---|
10 | |
---|
11 | LIBPTHREAD_NAME = mini-libpthread |
---|
12 | |
---|
13 | ifeq ($(ALMOSMKH_DIR),) |
---|
14 | $(error Please define ALMOSMKH_DIR parameter in params-soft.mk!) |
---|
15 | endif |
---|
16 | |
---|
17 | |
---|
18 | ifeq ($(LIBC_NAME), mini-libc) |
---|
19 | LIBC_PATH = $(ALMOSMKH_DIR)/libs/mini-libc/ |
---|
20 | LIBC = $(LIBC_PATH)/build/lib/ |
---|
21 | LIBC_INCLUDE = $(LIBC_PATH)/build/include/ |
---|
22 | endif |
---|
23 | ifeq ($(LIBC_NAME), newlib) |
---|
24 | ifeq ($(ARCH_NAME), tsar_mips32) |
---|
25 | ARCH_NEWLIB=mipsel |
---|
26 | endif |
---|
27 | #TODO for x86 |
---|
28 | LIBC_PATH = $(ALMOSMKH_DIR)/libs/newlib/ |
---|
29 | LIBC = $(LIBC_PATH)/build/$(ARCH_NEWLIB)-almosmkh/lib/ |
---|
30 | LIBC_INCLUDE = $(LIBC_PATH)/build/$(ARCH_NEWLIB)-almosmkh/include/ |
---|
31 | endif |
---|
32 | |
---|
33 | ifeq ($(LIBPTHREAD_NAME), mini-libpthread) |
---|
34 | LIBPTHREAD_PATH = $(ALMOSMKH_DIR)/libs/mini-libpthread/ |
---|
35 | endif |
---|
36 | |
---|
37 | LIBALMOSMKH_PATH = $(ALMOSMKH_DIR)/libs/libalmos-mkh |
---|
38 | #Define path to .a and headers files for libc and libpthread |
---|
39 | LIBPTHREAD = $(LIBPTHREAD_PATH)/build/lib/ |
---|
40 | LIBPTHREAD_INCLUDE = $(LIBPTHREAD_PATH)/build/include/ |
---|
41 | LIBALMOSMKH = $(LIBALMOSMKH_PATH)/build/lib/ |
---|
42 | LIBALMOSMKH_INCLUDE = $(LIBALMOSMKH_PATH)/build/include/ |
---|
43 | |
---|
44 | |
---|
45 | HAL = $(ALMOSMKH_DIR)/hal |
---|
46 | KERNEL = $(ALMOSMKH_DIR)/kernel |
---|
47 | SHARED_INCLUDE = $(KERNEL)/syscalls/shared_include/ |
---|
48 | |
---|
49 | |
---|
50 | ifeq ($(ARCH_NAME), tsar_mips32) |
---|
51 | $(info ARCH_NAME is tsar_mips32) |
---|
52 | export CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ |
---|
53 | -fno-delete-null-pointer-checks -std=gnu89 |
---|
54 | export CC = mipsel-unknown-elf-gcc |
---|
55 | export AS = mipsel-unknown-elf-as |
---|
56 | export LD = mipsel-unknown-elf-ld |
---|
57 | export DU = mipsel-unknown-elf-objdump |
---|
58 | export AR = mipsel-unknown-elf-ar |
---|
59 | export RANLIB = mipsel-unknown-elf-ranlib |
---|
60 | endif |
---|
61 | |
---|
62 | ifeq ($(ARCH_NAME), x86_64) |
---|
63 | $(info ARCH_NAME is x86_64) |
---|
64 | export CFLAGS = -Wall -ffreestanding -mno-red-zone -mno-mmx -mno-sse -mno-avx -g \ |
---|
65 | -fno-delete-null-pointer-checks -mcmodel=large -std=gnu89 |
---|
66 | export CC = gcc |
---|
67 | export AS = as |
---|
68 | export LD = ld |
---|
69 | export DU = objdump |
---|
70 | export AR = ar |
---|
71 | export RANLIB = ranlib |
---|
72 | endif |
---|
73 | |
---|
74 | ifeq ($(ARCH_NAME),) |
---|
75 | $(error Your ARCH_NAME is not support, check params-soft.mk!) |
---|
76 | endif |
---|
77 | |
---|
78 | BOOTLOADER_PATH = boot/$(ARCH_NAME) |
---|
79 | HAL_ARCH = $(HAL)/$(ARCH_NAME) |
---|
80 | |
---|
81 | |
---|
82 | |
---|