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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
26 # Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
27 # Copyright 2016 Toomas Soome <tsoome@me.com>
28 # Copyright 2017 Joyent, Inc.
32 # Makefile for system source
34 # include global definitions
35 include Makefile.master
37 # the Targetdirs file is the AT&T target.dirs file in a makefile format.
38 # it defines TARGETDIRS and ROOTDIRS.
41 COMMON_SUBDIRS
= uts lib cmd psm
test
46 # sparc needs to build stand before psm
48 $(SPARC_BLD
)psm
: stand
50 SUBDIRS
= $(COMMON_SUBDIRS
) $($(MACH
)_SUBDIRS
)
52 HDRSUBDIRS
= uts lib cmd
54 # UCB headers are bug-for-bug compatible and not checkable against the header
57 CHKHDRSUBDIRS
= uts lib
59 # The check target also causes smf(5) service manifests to be validated.
69 MSGDDIRS
= $(DOMAINS
:%=$(MSGROOT
)/%)
70 MSGDIRS
= $(MSGROOT
) $(MSGDDIRS
) $(MSGROOT
)/LC_TIME
73 install := TARGET
= install
74 install1
:= TARGET
= install
75 install2
:= TARGET
= install
76 install_h
:= TARGET
= install_h
77 clean := TARGET
= clean
78 clobber := TARGET
= clobber
79 check := TARGET
= check
84 # Note: install does not cause a build in pkg. To build packages,
85 # cd pkg and do a 'make install'
88 all: mapfiles sgs .WAIT
$(SUBDIRS
)
91 # The _msg build is a two-step process. First, the _msg dependency
92 # causes recursive makes in $(MSGSUBDIRS), which stages raw message
93 # files in $(ROOT)/catalog. Second, the action from the install
94 # target rule causes those messages to be post-processed from where
95 # they were staged in $(ROOT)/catalog, and the results placed into the
98 install: install1 install2 _msg
99 @cd msg
; pwd
; $(MAKE
) _msg
100 @
rm -rf
"$(ROOT)/catalog"
102 install1
: mapfiles sgs
104 install2
: install1 .WAIT
$(SUBDIRS
)
106 _msg
: _msgdirs rootdirs FRC
107 @for m in
$(MSGSUBDIRS
); do \
108 cd
$$m; pwd
; $(MAKE
) _msg
; cd ..
; \
112 @cd common
/mapfiles
; pwd
; $(MAKE
) install
114 clean: $(SUBDIRS
) pkg
115 clobber: $(SUBDIRS
) pkg clobber_local
117 @cd tools
; pwd
; $(MAKE
) clobber
118 @cd common
/mapfiles
; pwd
; $(MAKE
) clobber
119 @cd msg
; pwd
; $(MAKE
) clobber
122 # Declare what parts can be built in parallel
124 .PARALLEL
: sysheaders libheaders cmdheaders
125 .PARALLEL
: uts lib boot cmd
test _msg
131 @cd
$@
; pwd
; $(MAKE
) $(TARGET
)
133 sgs
: rootdirs .WAIT sysheaders .WAIT \
134 libheaders cmdheaders
137 # Top-level setup target to setup the development environment that includes
138 # headers, tools and generated mapfiles. Note, although the tools are
139 # dependent on a number of constant mapfiles, the tools themselves are
140 # required to build the generated mapfiles.
142 setup
: bldtools sgs mapfiles
145 @cd tools
; pwd
; $(MAKE
) install
147 rootdirs
: $(ROOTDIRS
)
151 $(ROOTDIRS
) $(MSGDIRS
):
155 @cd lib
; pwd
; $(MAKE
) install_h
158 @cd uts
; pwd
; $(MAKE
) install_h
161 @cd cmd
/devfsadm
; pwd
; $(MAKE
) install_h
162 @cd cmd
/fm
; pwd
; $(MAKE
) install_h
163 @cd cmd
/mdb
; pwd
; $(MAKE
) install_h
165 check: $(CHKHDRSUBDIRS
) $(CHKMFSTSUBDIRS
)