build: remove map.noexstk and map.noexdata (now default)
[unleashed.git] / usr / src / Makefile
bloba36da0e339d366eed878a82a37ca979995c5733b
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 2016 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 \
78 SUNW_OST_ZONEINFO
80 MSGDDIRS= $(DOMAINS:%=$(MSGROOT)/%)
81 MSGDIRS= $(MSGROOT) $(MSGDDIRS) $(MSGROOT)/LC_TIME
83 all := TARGET= all
84 install := TARGET= install
85 install1 := TARGET= install
86 install2 := TARGET= install
87 install_h := TARGET= install_h
88 clean := TARGET= clean
89 clobber := TARGET= clobber
90 check := TARGET= check
92 .KEEP_STATE:
95 # Note: install does not cause a build in pkg. To build packages,
96 # cd pkg and do a 'make install'
99 all: mapfiles sgs .WAIT $(SUBDIRS) pkg
102 # The _msg build is a two-step process. First, the _msg dependency
103 # causes recursive makes in $(MSGSUBDIRS), which stages raw message
104 # files in $(ROOT)/catalog. Second, the action from the install
105 # target rule causes those messages to be post-processed from where
106 # they were staged in $(ROOT)/catalog, and the results placed into the
107 # proto area.
109 # The stage-licenses target causes the license files needed for
110 # packaging to be pulled from $(SRC) and $(CLOSED) and staged in
111 # $(ROOT)/licenses.
113 install: install1 install2 _msg stage-licenses
114 @cd msg; pwd; $(MAKE) _msg
115 @rm -rf "$(ROOT)/catalog"
117 stage-licenses: install2
118 @cd pkg; pwd; $(MAKE) stage-licenses
120 install1: mapfiles sgs
122 install2: install1 $(SUBDIRS)
124 _msg: _msgdirs rootdirs FRC
125 @for m in $(MSGSUBDIRS); do \
126 cd $$m; pwd; $(MAKE) _msg; cd ..; \
127 done
129 mapfiles: bldtools
130 @cd common/mapfiles; pwd; $(MAKE) install
132 clean: $(SUBDIRS) pkg
133 clobber: $(SUBDIRS) pkg clobber_local
134 clobber_local:
135 @cd tools; pwd; $(MAKE) clobber
136 @cd common/mapfiles; pwd; $(MAKE) clobber
137 @cd msg; pwd; $(MAKE) clobber
140 # Declare what parts can be built in parallel
141 # DUMMY at the end is used in case macro expansion produces an empty string to
142 # prevent everything going in parallel
144 .PARALLEL: $(PARALLEL_HEADERS) DUMMY
145 .PARALLEL: $(PARALLEL_DIRS) DUMMY
147 $(SUBDIRS) pkg: FRC
148 @cd $@; pwd; $(MAKE) $(TARGET)
150 sgs: rootdirs .WAIT sysheaders .WAIT \
151 libheaders cmdheaders
154 # Top-level setup target to setup the development environment that includes
155 # headers, tools and generated mapfiles. Note, although the tools are
156 # dependent on a number of constant mapfiles, the tools themselves are
157 # required to build the generated mapfiles.
159 setup: bldtools sgs mapfiles
161 bldtools:
162 @cd tools; pwd; $(MAKE) install
164 # /var/mail/:saved is a special case because of the colon in the name.
166 rootdirs: $(ROOTDIRS)
167 $(INS) -d -m 775 $(ROOT)/var/mail/:saved
169 _msgdirs: $(MSGDIRS)
171 $(ROOTDIRS) $(MSGDIRS):
172 $(INS.dir)
174 libheaders: bldtools
175 @cd lib; pwd; $(MAKE) install_h
177 sysheaders: FRC
178 @cd uts; pwd; $(MAKE) install_h
180 cmdheaders: FRC
181 @cd cmd/devfsadm; pwd; $(MAKE) install_h
182 @cd cmd/fm; pwd; $(MAKE) install_h
183 @cd cmd/mdb; pwd; $(MAKE) install_h
185 check: $(CHKHDRSUBDIRS) $(CHKMFSTSUBDIRS)
187 FRC: