2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2015 Toomas Soome <tsoome@me.com>
14 # Copyright 2016 RackTop Systems.
17 include $(SRC
)/Makefile.master
19 CFLAGS
= -O2
-I..
/..
/..
/..
/include -I..
/..
/..
20 CPPFLAGS
= -D_STANDALONE
-DLOADER_ZFS_SUPPORT
26 $(RM
) machine x86
$(OBJS
) libi386.a
28 AS
= $(GNU_ROOT
)/bin
/gas
29 CC
= $(GCC_ROOT
)/bin
/gcc
30 OBJCOPY
= $(GNU_ROOT
)/bin
/gobjcopy
34 COMPILE.s
= $(AS
) $(AS_FLAGS
)
36 SRCS
= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \
37 biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \
38 comconsole.c devicename.c elf32_freebsd.c \
39 elf64_freebsd.c multiboot.c multiboot_tramp.S \
40 i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \
41 smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c linux.c \
43 OBJS
= biosacpi.o bioscd.o biosdisk.o biosmem.o biospnp.o \
44 biospci.o biossmap.o bootinfo.o bootinfo32.o bootinfo64.o \
45 comconsole.o devicename.o elf32_freebsd.o \
46 elf64_freebsd.o multiboot.o multiboot_tramp.o \
47 i386_copy.o i386_module.o nullconsole.o pxe.o pxetramp.o \
48 smbios.o time.o vidconsole.o amd64_tramp.o spinconsole.o linux.o \
52 SRCS
+= $(LIBZFS
)/devicename_stubs.c
53 OBJS
+= devicename_stubs.o
55 BOOT_COMCONSOLE_PORT
= 0x3f8
56 CFLAGS
+= -DCOMPORT
=${BOOT_COMCONSOLE_PORT}
58 BOOT_COMCONSOLE_SPEED
= 9600
59 CFLAGS
+= -DCOMSPEED
=${BOOT_COMCONSOLE_SPEED}
61 # Make the disk code more talkative
62 # CFLAGS+= -DDISK_DEBUG
64 # Export serial numbers, UUID, and asset tag from loader.
65 CFLAGS
+= -DSMBIOS_SERIAL_NUMBERS
66 # Use little-endian UUID format as defined in SMBIOS 2.6.
67 CFLAGS
+= -DSMBIOS_LITTLE_ENDIAN_UUID
68 # Use network-endian UUID format for backward compatibility.
69 #CFLAGS += -DSMBIOS_NETWORK_ENDIAN_UUID
71 # Include simple terminal emulation (cons25-compatible)
74 # XXX: make alloca() useable
75 CFLAGS
+= -Dalloca
=__builtin_alloca
77 CFLAGS
+= -I
$(SRC
)/common
/ficl
-I..
/..
/ficl \
78 -I..
/..
/common
-I..
/common \
80 -I
$(SRCTOP
)/arch
/x86
/include/sys
/acpi \
82 # the location of libstand
83 CFLAGS
+= -I..
/..
/..
/..
/lib
/libstand
/
85 # Handle FreeBSD specific %b and %D printf format specifiers
86 #FORMAT_EXTENSIONS=-D__printf__=__freebsd_kprintf__
87 #CFLAGS += ${FORMAT_EXTENSIONS}
89 CLEANFILES
+= machine x86
91 # XXX: clang integrated-as doesn't grok .codeNN directives yet
92 # CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS}
93 # CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS}
94 # CFLAGS += ${CFLAGS.${.IMPSRC:T}}
96 include ..
/Makefile.inc
98 # For multiboot2.h, must be last, to avoid conflicts
99 CPPFLAGS
+= -I
$(SRCTOP
)/include
103 $(SYMLINK
) ..
/..
/..
/i386
/include machine
107 $(SYMLINK
) ..
/..
/..
/x86
/include x86
112 $(AR
) $(ARFLAGS
) $@
$(OBJS
)
115 $(COMPILE.c
) -o
$@
$<