btxld: port build tool from freebsd
[unleashed.git] / usr / src / tools / Makefile
blob22ff67aa3b579be285a190761128e26ff78a213b
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) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 # Copyright 2016 Toomas Soome <tsoome@me.com>
28 include ../Makefile.master
30 # Bootstrap problem --
31 # 'cw' must be built before anything else can be built.
33 BOOT_SUBDIRS= \
36 COMMON_SUBDIRS= \
37 codereview \
38 codesign \
39 cscope-fast \
40 ctf \
41 depcheck \
42 env \
43 findunref \
44 gk \
45 install.bin \
46 lintdump \
47 make \
48 ndrgen \
49 onbld \
50 pmodes \
51 protocmp \
52 protolist \
53 scripts
56 # special versions of commands for use only in build
58 UNSHIPPED_SUBDIRS = \
59 elfsign \
60 mandoc
62 sparc_SUBDIRS= \
63 chk4ubin \
64 stabs \
65 tokenize
67 i386_SUBDIRS= \
68 aw \
69 elfextract \
70 mbh_patch \
71 btxld
73 LINTSUBDIRS= \
74 codereview \
75 ctf \
76 cw \
77 findunref \
78 lintdump \
79 ndrgen \
80 protocmp \
81 protolist
83 SUBDIRS= \
84 $($(MACH)_SUBDIRS) \
85 $(COMMON_SUBDIRS) \
86 $(UNSHIPPED_SUBDIRS)
88 include Makefile.tools
90 ROOTDIRS= \
91 $(ROOTOPT) \
92 $(ROOTONBLD) \
93 $(ROOTONBLD)/bin \
94 $(ROOTONBLD)/bin/$(MACH) \
95 $(ROOTONBLD)/lib \
96 $(ROOTONBLD)/lib/$(MACH) \
97 $(ROOTONBLD)/lib/$(MACH)/64 \
98 $(ROOTONBLD)/lib/perl \
99 $(ROOTONBLD)/lib/python2.6 \
100 $(ROOTONBLD)/lib/python2.6/onbld \
101 $(ROOTONBLD)/lib/python2.6/onbld/Checks \
102 $(ROOTONBLD)/lib/python2.6/onbld/hgext \
103 $(ROOTONBLD)/lib/python2.6/onbld/Scm \
104 $(ROOTONBLD)/env \
105 $(ROOTONBLD)/etc \
106 $(ROOTONBLD)/etc/exception_lists \
107 $(ROOTONBLD)/share \
108 $(ROOTONBLD)/gk \
109 $(ROOTONBLD)/man \
110 $(ROOTONBLD)/man/man1onbld
112 all := TARGET= install
113 install := TARGET= install
114 clean := TARGET= clean
115 clobber := TARGET= clobber
116 lint := TARGET= lint
117 _msg := TARGET= _msg
119 .KEEP_STATE:
122 # Only create directories in the tools proto area when doing an actual
123 # build, not a clean or clobber.
125 DOROOTDIRS= $(ROOTDIRS)
126 clobber:= DOROOTDIRS=
127 clean:= DOROOTDIRS=
129 all install: $(SUBDIRS)
131 clean: $(SUBDIRS)
133 clobber: $(SUBDIRS)
134 $(RM) -rf $(TOOLS_PROTO)
136 lint: $(LINTSUBDIRS)
138 _msg: $(MSGSUBDIRS)
140 .PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
142 $(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
144 $(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $(ROOTONBLDLIBPY) FRC
145 @cd $@; pwd; $(MAKE) $(TARGET)
147 $(ROOTDIRS):
148 $(INS.dir)
150 $(ROOTONBLDLIBPY): $(ROOTDIRS)
151 $(RM) -r $@; $(SYMLINK) python2.6 $@
153 make: ctf
155 FRC: