Merge commit '00f1a4f432b3d8aad1aa270e91c44c57f03ef407'
[unleashed.git] / usr / src / cmd / sgs / Makefile
blobc30b9e7fe2250f1f4eb28644aea3cf4cb17e40a3
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
22 # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
23 # Copyright 2016 RackTop Systems.
24 # Copyright 2017 Joyent, Inc.
27 include $(SRC)/cmd/Makefile.cmd
29 # Note: Why SUBDIRS isn't sorted alphabetically
31 # The items under SGS are not independent of each other.
32 # They must be built in an order that ensures that
33 # all dependencies of an item have been built before the
34 # item itself.
36 SUBDIRS= libconv \
37 .WAIT \
38 libdl \
39 libelf \
40 liblddbg \
41 .WAIT \
42 libld \
43 libldmake \
44 libldstab \
45 librtld \
46 libcrle \
47 .WAIT \
48 ld \
49 ldd \
50 lddstub \
51 rtld \
52 .WAIT \
53 librtld_db \
54 ldprof \
55 pvs \
56 crle \
57 ar \
58 dump \
59 elfdump \
60 elfedit \
61 elfwrap \
62 error \
63 gprof \
64 lari \
65 lex \
66 lorder \
67 m4 \
68 mcs \
69 nm \
70 prof \
71 ranlib \
72 unifdef
74 # Messaging support
76 POSUBDIRS= m4 nm
77 POFILE= sgs.po
78 POFILES= $(POSUBDIRS:%=%/%.po)
80 MSGSUBDIRS= ld ldd libld liblddbg \
81 libldstab librtld rtld libelf \
82 ldprof libcrle pvs elfdump \
83 elfedit crle lari \
84 librtld_db elfwrap ar
86 MSGDIR= messages
89 all := TARGET= all
90 install := TARGET= install
91 clean := TARGET= clean
92 clobber := TARGET= clobber
93 delete := TARGET= delete
94 _msg := TARGET= catalog
95 _msg_gettext := TARGET= catalog
96 _msg_sgsmsg := TARGET= catalog
97 chkmsg := TARGET= chkmsg
100 .KEEP_STATE:
102 .PARALLEL: $(SUBDIRS)
104 all install: native-add .WAIT $(SUBDIRS)
106 include $(SRC)/cmd/Makefile.targ
108 # Messaging support
110 _msg: _msg_gettext _msg_sgsmsg
112 _msg_gettext: $(MSGDOMAIN)/$(POFILE)
114 # $(MACH)/sgsmsg must be built before we can descend into $(MSGDIR)
115 _msg_sgsmsg: native-add .WAIT $(MSGDIR)
117 $(MSGDOMAIN)/$(POFILE): \
118 $(MSGDOMAIN) $(POFILE)
120 $(POFILE): $(POSUBDIRS)
121 $(RM) $(POFILE)
122 cat $(POFILES) > $(POFILE)
124 $(MSGDIR): $(MSGSUBDIRS) FRC
125 @ cd $@; pwd; $(MAKE) $(TARGET)
127 chkmsg: $(MSGSUBDIRS) FRC
129 check: chkmsg
131 # built from lib/Makefile
132 install_lib: FRC
133 @ cd lex; pwd; $(MAKE) $@
135 delete \
136 clean clobber: native-clobber .WAIT $(SUBDIRS) $(MSGDIR)
138 $(SUBDIRS): FRC
139 @ cd $@; pwd; $(MAKE) $(TARGET)
142 # Integration of ld and ld.so.1 in some developement cycles requires that both
143 # of these modules be built using the new ld. This `native' target allows us
144 # to build a local ld which will then be used to build the delivered version of
145 # itself and ld.so.1. Once this new functionality appears in the standard ld
146 # this target can be disabled.
148 native-add: FRC
149 @ cd tools/$(MACH); pwd; $(MAKE) native
150 @ cd libconv/$(MACH); pwd; $(MAKE)
151 @ cd libelf/$(MACH); pwd; $(MAKE) native
152 @ cd liblddbg/$(MACH); pwd; $(MAKE) native
153 @ cd libldstab/$(MACH); pwd; $(MAKE) native
154 @ cd libld/$(MACH); pwd; $(MAKE) native
155 @ cd ld/$(MACH); pwd; $(MAKE) native
157 native-clobber:
158 @ cd tools; pwd; $(MAKE) $(TARGET)
159 $(RM) -r proto/$(MACH)
161 FRC: