4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 # This makefile drives the production of unix (and unix.o).
28 # i86pc implementation architecture dependent
32 # Path to the base of the uts directory tree (usually /usr/src/uts).
37 # Define the module and object file sets.
42 OBJECTS
= $(SPECIAL_OBJS
:%=$(OBJS_DIR
)/%) \
43 $(CORE_OBJS
:%=$(OBJS_DIR
)/%) \
44 $(KRTLD_OBJS
:%=$(OBJS_DIR
)/%) \
45 $(MACH_NOT_YET_KMODS
:%=$(OBJS_DIR
)/%)
47 ROOTMODULE
= $(ROOT_PSM_KERN_DIR
)/$(UNIX
)
49 UNIX_BIN
= $(OBJS_DIR
)/$(UNIX
)
54 GENUNIX_DIR
= ..
/..
/intel
/$(GENUNIX
)
56 LIBOPTS
= -L
$(GENUNIX_DIR
)/$(OBJS_DIR
) -l
$(GENUNIX
)
58 COMMP_CTF_SRC
= $(OBJS_DIR
)/comm_page_ctf.c
60 CTFEXTRAOBJS
= $(OBJS_DIR
)/vers.o
$(OBJS_DIR
)/comm_page_ctf.o
62 DBOOT_OBJS_DIR
= dboot
/$(OBJS_DIR
)
63 DBOOT_OBJECTS
= $(DBOOT_OBJS
:%=$(DBOOT_OBJS_DIR
)/%)
64 DBOOT_BIN
= $(DBOOT_OBJS_DIR
)/$(DBOOT
)
65 DBOOT_O
= $(OBJS_DIR
)/$(DBOOT
).o
66 DBOOT_S
= $(DBOOT_O
:%.o
=%.s
)
69 # Include common rules.
71 include $(UTSBASE
)/i86pc
/Makefile.i86pc
76 ALL_TARGET
= $(UNIX_BIN
)
77 INSTALL_TARGET
= $(UNIX_BIN
) $(ROOTMODULE
)
80 # This is UNIX_DIR. Use a short path.
88 $(UNIX_O
) $(MODSTUBS_O
) \
90 $(OBJS_DIR
)/dtracestubs.s \
91 $(DTRACESTUBS_O
) $(DTRACESTUBS
) \
96 $(DBOOT_O
) $(DBOOT_S
) \
98 $(OBJS_DIR
)/bios_call_src.o \
99 $(OBJS_DIR
)/bios_call_src \
100 $(OBJS_DIR
)/bios_call.s \
104 $(DBOOT_OBJS_DIR
)/$(VGATEXT_FONT
).c \
105 $(OBJS_DIR
)/$(VGATEXT_FONT
).c
108 $(OBJS_DIR
)/fb_swtch_src.o \
109 $(OBJS_DIR
)/fb_swtch_src \
110 $(OBJS_DIR
)/fb_swtch.s
113 $(ZLIB_OBJS
:%.o
=$(OBJS_DIR
)/%.o
) \
114 $(ZLIB_OBJS
:%.o
=$(OBJS_DIR
)/%.ln
)
116 CLOBBERFILES
= $(CLEANFILES
) $(UNIX_BIN
)
118 # instr_size needs a special header
119 $(OBJS_DIR
)/instr_size.o
:= EXTRA_OPTIONS
= -I
$(SRC
)/common
/dis
/i386
120 $(OBJS_DIR
)/instr_size.ln
:= EXTRA_OPTIONS
= -I
$(SRC
)/common
/dis
/i386
124 $(OBJS_DIR
)/decompress.o
:= EXTRA_OPTIONS
= -I
$(SRCTOP
)/kernel
/zmod
127 # For now, disable these compiler warnings; maintainers should endeavor to
128 # investigate and remove these for maximum coverage. Please do not carry
129 # these forward to new Makefiles.
132 CERRWARN
+= -Wno-parentheses
133 CERRWARN
+= -Wno-uninitialized
134 CERRWARN
+= -Wno-char-subscripts
135 CERRWARN
+= -Wno-unused-variable
136 CERRWARN
+= -Wno-unused-function
137 CERRWARN
+= -Wno-unused-label
138 CERRWARN
+= -Wno-type-limits
139 CERRWARN
+= -Wno-clobbered
140 CERRWARN
+= -Wno-empty-body
141 CERRWARN
+= -Wno-unused-value
144 # Default build targets.
154 clobber: $(CLOBBER_DEPS
)
156 install: $(INSTALL_DEPS
)
158 $(UNIX_BIN
): $(UNIX_O
) $(MODSTUBS_O
) $(MAPFILE
) \
159 $(GENLIB
) $(DTRACESTUBS
) $(DBOOT_O
)
160 $(LD
) -dy
-b
-o
$@
-e dboot_image
-znointerp
-M
$(MAPFILE
) \
161 $(UNIX_O
) $(DBOOT_O
) $(MODSTUBS_O
) $(LIBOPTS
) \
163 $(MBH_PATCH
) $(UNIX_BIN
)
167 $(UNIX_O
): $(OBJECTS
) $(CTFEXTRAOBJS
)
168 $(LD
) -r
-o
$@
$(OBJECTS
) $(OBJS_DIR
)/vers.o
170 $(DBOOT_BIN
): $(DBOOT_OBJS_DIR
) $(DBOOT_OBJECTS
) \
171 $(SRCTOP
)/arch
/x86
/kernel
/platform
/i86pc
/dboot
/mapfile-dboot
172 $(LD
) -dn
-e _start
-M \
173 $(SRCTOP
)/arch
/x86
/kernel
/platform
/i86pc
/dboot
/mapfile-dboot \
174 -o
$(DBOOT_BIN
) $(DBOOT_OBJECTS
)
176 $(DBOOT_O
): $(DBOOT_BIN
)
177 @echo
" .data" > $(DBOOT_S
)
178 @echo
" .globl dboot_image" >> $(DBOOT_S
)
179 @echo
"dboot_image:" >> $(DBOOT_S
)
180 $(ELFEXTRACT
) $(DBOOT_BIN
) >> $(DBOOT_S
)
181 $(COMPILE.s
) -o
$(DBOOT_O
) $(DBOOT_S
)
184 -@mkdir
-p
$@
2> /dev
/null
186 $(COMMP_CTF_SRC
): $(UTSBASE
)/i86pc
/ml
/comm_page.s
187 $(COMPILE.
cpp) -D_GENCTF
-o
$@
$(UTSBASE
)/i86pc
/ml
/comm_page.s
189 $(OBJS_DIR
)/comm_page_ctf.o
: $(COMMP_CTF_SRC
)
190 $(COMPILE.c
) -o
$@
$<
194 # Special rules for generating assym.h for inclusion in assembly files.
196 $(DSF_DIR
)/$(OBJS_DIR
)/assym.h
$(DSF_DIR
)/$(OBJS_DIR
)/kdi_assym.h
: FRC
197 @cd
$(DSF_DIR
); $(MAKE
) all.targ
200 # Include common targets.
202 include $(UTSBASE
)/i86pc
/Makefile.targ