9845 make clobber in uts/intel does attempt to remove debug64/
[unleashed.git] / usr / src / uts / intel / Makefile
blob7fbdb31cb8d66cdb6b305d4582e428d10520d99d
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
21 # uts/intel/Makefile
23 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
26 # This makefile drives the production of all implementation architecture
27 # independent modules for Intel processors.
29 UTSBASE = ..
31 include Makefile.intel
33 # Unset BINARY for clobber.targ because otherwise it will try to remove
34 # a directory under uts/intel.
35 BINARY=
37 LINT_KMODS_X1 = $(LINT_KMODS:nsmb=)
38 LINT_KMODS_X2 = $(LINT_KMODS_X1:smbfs=)
39 LINT_KMODS_X3 = $(LINT_KMODS_X2:e1000g=)
40 LINT_KMODS_X4 = $(LINT_KMODS_X3:qede=)
41 LINT_KMODLIBS = $(LINT_KMODS_X4:iwn=)
42 LINT_LIBS = $(LINT_LIB) $(GEN_LINT_LIB) \
43 $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
46 # dprov is delivered in the SUNWcryptoint package.
48 DRV_KMODS += dprov
52 def := TARGET= def
53 def.prereq := TARGET= def
54 all := TARGET= all
55 all.prereq := TARGET= all
56 install := TARGET= install
57 install.prereq := TARGET= install
58 clean := TARGET= clean
59 clobber := TARGET= clobber
60 lint := TARGET= lint
61 lint.prereq := TARGET= lint
62 modlintlib := TARGET= modlintlib
63 modlist := TARGET= modlist
64 modlist := NO_STATE= -K $$MODSTATE$$$$
65 clean.lint := TARGET= clean.lint
66 check := TARGET= check
67 install_h := TARGET= install_h
68 install_h.prereq := TARGET= install_h
70 .KEEP_STATE:
72 .PARALLEL: $(PARALLEL_KMODS) $(XMODS) config $(LINT_DEPS)
74 def all install clean clobber modlist: $(KMODS) $(XMODS) config
76 clobber: clobber.targ
79 # Privilege constants
81 # NOTE: The rules for generating priv_const.c file are shared between all
82 # processor architectures and and should be kept in sync. If they are changed in
83 # this file make sure that sparc rules are updated as well.
85 PRIVS_C = $(SRC)/uts/common/os/priv_const.c
87 $(PRIVS_C): $(PRIVS_AWK) $(PRIVS_DEF)
88 $(AWK) -f $(PRIVS_AWK) < $(PRIVS_DEF) cfile=$@
90 CLOBBERFILES += $(PRIVS_C)
93 # Prerequisites
95 # The uts/Makefile defines build parallelism for x86 platforms such that i86pc,
96 # i86xpv and intel are all built in parallel. This requires building certain
97 # parts before the parallel build can start. The uts/Makefile appends the
98 # '.prereq' string to the original target and executes this Makefile to build
99 # any prerequisites needed before the full parallel build can start. After that
100 # make continues with normal targets.
102 # Any build prerequisites for x86 builds should be described here.
104 # genassym is used to build intel/dtrace and genunix, so it should be built
105 # first.
107 # priv_const.c is required to build genunix.
109 # genunix is used by everyone to ctf-merge with. Genunix is CTF-merged with
110 # intel/ip so as a side effect this dependency builds intel/ip as part of the
111 # prerequisites.
113 # intel/dtrace depends on i86pc/genassym, so we need to build both
114 # i86pc/genassym and intel/genassym.
116 all.prereq install.prereq def.prereq: genunix FRC
117 @cd ../i86pc/genassym; pwd; $(MAKE) $(@:%.prereq=%)
120 # i86pc lint libraries should be built first
122 lint.prereq: FRC
123 @cd ../i86pc; pwd; $(MAKE) $(NO_STATE) lint
126 # Nothing to do for any other prerequisite targets.
128 %.prereq:
130 genunix: $(PRIVS_C)
132 modlintlib clean.lint: $(LINT_KMODS) $(XMODS)
134 $(KMODS) $(SUBDIRS) config: FRC
135 @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
137 $(XMODS): FRC
138 @if [ -f $@/Makefile ]; then \
139 cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET); \
140 else \
141 true; \
144 install_h check: FRC
145 @cd sys; pwd; $(MAKE) $(TARGET)
146 @cd asm; pwd; $(MAKE) $(TARGET)
147 @cd ia32/sys; pwd; $(MAKE) $(TARGET)
148 @cd amd64/sys; pwd; $(MAKE) $(TARGET)
151 # Work-around to disable acpica global crosscheck lint warnings
153 LGREP.intel = grep -v 'intel/io/acpica'
156 # Full kernel lint target.
158 LINT_TARGET = globallint
160 # workaround for multiply defined errors
161 globallint := LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
163 globallint:
164 @pwd
165 @-$(ECHO) "\nFULL KERNEL: global crosschecks:"
166 @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.intel) | $(LGREP.2)
168 lint: modlintlib .WAIT $(LINT_DEPS)
170 include ../Makefile.targ