libuutil: move under bmake
[unleashed.git] / usr / src / Makefile
blob16f2ae91a269f86eb870200d1ac3b7992e80c1b0
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 (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.
39 include Targetdirs
41 COMMON_SUBDIRS= uts lib cmd psm test
42 sparc_SUBDIRS= stand
43 i386_SUBDIRS= boot
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
55 # standards.
57 CHKHDRSUBDIRS= uts lib
60 # Headers that can be built in parallel
62 PARALLEL_HEADERS = sysheaders libheaders cmdheaders
65 # Directories that can be built in parallel
67 PARALLEL_DIRS = uts lib
69 # The check target also causes smf(5) service manifests to be validated.
70 CHKMFSTSUBDIRS= cmd
72 MSGSUBDIRS= cmd lib
73 DOMAINS= \
74 SUNW_OST_ADMIN \
75 SUNW_OST_NETRPC \
76 SUNW_OST_OSCMD \
77 SUNW_OST_OSLIB
79 MSGDDIRS= $(DOMAINS:%=$(MSGROOT)/%)
80 MSGDIRS= $(MSGROOT) $(MSGDDIRS) $(MSGROOT)/LC_TIME
82 all := TARGET= all
83 install := TARGET= install
84 install1 := TARGET= install
85 install2 := TARGET= install
86 install_h := TARGET= install_h
87 clean := TARGET= clean
88 clobber := TARGET= clobber
89 check := TARGET= check
91 .KEEP_STATE:
94 # Note: install does not cause a build in pkg. To build packages,
95 # cd pkg and do a 'make install'
98 all: mapfiles sgs .WAIT $(SUBDIRS)
101 # The _msg build is a two-step process. First, the _msg dependency
102 # causes recursive makes in $(MSGSUBDIRS), which stages raw message
103 # files in $(ROOT)/catalog. Second, the action from the install
104 # target rule causes those messages to be post-processed from where
105 # they were staged in $(ROOT)/catalog, and the results placed into the
106 # proto area.
108 install: install1 install2 _msg
109 @cd msg; pwd; $(MAKE) _msg
110 @rm -rf "$(ROOT)/catalog"
112 install1: mapfiles sgs
114 install2: install1 .WAIT $(SUBDIRS)
116 _msg: _msgdirs rootdirs FRC
117 @for m in $(MSGSUBDIRS); do \
118 cd $$m; pwd; $(MAKE) _msg; cd ..; \
119 done
121 mapfiles: bldtools
122 @cd common/mapfiles; pwd; $(MAKE) install
124 clean: $(SUBDIRS) pkg
125 clobber: $(SUBDIRS) pkg clobber_local
126 clobber_local:
127 @cd tools; pwd; $(MAKE) clobber
128 @cd common/mapfiles; pwd; $(MAKE) clobber
129 @cd msg; pwd; $(MAKE) clobber
132 # Declare what parts can be built in parallel
133 # DUMMY at the end is used in case macro expansion produces an empty string to
134 # prevent everything going in parallel
136 .PARALLEL: $(PARALLEL_HEADERS) DUMMY
137 .PARALLEL: $(PARALLEL_DIRS) DUMMY
139 $(SUBDIRS) pkg: FRC
140 @cd $@; pwd; $(MAKE) $(TARGET)
142 sgs: rootdirs .WAIT sysheaders .WAIT \
143 libheaders cmdheaders
146 # Top-level setup target to setup the development environment that includes
147 # headers, tools and generated mapfiles. Note, although the tools are
148 # dependent on a number of constant mapfiles, the tools themselves are
149 # required to build the generated mapfiles.
151 setup: bldtools sgs mapfiles
153 bldtools:
154 @cd tools; pwd; $(MAKE) install
156 # /var/mail/:saved is a special case because of the colon in the name.
158 rootdirs: $(ROOTDIRS)
159 $(INS) -d -m 775 $(ROOT)/var/mail/:saved
161 _msgdirs: $(MSGDIRS)
163 $(ROOTDIRS) $(MSGDIRS):
164 $(INS.dir)
166 libheaders: bldtools
167 @cd lib; pwd; $(MAKE) install_h
168 @cd $(SRCTOP)/lib && make obj && make includes DESTDIR=$(ROOT)
170 sysheaders: FRC
171 @cd uts; pwd; $(MAKE) install_h
173 cmdheaders: FRC
174 @cd cmd/devfsadm; pwd; $(MAKE) install_h
175 @cd cmd/fm; pwd; $(MAKE) install_h
176 @cd cmd/mdb; pwd; $(MAKE) install_h
178 check: $(CHKHDRSUBDIRS) $(CHKMFSTSUBDIRS)
180 FRC: