1 |
2 |
jamieiles |
# Copyright Jamie Iles, 2017
|
2 |
|
|
#
|
3 |
|
|
# This file is part of s80x86.
|
4 |
|
|
#
|
5 |
|
|
# s80x86 is free software: you can redistribute it and/or modify
|
6 |
|
|
# it under the terms of the GNU General Public License as published by
|
7 |
|
|
# the Free Software Foundation, either version 3 of the License, or
|
8 |
|
|
# (at your option) any later version.
|
9 |
|
|
#
|
10 |
|
|
# s80x86 is distributed in the hope that it will be useful,
|
11 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
|
|
# GNU General Public License for more details.
|
14 |
|
|
#
|
15 |
|
|
# You should have received a copy of the GNU General Public License
|
16 |
|
|
# along with s80x86. If not, see .
|
17 |
|
|
|
18 |
|
|
include(GetGitRevisionDescription)
|
19 |
|
|
|
20 |
|
|
set(CMAKE_SYSTEM_NAME none)
|
21 |
|
|
set(CMAKE_SYSTEM_PROCESSOR ia16)
|
22 |
|
|
set(CMAKE_C_COMPILER ia16-elf-gcc)
|
23 |
|
|
set(CMAKE_ASM_COMPILER ia16-elf-gcc)
|
24 |
|
|
|
25 |
|
|
# IA16 GCC doesn't support -g
|
26 |
|
|
set(CMAKE_C_FLAGS_DEBUG "")
|
27 |
|
|
set(CMAKE_ASM_FLAGS_DEBUG "")
|
28 |
|
|
|
29 |
|
|
set(CMAKE_C_FLAGS "-Wall -Werror -ffreestanding -O2 -std=gnu99 -mtune=i80186 -march=i80186")
|
30 |
|
|
set(CMAKE_ASM_FLAGS "-Wall -Werror -ffreestanding -O2 -std=gnu99 -nostdinc -mtune=i80186 -march=i80186")
|
31 |
|
|
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Map=${CMAKE_CURRENT_BINARY_DIR}/bios.map -ffreestanding -nostdlib -T ${CMAKE_CURRENT_SOURCE_DIR}/bios.x")
|
32 |
|
|
|
33 |
|
|
get_git_head_revision(BIOS_NAME BIOS_BUILD HEAD)
|
34 |
|
|
git_local_changes(LOCAL_CHANGES)
|
35 |
|
|
string(TIMESTAMP BIOS_BUILD_DATE "%m/%d/%y" UTC)
|
36 |
|
|
string(TIMESTAMP BIOS_BUILD_DAY "0x%d" UTC)
|
37 |
|
|
string(TIMESTAMP BIOS_BUILD_MONTH "0x%m" UTC)
|
38 |
|
|
string(TIMESTAMP BIOS_BUILD_YEAR "0x%Y" UTC)
|
39 |
|
|
string(TIMESTAMP BIOS_BUILD_SECOND "0x%S" UTC)
|
40 |
|
|
string(TIMESTAMP BIOS_BUILD_MINUTE "0x%M" UTC)
|
41 |
|
|
string(TIMESTAMP BIOS_BUILD_HOUR "0x%H" UTC)
|
42 |
|
|
|
43 |
|
|
add_definitions(-D__PLATFORM__="${BIOS_PLATFORM}"
|
44 |
|
|
-D__BUILD__="${BIOS_BUILD}+${LOCAL_CHANGES}"
|
45 |
|
|
-DBIOS_BUILD_DATE=\"${BIOS_BUILD_DATE}\"
|
46 |
|
|
-DBIOS_BUILD_DAY=${BIOS_BUILD_DAY}
|
47 |
|
|
-DBIOS_BUILD_MONTH=${BIOS_BUILD_MONTH}
|
48 |
|
|
-DBIOS_BUILD_YEAR=${BIOS_BUILD_YEAR}
|
49 |
|
|
-DBIOS_BUILD_SECOND=${BIOS_BUILD_SECOND}
|
50 |
|
|
-DBIOS_BUILD_MINUTE=${BIOS_BUILD_MINUTE}
|
51 |
|
|
-DBIOS_BUILD_HOUR=${BIOS_BUILD_HOUR})
|
52 |
|
|
|
53 |
|
|
add_executable(bios-${BIOS_PLATFORM}
|
54 |
|
|
bios.c
|
55 |
|
|
disk.c
|
56 |
|
|
display.c
|
57 |
|
|
entry.S
|
58 |
|
|
io.h
|
59 |
|
|
keyboard.c
|
60 |
|
|
leds.c
|
61 |
|
|
leds.h
|
62 |
|
|
sd.c
|
63 |
|
|
sd.h
|
64 |
|
|
printk.c
|
65 |
|
|
serial.c
|
66 |
|
|
serial.h
|
67 |
|
|
timer.h
|
68 |
|
|
timer.c
|
69 |
|
|
utils.h
|
70 |
|
|
utils.c)
|