1# 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 5# 1.0 of the CDDL. 6# 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. 10# 11 12# 13# Copyright 2015 Toomas Soome <tsoome@me.com> 14# Copyright 2016 RackTop Systems. 15# 16 17include $(SRC)/Makefile.master 18include $(SRC)/boot/Makefile.inc 19 20CPPFLAGS += -I../../include -I../../sys 21CPPFLAGS += -I$(ZFSSRC) 22 23all install: libi386.a 24 25clean: clobber 26clobber: 27 $(RM) machine x86 $(OBJS) libi386.a 28 29SRCS= \ 30 amd64_tramp.S \ 31 bio.c \ 32 biosacpi.c \ 33 biosdisk.c \ 34 biosmem.c \ 35 biospci.c \ 36 biospnp.c \ 37 biossmap.c \ 38 bootinfo.c \ 39 bootinfo32.c \ 40 bootinfo64.c \ 41 comconsole.c \ 42 cpuid.c \ 43 devicename.c \ 44 elf32_freebsd.c \ 45 elf64_freebsd.c \ 46 i386_copy.c \ 47 i386_module.c \ 48 linux.c \ 49 multiboot.c \ 50 multiboot_tramp.S \ 51 nullconsole.c \ 52 pxe.c \ 53 pxetramp.s \ 54 relocater_tramp.S \ 55 spinconsole.c \ 56 time.c \ 57 vbe.c \ 58 vgasubr.c \ 59 vidconsole.c 60 61OBJS= \ 62 amd64_tramp.o \ 63 bio.o \ 64 biosacpi.o \ 65 biosdisk.o \ 66 biosmem.o \ 67 biospci.o \ 68 biospnp.o \ 69 biossmap.o \ 70 bootinfo.o \ 71 bootinfo32.o \ 72 bootinfo64.o \ 73 comconsole.o \ 74 cpuid.o \ 75 devicename.o \ 76 elf32_freebsd.o \ 77 elf64_freebsd.o \ 78 i386_copy.o \ 79 i386_module.o \ 80 linux.o \ 81 multiboot.o \ 82 multiboot_tramp.o \ 83 nullconsole.o \ 84 pxe.o \ 85 pxetramp.o \ 86 relocater_tramp.o \ 87 spinconsole.o \ 88 time.o \ 89 vbe.o \ 90 vgasubr.o \ 91 vidconsole.o 92 93COMMON= ../../common 94VGASUBR=$(SRC)/common/vga 95CPPFLAGS += -I$(PNGLITE) 96SRCS += $(COMMON)/gfx_fb.c $(PNGLITE)/pnglite.c 97OBJS += gfx_fb.o pnglite.o 98 99biosacpi.o := CFLAGS += -_gcc14=--param=min-pagesize=0 100biosdisk.o := CFLAGS += -_gcc14=--param=min-pagesize=0 101gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR) -I$(LZ4) 102pnglite.o := CPPFLAGS += -I$(ZLIB) 103 104SRCS += $(ZFSSRC)/devicename_stubs.c 105OBJS += devicename_stubs.o 106 107BOOT_COMCONSOLE_PORT= 0x3f8 108CPPFLAGS += -DCOMPORT=${BOOT_COMCONSOLE_PORT} 109 110BOOT_COMCONSOLE_SPEED= 9600 111CPPFLAGS += -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} 112 113# Make the disk code more talkative 114# CPPFLAGS+= -DDISK_DEBUG 115 116# XXX: make alloca() useable 117CPPFLAGS += -Dalloca=__builtin_alloca 118 119CPPFLAGS += -I$(SRC)/common/ficl -I../../libficl \ 120 -I../../common -I../common \ 121 -I../btx/lib \ 122 -I$(SRC)/uts/intel/sys/acpi \ 123 -I. 124# the location of libstand 125CPPFLAGS += -I../../libsa 126 127multiboot.o := CPPFLAGS += -I../../sys/cddl/boot/zfs 128multiboot2.o := CPPFLAGS += -I../../sys/cddl/boot/zfs 129devicename.o := CPPFLAGS += -I../../sys/cddl/boot/zfs 130devicename_stubs.o := CPPFLAGS += -I../../sys/cddl/boot/zfs 131 132CLEANFILES += machine x86 133 134include ../Makefile.inc 135 136# For multiboot2.h, must be last, to avoid conflicts 137CPPFLAGS += -I$(SRC)/uts/common 138 139machine: 140 $(RM) machine 141 $(SYMLINK) ../../sys/i386/include machine 142 143x86: 144 $(RM) x86 145 $(SYMLINK) ../../sys/x86/include x86 146 147$(OBJS): machine x86 148 149libi386.a: $(OBJS) 150 $(AR) $(ARFLAGS) $@ $(OBJS) 151 152%.o: $(ZFSSRC)/%.c 153 $(COMPILE.c) -o $@ $< 154 155%.o: $(COMMON)/%.c 156 $(COMPILE.c) -o $@ $< 157 158%.o: $(PNGLITE)/%.c 159 $(COMPILE.c) -o $@ $< 160 161%.o: $(VGASUBR)/%.c 162 $(COMPILE.c) -o $@ $< 163