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