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 CTFEXTRAOBJS
= $(OBJS_DIR
)/vers.o
60 DBOOT_OBJS_DIR
= dboot
/$(OBJS_DIR
)
61 DBOOT_OBJECTS
= $(DBOOT_OBJS
:%=$(DBOOT_OBJS_DIR
)/%)
62 DBOOT_BIN
= $(DBOOT_OBJS_DIR
)/$(DBOOT
)
63 DBOOT_O
= $(OBJS_DIR
)/$(DBOOT
).o
64 DBOOT_S
= $(DBOOT_O
:%.o
=%.s
)
67 # Include common rules.
69 include $(UTSBASE
)/i86pc
/Makefile.i86pc
74 ALL_TARGET
= $(UNIX_BIN
)
75 INSTALL_TARGET
= $(UNIX_BIN
) $(ROOTMODULE
)
78 # This is UNIX_DIR. Use a short path.
86 $(UNIX_O
) $(MODSTUBS_O
) \
87 $(OBJS_DIR
)/vers.c
$(OBJS_DIR
)/vers.o \
88 $(OBJS_DIR
)/dtracestubs.s \
89 $(DTRACESTUBS_O
) $(DTRACESTUBS
)
92 $(DBOOT_O
) $(DBOOT_S
) \
94 $(OBJS_DIR
)/bios_call_src.o \
95 $(OBJS_DIR
)/bios_call_src \
96 $(OBJS_DIR
)/bios_call.s \
100 $(OBJS_DIR
)/fb_swtch_src.o \
101 $(OBJS_DIR
)/fb_swtch_src \
102 $(OBJS_DIR
)/fb_swtch.s
105 $(ZLIB_OBJS
:%.o
=$(OBJS_DIR
)/%.o
) \
106 $(ZLIB_OBJS
:%.o
=$(OBJS_DIR
)/%.ln
)
108 CLOBBERFILES
= $(CLEANFILES
) $(UNIX_BIN
)
110 # instr_size needs a special header
111 $(OBJS_DIR
)/instr_size.o
:= EXTRA_OPTIONS
= -I
$(SRC
)/common
/dis
/i386
112 $(OBJS_DIR
)/instr_size.ln
:= EXTRA_OPTIONS
= -I
$(SRC
)/common
/dis
/i386
117 # For now, disable these compiler warnings; maintainers should endeavor to
118 # investigate and remove these for maximum coverage. Please do not carry
119 # these forward to new Makefiles.
122 CERRWARN
+= -Wno-parentheses
123 CERRWARN
+= -Wno-uninitialized
124 CERRWARN
+= -Wno-char-subscripts
125 CERRWARN
+= -Wno-unused-variable
126 CERRWARN
+= -Wno-unused-function
127 CERRWARN
+= -Wno-unused-label
128 CERRWARN
+= -Wno-type-limits
129 CERRWARN
+= -Wno-clobbered
130 CERRWARN
+= -Wno-empty-body
131 CERRWARN
+= -Wno-unused-value
134 # Default build targets.
144 clobber: $(CLOBBER_DEPS
)
146 install: $(INSTALL_DEPS
)
148 MAPFILE_32
= $(MAPFILE
)
149 MAPFILE_64
= $(MAPFILE
).amd64
151 MAPFILE_NAME
= $(MAPFILE_
$(CLASS
))
153 $(UNIX_BIN
): $(UNIX_O
) $(MODSTUBS_O
) $(MAPFILE_NAME
) \
154 $(GENLIB
) $(DTRACESTUBS
) $(DBOOT_O
)
155 $(LD
) -dy
-b
-o
$@
-e dboot_image
-znointerp
-M
$(MAPFILE_NAME
) \
156 $(UNIX_O
) $(DBOOT_O
) $(MODSTUBS_O
) $(LIBOPTS
) \
158 $(MBH_PATCH
) $(UNIX_BIN
)
162 $(UNIX_O
): $(OBJECTS
) $(OBJS_DIR
)/vers.o
163 $(LD
) -r
-o
$@
$(OBJECTS
) $(OBJS_DIR
)/vers.o
165 $(DBOOT_BIN
): $(DBOOT_OBJS_DIR
) $(DBOOT_OBJECTS
) dboot
/Mapfile.dboot
166 $(LD
) -dn
-e _start
-M dboot
/Mapfile.dboot \
167 -o
$(DBOOT_BIN
) $(DBOOT_OBJECTS
)
169 $(DBOOT_O
): $(DBOOT_BIN
)
170 @echo
" .data" > $(DBOOT_S
)
171 @echo
" .globl dboot_image" >> $(DBOOT_S
)
172 @echo
"dboot_image:" >> $(DBOOT_S
)
173 $(ELFEXTRACT
) $(DBOOT_BIN
) >> $(DBOOT_S
)
174 $(COMPILE.s
) -o
$(DBOOT_O
) $(DBOOT_S
)
177 -@mkdir
-p
$@
2> /dev
/null
180 # Special rules for generating assym.h for inclusion in assembly files.
182 $(DSF_DIR
)/$(OBJS_DIR
)/assym.h
$(DSF_DIR
)/$(OBJS_DIR
)/kdi_assym.h
: FRC
183 @cd
$(DSF_DIR
); $(MAKE
) all.targ
186 # Include common targets.
188 include $(UTSBASE
)/i86pc
/Makefile.targ