Unleashed v1.4
[unleashed.git] / usr / src / uts / Makefile
blob4b403c512fb65370ee69978c0446685d50db9fcd
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
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 # Copyright 2018 Nexenta Systems, Inc.
28 include ../Makefile.master
31 # List of architectures to build as part of the standard build.
33 # Some of these architectures are built in parallel (see i386_PARALLEL).
34 # This requires building some parts first before parallel build can start.
35 # Platform make files know what should be built as a prerequisite for the
36 # parallel build to work. The i386_PREREQ and sparc_PREREQ variables tell
37 # which platform directory to enter to start making prerequisite dependencies.
39 i386_ARCHITECTURES = i86pc intel
42 # For i386 all architectures can be compiled in parallel.
44 # intel/Makefile knows how to build prerequisites needed for parallel build.
46 i386_PREREQ = intel
47 i386_PARALLEL = $(i386_ARCHITECTURES)
50 # Platforms defined in $(MACH)_PARALLEL are built in parallel. DUMMY is placed
51 # at the end in case $(MACH)_PARALLEL is empty to prevent everything going in
52 # parallel.
54 .PARALLEL: $($(MACH)_PARALLEL) DUMMY
57 # For build prerequisites we use a special target which is constructed by adding
58 # '.prereq' suffix to the $(MACH)_PREREQ.
60 PREREQ_TARGET = $($(MACH)_PREREQ:%=%.prereq)
63 def := TARGET= def
64 all := TARGET= all
65 install := TARGET= install
66 install_h := TARGET= install_h
67 clean := TARGET= clean
68 clobber := TARGET= clobber
69 clobber_h := TARGET= clobber
70 check := TARGET= check
71 modlist := TARGET= modlist
72 modlist := NO_STATE= -K $$MODSTATE$$$$
74 .KEEP_STATE:
76 def all: all_h $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
78 install: all_h install_dirs $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
80 install_dirs:
81 @cd ..; pwd; $(MAKE) rootdirs
82 @pwd
85 # Rule to build prerequisites. The left part of the pattern will match
86 # PREREQ_TARGET.
88 # The location of the Makefile is determined by strippinng '.prereq' suffix from
89 # the target name. We add '.prereq' suffix to the target passed to the child
90 # Makefile so that it can distinguish prerequisite build from the regular one.
93 %.prereq:
94 @cd $(@:%.prereq=%); pwd; $(MAKE) $(NO_STATE) $(TARGET).prereq
97 # Rule to build architecture files. Build all required prerequisites and then
98 # build the rest (potentially in parallel).
100 $($(MACH)_ARCHITECTURES): $(PREREQ_TARGET) FRC
101 @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
105 # The following is the list of directories which contain Makefiles with
106 # targets to install header file. The machine independent headers are
107 # installed by invoking the Makefile in the directory containing the
108 # header files. Machine and architecture dependent headers are installed
109 # by invoking the main makefile for that architecture/machine which,
110 # in turn, is responsible for invoking the Makefiles which install headers.
111 # It is done this way so as not to assume that all of the header files in
112 # the architecture/machine dependent subdirectories are in completely
113 # isomorphic locations.
115 COMMON_HDRDIRS= common/des \
116 common/gssapi \
117 common/idmap \
118 common/klm \
119 common/io/bpf/net \
120 common/io/fibre-channel/fca/qlc \
121 common/ipp \
122 common/netinet \
123 common/nfs \
124 common/rpc \
125 common/rpcsvc \
126 common/sharefs \
127 common/smb \
128 common/smbsrv
132 # Subset of COMMON_HDRDIRS in which at least one header is generated
133 # at runtime (e.g., rpcgen), and in which "make clean" should run.
134 # Other directories should be included here, but do not yet have the
135 # necessary Makefile support (make clean).
137 DYNHDRDIRS = common/gssapi \
138 common/idmap \
139 common/io/fibre-channel/fca/qlc \
140 common/klm \
141 common/rpc \
142 common/rpcsvc
144 i386_HDRDIRS=
146 HDRDIRS= $(COMMON_HDRDIRS) $($(MACH)_HDRDIRS)
147 install_h check: $(HDRDIRS) $($(MACH)_ARCHITECTURES)
149 $(HDRDIRS): FRC
150 @cd $@; pwd; $(MAKE) $(TARGET)
152 # ensures that headers made by rpcgen and others are available in uts source
153 # for kernel builds to reference without building install_h
155 all_h: FRC
156 @cd common/rpc; pwd; $(MAKE) $@
157 @cd common/rpcsvc; pwd; $(MAKE) $@
158 @cd common/gssapi; pwd; $(MAKE) $@
159 @cd common/idmap; pwd; $(MAKE) $@
160 @cd common/klm; pwd; $(MAKE) $@
162 clean clobber: $($(MACH)_ARCHITECTURES) $(DYNHDRDIRS)
164 # testing convenience
165 clobber_h: $(DYNHDRDIRS)
167 modlist: $($(MACH)_ARCHITECTURES)
169 FRC: