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