xref: /illumos-gate/usr/src/boot/i386/libi386/Makefile (revision ef150c2b)
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
99gfx_fb.o := CPPFLAGS += $(DEFAULT_CONSOLE_COLOR) -I$(LZ4)
100pnglite.o := CPPFLAGS += -I$(ZLIB)
101
102SRCS +=	$(ZFSSRC)/devicename_stubs.c
103OBJS +=	devicename_stubs.o
104
105BOOT_COMCONSOLE_PORT= 0x3f8
106CPPFLAGS +=	-DCOMPORT=${BOOT_COMCONSOLE_PORT}
107
108BOOT_COMCONSOLE_SPEED= 9600
109CPPFLAGS +=	-DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
110
111# Make the disk code more talkative
112# CPPFLAGS+= -DDISK_DEBUG
113
114# XXX: make alloca() useable
115CPPFLAGS += -Dalloca=__builtin_alloca
116
117CPPFLAGS +=	-I$(SRC)/common/ficl -I../../libficl \
118		-I../../common -I../common \
119		-I../btx/lib \
120		-I$(SRC)/uts/intel/sys/acpi \
121		-I.
122# the location of libstand
123CPPFLAGS +=	-I../../libsa
124
125multiboot.o := CPPFLAGS += -I../../sys/cddl/boot/zfs
126multiboot2.o := CPPFLAGS += -I../../sys/cddl/boot/zfs
127devicename.o := CPPFLAGS += -I../../sys/cddl/boot/zfs
128devicename_stubs.o := CPPFLAGS += -I../../sys/cddl/boot/zfs
129
130CLEANFILES +=	machine x86
131
132include ../Makefile.inc
133
134# For multiboot2.h, must be last, to avoid conflicts
135CPPFLAGS +=	-I$(SRC)/uts/common
136
137machine:
138	$(RM) machine
139	$(SYMLINK) ../../sys/i386/include machine
140
141x86:
142	$(RM) x86
143	$(SYMLINK) ../../sys/x86/include x86
144
145$(OBJS): machine x86
146
147libi386.a: $(OBJS)
148	$(AR) $(ARFLAGS) $@ $(OBJS)
149
150%.o:	$(ZFSSRC)/%.c
151	$(COMPILE.c) -o $@ $<
152
153%.o:	$(COMMON)/%.c
154	$(COMPILE.c) -o $@ $<
155
156%.o:	$(PNGLITE)/%.c
157	$(COMPILE.c) -o $@ $<
158
159%.o:	$(VGASUBR)/%.c
160	$(COMPILE.c) -o $@ $<
161