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]
22 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2010 Nexenta Systems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
31 LIBRARY
= $(LIBBASENAME
:%=%.a
)
34 # Note that we build libc_pic.a for the benefit of building
35 # ld.so.1, but we do not install it. Only ld.so.1 needs it
36 # and it must be built in the same workspace as libc.
39 ROOTLIB
= $(ROOT
)/usr
/lib
/$(MACH32
)
40 ROOTFS_LIB
= $(ROOT
)/lib
/$(MACH32
)
41 ROOTLIB64
= $(ROOT
)/usr
/lib
42 ROOTFS_LIB64
= $(ROOT
)/lib
44 # include common library definitions
45 include ..
/Makefile.lib
47 i386_COMP
= capabilities
48 sparc_COMP
= capabilities
50 MACH_COMP
= $($(MACH
)_COMP
)
55 SUBDIRS
= $(MACH_CAP
) $(MACH
) $(MACH_ETC
)
56 $(BUILD64
)SUBDIRS
+= $(MACH64
)
60 ROOTLIBS64
= $(ROOTLIBDIR64
)/$(DYNLIB
)
61 MACHLIBS64
= $(MACH64
)/$(DYNLIB
)
63 # definitions for install_h target
64 BASEHDRS
= getxby_door.h
65 CHECKHDRS
= $(BASEHDRS
:%.h
=port
/gen
/%.
check)
68 # install rules for install_h target
69 $(ROOTHDRDIR
)/%: port
/gen
/%
72 $(ROOTLIBDIR
)/$(DYNLIB
) := FILEMODE
= 755
73 $(ROOTLIBDIR64
)/$(DYNLIB
) := FILEMODE
= 755
74 $(ROOTFS_LIBDIR
)/$(DYNLIB
) := FILEMODE
= 755
75 $(ROOTFS_LIBDIR64
)/$(DYNLIB
) := FILEMODE
= 755
79 all: all_h lib32
$(BUILD64
) .WAIT lib64 .WAIT etc
83 lib32
: $(MACH_COMP
) $(MACHLIBS
) $(MACH
)/$(LIB_PIC
)
84 @if
$(ELFDUMP
) -r
$(MACH
)/$(DYNLIB
) |
$(GREP
) -w environ
; then \
85 $(ECHO
) "Error: Invalid reference to environ" ; \
86 $(ECHO
) "Error: See comments in port/gen/env_data.c" ; \
90 lib64
: $(MACH_COMP
) $(MACHLIBS64
) $(MACH64
)/$(LIB_PIC
)
91 @if
$(ELFDUMP
) -r
$(MACH64
)/$(DYNLIB
) |
$(GREP
) -w environ
; then \
92 $(ECHO
) "Error: Invalid reference to environ" ; \
93 $(ECHO
) "Error: See comments in port/gen/env_data.c" ; \
97 $(MACH
)/assym.h
$(MACH64
)/assym.h
:
98 @cd
$(@D
); $(MAKE
) assym.h
101 @cd
$(@
); pwd
; $(MAKE
) $(TARGET
)
104 @cd
$(@
); pwd
; $(MAKE
) $(TARGET
)
111 inslib32
: $(ROOTFS_LIBS
) $(ROOTFS_LINKS
)
113 inslib64
: $(ROOTFS_LIBS64
) $(ROOTFS_LINKS64
)
115 install_h
: all_h
$(ROOTHDRS
)
117 all_h
: $(MACH
)/assym.h
$(MACH64
)/assym.h
121 $(ROOTFS_LIB
)/%: $(MACH
)/%
123 $(ROOTFS_LIBDIR
)/$(LIBLINKS
): $(ROOTFS_LIBDIR
)/$(LIBLINKS
)$(VERS
)
125 $(ROOTFS_LIB64
)/%: $(MACH64
)/%
127 $(ROOTFS_LIBDIR64
)/$(LIBLINKS
): $(ROOTFS_LIBDIR64
)/$(LIBLINKS
)$(VERS
)
130 $(MACH
)/$(LIB_PIC
): FRC
131 @cd
$(MACH
); pwd
; VERSION
='$(VERSION)' $(MAKE
) $(LIB_PIC
)
132 $(MACH64
)/$(LIB_PIC
): FRC
133 @cd
$(MACH64
); pwd
; VERSION
='$(VERSION)' $(MAKE
) $(LIB_PIC
)
136 install := TARGET
= install
137 clean := TARGET
= clean
138 clobber := TARGET
= clobber
140 .PARALLEL
: $(SUBDIRS
)
143 @cd
$@
; pwd
; VERSION
='$(VERSION)' $(MAKE
) $(TARGET
)
146 clobber: $(SUBDIRS
) etc clobber_local
148 $(RM
) $(CLOBBERFILES
)
150 _msg
: $(MSGDOMAIN
) catalog
153 sh .
/makelibccatalog.sh
$(MSGDOMAIN
)
159 # include MACH-specific library targets
160 include ..
/Makefile.mach