xref: /illumos-gate/usr/src/tools/sgs/libld/Makefile (revision 9b9d39d2a32ff806d2431dbcc50968ef1e6d46b2)
169b1fd3fSRichard Lowe#
269b1fd3fSRichard Lowe# CDDL HEADER START
369b1fd3fSRichard Lowe#
469b1fd3fSRichard Lowe# The contents of this file are subject to the terms of the
569b1fd3fSRichard Lowe# Common Development and Distribution License (the "License").
669b1fd3fSRichard Lowe# You may not use this file except in compliance with the License.
769b1fd3fSRichard Lowe#
869b1fd3fSRichard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
969b1fd3fSRichard Lowe# or http://www.opensolaris.org/os/licensing.
1069b1fd3fSRichard Lowe# See the License for the specific language governing permissions
1169b1fd3fSRichard Lowe# and limitations under the License.
1269b1fd3fSRichard Lowe#
1369b1fd3fSRichard Lowe# When distributing Covered Code, include this CDDL HEADER in each
1469b1fd3fSRichard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1569b1fd3fSRichard Lowe# If applicable, add the following below this CDDL HEADER, with the
1669b1fd3fSRichard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
1769b1fd3fSRichard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
1869b1fd3fSRichard Lowe#
1969b1fd3fSRichard Lowe# CDDL HEADER END
2069b1fd3fSRichard Lowe#
2169b1fd3fSRichard Lowe
2269b1fd3fSRichard Lowe#
2369b1fd3fSRichard Lowe# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2469b1fd3fSRichard Lowe# Use is subject to license terms.
2569b1fd3fSRichard Lowe#
2669b1fd3fSRichard Lowe#
2769b1fd3fSRichard Lowe
2869b1fd3fSRichard Loweinclude		../../Makefile.tools
29*9b9d39d2SRichard Loweinclude		$(SRC)/cmd/sgs/libld/Makefile.com
30*9b9d39d2SRichard Loweinclude		../Makefile.com
3169b1fd3fSRichard Lowe
3269b1fd3fSRichard Lowe.KEEP_STATE:
3369b1fd3fSRichard Lowe
3490f7985fSRobert Mustacchi#
3590f7985fSRobert Mustacchi# By using libld's Makefile.com LDLIBS ends up pointing to the proto
3690f7985fSRobert Mustacchi# area and many of the directories of cmd/sgs. As such, we need to reset
3790f7985fSRobert Mustacchi# that and just make sure to find everything relative to the tools proto
3890f7985fSRobert Mustacchi# area.
3990f7985fSRobert Mustacchi#
40*9b9d39d2SRichard LoweLDLIBS =	-L../libconv -lconv -L$(ROOTONBLDLIBMACH64) -llddbg -lelf -lc
415801b0f0SToomas SoomeNATIVE_LIBS +=	libc.so
4269b1fd3fSRichard Lowe
43*9b9d39d2SRichard LoweCPPFLAGS += -DUSE_LIBLD_MALLOC -I$(SRC)/lib/libc/inc \
44*9b9d39d2SRichard Lowe	    -I$(SRC)/uts/common/krtld -I$(SRC)/uts/sparc \
45*9b9d39d2SRichard Lowe	    -I$(SRC)/uts/common
46*9b9d39d2SRichard Lowe
47*9b9d39d2SRichard LoweDYNFLAGS +=	$(VERSREF) '-Wl,-R$$ORIGIN'
48*9b9d39d2SRichard Lowe
49*9b9d39d2SRichard Lowe# Necessary because we're a non-debug build in a debug environment, because
50*9b9d39d2SRichard Lowe# of being in src/tools
51*9b9d39d2SRichard LoweCERRWARN += -_gcc=-Wno-unused-but-set-variable
52*9b9d39d2SRichard Lowe
53*9b9d39d2SRichard Loweinclude		$(SRC)/Makefile.native
54*9b9d39d2SRichard Loweinclude		$(SRC)/Makefile.master.64
5569b1fd3fSRichard Lowe
5669b1fd3fSRichard Loweall:		$(DYNLIB) $(LIBLINKS)
5769b1fd3fSRichard Lowe
587a15b0ecSRichard Loweinstall:	all $(ROOTONBLDLIBMACH64)/$(DYNLIB) $(ROOTONBLDLIBMACH64)/$(LIBLINKS)
5969b1fd3fSRichard Lowe
607a15b0ecSRichard Lowe$(ROOTONBLDLIBMACH64)/$(DYNLIB): $(PICS) $(ROOTONBLDLIBMACH64)
6169b1fd3fSRichard Lowe		$(BUILD.SO)
6269b1fd3fSRichard Lowe		$(POST_PROCESS_SO)
6369b1fd3fSRichard Lowe
647a15b0ecSRichard Lowe$(ROOTONBLDLIBMACH64)/$(LIBLINKS): $(ROOTONBLDLIBMACH64)/$(DYNLIB)
657a15b0ecSRichard Lowe		@$(RM) $(ROOTONBLDLIBMACH64)/$(LIBLINKS)
667a15b0ecSRichard Lowe		$(SYMLINK) $(DYNLIB) $(ROOTONBLDLIBMACH64)/$(LIBLINKS)
6769b1fd3fSRichard Lowe
6869b1fd3fSRichard Loweinclude		$(SGSHOME)/libld/Makefile.targ
69