xref: /illumos-gate/usr/src/tools/Makefile.tools (revision c7f0a03cb28c8bb3db0c3405cfa31ab6c56c8d91)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21#
22# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2020 Joyent, Inc.
24#
25# Definitions common to tool source.
26#
27include $(SRC)/Makefile.master
28include $(SRC)/Makefile.native
29
30FILEMODE=	0555
31
32TOOLS=			$(SRC)/tools
33TOOLS_PROTO=		$(TOOLS)/proto/root_$(MACH)-nd
34ROOTOPT=		$(TOOLS_PROTO)/opt
35ROOTONBLD=		$(ROOTOPT)/onbld
36ROOTONBLDBIN=		$(ROOTONBLD)/bin
37ROOTONBLDBINMACH=	$(ROOTONBLD)/bin/$(MACH)
38ROOTONBLDBINMACH64=	$(ROOTONBLD)/bin/$(MACH64)
39ROOTONBLDETC=		$(ROOTONBLD)/etc
40ROOTONBLDLIB=		$(ROOTONBLD)/lib
41ROOTONBLDLIBMACH=	$(ROOTONBLD)/lib/$(MACH)
42ROOTONBLDLIBMACH64=	$(ROOTONBLD)/lib/$(MACH)/64
43ROOTONBLDLIBPERL=	$(ROOTONBLD)/lib/perl
44ROOTONBLDLIBPY=		$(ROOTONBLD)/lib/python
45ROOTONBLDENV=		$(ROOTONBLD)/env
46ROOTONBLDMAN=		$(ROOTONBLD)/man
47ROOTONBLDMAN1ONBLD=	$(ROOTONBLD)/man/man1onbld
48ROOTONBLDETCABI=	$(ROOTONBLD)/etc/abi
49ROOTONBLDETCEXCEPT=	$(ROOTONBLD)/etc/exception_lists
50ROOTONBLDSHARE=		$(ROOTONBLD)/share
51ROOTONBLDSHLIB=		$(ROOTONBLD)/share/lib
52ROOTONBLDSHLIBCCS=	$(ROOTONBLD)/share/lib/ccs
53
54CPPFLAGS=		-D_TS_ERRNO
55ELFSIGN_O=		$(TRUE)
56LDLIBS=
57LDFLAGS=		$(MAPFILE.NES:%=-Wl,-M%) $(MAPFILE.NED:%=-Wl,-M%) \
58			    $(MAPFILE.PGA:%=-Wl,-M%) \
59			    $(BDIRECT)
60
61NATIVE_LIBS += libc.so
62
63# To work around a bootstrapping problem, we can't rely on cw(1) knowing how
64# to translate -shared as we may be using an older one to build the current
65# tools.
66GSHARED = -_gcc=-shared
67
68#
69# To work around a bootstrapping problem, we don't assume that the
70# compiler or environment are properly configured to make the stack
71# protector work. Disable it right now for the tools.
72#
73STACKPROTECT = none
74
75ROOTONBLDPROG=		$(PROG:%=$(ROOTONBLDBIN)/%)
76ROOTONBLDSCRIPTS=	$(SCRIPTS:%=$(ROOTONBLDBIN)/%)
77ROOTONBLDMACHPROG=	$(PROG:%=$(ROOTONBLDBINMACH)/%)
78ROOTONBLDMACH64PROG=	$(PROG:%=$(ROOTONBLDBINMACH64)/%)
79ROOTONBLDSHFILES=	$(SHFILES:%=$(ROOTONBLDBIN)/%)
80ROOTONBLDMAKEFILES=	$(MAKEFILES:%=$(ROOTONBLDBIN)/%)
81ROOTONBLDMACHSHFILES=	$(SHFILES:%=$(ROOTONBLDBINMACH)/%)
82ROOTONBLDMACHBINARIES=	$(BINARIES:%=$(ROOTONBLDBINMACH)/%)
83ROOTONBLDETCFILES=	$(ETCFILES:%=$(ROOTONBLDETC)/%)
84ROOTONBLDENVFILES=	$(ENVFILES:%=$(ROOTONBLDENV)/%)
85ROOTONBLDPERLFILES=	$(PERLFILES:%=$(ROOTONBLDBIN)/%)
86ROOTONBLDPERLMODULES=	$(PERLMODULES:%=$(ROOTONBLDLIBPERL)/%)
87ROOTONBLDPYFILES=	$(PYFILES:%=$(ROOTONBLDBIN)/%)
88ROOTONBLDMAN1ONBLDFILES=$(MAN1ONBLDFILES:%=$(ROOTONBLDMAN1ONBLD)/%)
89ROOTONBLDABIAUDITFILES=	$(ABI_AUDITFILES:%=$(ROOTONBLDETCABI)/%)
90ROOTONBLDEXCEPTFILES=	$(EXCEPTFILES:%=$(ROOTONBLDETCEXCEPT)/%)
91
92$(ROOTONBLDETCABI)/%: %
93	$(INS.file)
94
95$(ROOTONBLDETCEXCEPT)/%: $(CODEMGR_WS)/exception_lists/%
96	$(INS.file)
97
98$(ROOTONBLDBIN)/%: %
99	$(INS.file)
100
101$(ROOTONBLDBINMACH)/%: %
102	$(INS.file)
103
104$(ROOTONBLDBINMACH64)/%: %
105	$(INS.file)
106
107$(ROOTONBLDETC)/%: %
108	$(INS.file)
109
110$(ROOTONBLDLIBPERL)/%: %
111	$(INS.file)
112
113$(ROOTONBLDMAN1ONBLD)/%: %
114	$(INS.file)
115
116$(ROOTONBLDENV)/%: %
117	$(INS.file)
118