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