Unleashed v1.4
[unleashed.git] / usr / src / boot / sys / boot / i386 / libi386 / Makefile
blob89d9efa7434ad5632247a14b0b25cd27dc2f0dae
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.
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= -Os
20 CPPFLAGS= -nostdinc -I../../../../include -I../../..
21 CPPFLAGS += -I../../../../lib/libz
22 CPPFLAGS += -I../../zfs
23 CPPFLAGS += -D_STANDALONE
25 all install: libi386.a
27 clean: clobber
28 clobber:
29 $(RM) machine x86 $(OBJS) libi386.a
31 AS= $(GNU_ROOT)/bin/gas
32 CC= $(GNUC_ROOT)/bin/gcc
33 OBJCOPY= $(GNU_ROOT)/bin/gobjcopy
34 AS_FLAGS=--32
35 ASFLAGS=-m32
36 AS_CPPFLAGS=
37 COMPILE.s = $(AS) $(AS_FLAGS)
39 SRCS= \
40 amd64_tramp.S \
41 bio.c \
42 biosacpi.c \
43 biosdisk.c \
44 biosmem.c \
45 biospci.c \
46 biospnp.c \
47 biossmap.c \
48 bootinfo.c \
49 bootinfo32.c \
50 bootinfo64.c \
51 comconsole.c \
52 cpuid.c \
53 devicename.c \
54 elf32_freebsd.c \
55 elf64_freebsd.c \
56 i386_copy.c \
57 i386_module.c \
58 linux.c \
59 multiboot.c \
60 multiboot_tramp.S \
61 nullconsole.c \
62 pxe.c \
63 pxetramp.s \
64 relocater_tramp.S \
65 smbios.c \
66 spinconsole.c \
67 time.c \
68 vbe.c \
69 vgasubr.c \
70 vidconsole.c
72 OBJS= \
73 amd64_tramp.o \
74 bio.o \
75 biosacpi.o \
76 biosdisk.o \
77 biosmem.o \
78 biospci.o \
79 biospnp.o \
80 biossmap.o \
81 bootinfo.o \
82 bootinfo32.o \
83 bootinfo64.o \
84 comconsole.o \
85 cpuid.o \
86 devicename.o \
87 elf32_freebsd.o \
88 elf64_freebsd.o \
89 i386_copy.o \
90 i386_module.o \
91 linux.o \
92 multiboot.o \
93 multiboot_tramp.o \
94 nullconsole.o \
95 pxe.o \
96 pxetramp.o \
97 relocater_tramp.o \
98 smbios.o \
99 spinconsole.o \
100 time.o \
101 vbe.o \
102 vgasubr.o \
103 vidconsole.o
105 COMMON= ../../common
106 PNGLITE=$(SRC)/common/pnglite
107 VGASUBR=$(SRC)/common/vga
108 CPPFLAGS += -I$(PNGLITE)
109 SRCS += $(COMMON)/gfx_fb.c $(PNGLITE)/pnglite.c
110 OBJS += gfx_fb.o pnglite.o
111 LIBZFS= ../../zfs
112 SRCS += $(LIBZFS)/devicename_stubs.c
113 OBJS += devicename_stubs.o
115 BOOT_COMCONSOLE_PORT= 0x3f8
116 CFLAGS += -DCOMPORT=${BOOT_COMCONSOLE_PORT}
118 BOOT_COMCONSOLE_SPEED= 9600
119 CFLAGS += -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
121 # Make the disk code more talkative
122 # CFLAGS+= -DDISK_DEBUG
124 # Export serial numbers, UUID, and asset tag from loader.
125 smbios.o := CFLAGS += -DSMBIOS_SERIAL_NUMBERS
126 # Use little-endian UUID format as defined in SMBIOS 2.6.
127 smbios.o := CFLAGS += -DSMBIOS_LITTLE_ENDIAN_UUID
128 # Use network-endian UUID format for backward compatibility.
129 #CFLAGS += -DSMBIOS_NETWORK_ENDIAN_UUID
131 # XXX: make alloca() useable
132 CFLAGS += -Dalloca=__builtin_alloca
134 CFLAGS += -I$(SRC)/common/ficl -I../../libficl \
135 -I../../common -I../common \
136 -I../btx/lib \
137 -I$(SRCTOP)/arch/x86/include/sys/acpi \
138 -I../../.. -I.
139 # the location of libstand
140 CFLAGS += -I../../../../lib/libstand/
142 # Handle FreeBSD specific %b and %D printf format specifiers
143 #FORMAT_EXTENSIONS=-D__printf__=__freebsd_kprintf__
144 #CFLAGS += ${FORMAT_EXTENSIONS}
146 CLEANFILES += machine x86
148 # XXX: clang integrated-as doesn't grok .codeNN directives yet
149 # CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS}
150 # CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS}
151 # CFLAGS += ${CFLAGS.${.IMPSRC:T}}
153 include ../Makefile.inc
155 # For multiboot2.h, must be last, to avoid conflicts
156 CPPFLAGS += -I$(SRCTOP)/include
158 machine:
159 $(RM) machine
160 $(SYMLINK) ../../../i386/include machine
162 x86:
163 $(RM) x86
164 $(SYMLINK) ../../../x86/include x86
166 $(OBJS): machine x86
168 libi386.a: $(OBJS)
169 $(AR) $(ARFLAGS) $@ $(OBJS)
171 %.o: $(LIBZFS)/%.c
172 $(COMPILE.c) -o $@ $<
174 %.o: $(COMMON)/%.c
175 $(COMPILE.c) -o $@ $<
177 %.o: $(PNGLITE)/%.c
178 $(COMPILE.c) -o $@ $<
180 %.o: $(VGASUBR)/%.c
181 $(COMPILE.c) -o $@ $<