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
40 ROOTFS_LIB
= $(ROOT
)/lib
41 ROOTLIB64
= $(ROOTLIB
)/$(MACH64
)
42 ROOTFS_LIB64
= $(ROOTFS_LIB
)/$(MACH64
)
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 CLOBBERFILES
+= THIRDPARTYLICENSE extract-copyright
70 # install rules for install_h target
71 $(ROOTHDRDIR
)/%: port
/gen
/%
74 $(ROOTLIBDIR
)/$(DYNLIB
) := FILEMODE
= 755
75 $(ROOTLIBDIR64
)/$(DYNLIB
) := FILEMODE
= 755
76 $(ROOTFS_LIBDIR
)/$(DYNLIB
) := FILEMODE
= 755
77 $(ROOTFS_LIBDIR64
)/$(DYNLIB
) := FILEMODE
= 755
81 all: all_h lib32
$(BUILD64
) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE
83 THIRDPARTYLICENSE
: extract-copyright
85 .
/extract-copyright .
> $@
89 lib32
: $(MACH_COMP
) $(MACHLIBS
) $(MACH
)/$(LIB_PIC
)
90 @if
$(ELFDUMP
) -r
$(MACH
)/$(DYNLIB
) |
$(GREP
) -w environ
; then \
91 $(ECHO
) "Error: Invalid reference to environ" ; \
92 $(ECHO
) "Error: See comments in port/gen/env_data.c" ; \
96 lib64
: $(MACH_COMP
) $(MACHLIBS64
) $(MACH64
)/$(LIB_PIC
)
97 @if
$(ELFDUMP
) -r
$(MACH64
)/$(DYNLIB
) |
$(GREP
) -w environ
; then \
98 $(ECHO
) "Error: Invalid reference to environ" ; \
99 $(ECHO
) "Error: See comments in port/gen/env_data.c" ; \
103 $(MACH
)/assym.h
$(MACH64
)/assym.h
:
104 @cd
$(@D
); $(MAKE
) assym.h
107 @cd
$(@
); pwd
; $(MAKE
) $(TARGET
)
110 @cd
$(@
); pwd
; $(MAKE
) $(TARGET
)
117 inslib32
: $(ROOTFS_LIBS
) $(ROOTFS_LINKS
)
119 inslib64
: $(ROOTFS_LIBS64
) $(ROOTFS_LINKS64
)
121 install_h
: all_h
$(ROOTHDRS
)
123 all_h
: $(MACH
)/assym.h
$(MACH64
)/assym.h
127 $(ROOTFS_LIB
)/%: $(MACH
)/%
129 $(ROOTFS_LIBDIR
)/$(LIBLINKS
): $(ROOTFS_LIBDIR
)/$(LIBLINKS
)$(VERS
)
131 $(ROOTFS_LIB64
)/%: $(MACH64
)/%
133 $(ROOTFS_LIBDIR64
)/$(LIBLINKS
): $(ROOTFS_LIBDIR64
)/$(LIBLINKS
)$(VERS
)
136 $(MACH
)/$(LIB_PIC
): FRC
137 @cd
$(MACH
); pwd
; VERSION
='$(VERSION)' $(MAKE
) $(LIB_PIC
)
138 $(MACH64
)/$(LIB_PIC
): FRC
139 @cd
$(MACH64
); pwd
; VERSION
='$(VERSION)' $(MAKE
) $(LIB_PIC
)
142 install := TARGET
= install
143 clean := TARGET
= clean
144 clobber := TARGET
= clobber
146 .PARALLEL
: $(SUBDIRS
)
149 @cd
$@
; pwd
; VERSION
='$(VERSION)' $(MAKE
) $(TARGET
)
152 clobber: $(SUBDIRS
) etc clobber_local
154 $(RM
) $(CLOBBERFILES
)
156 _msg
: $(MSGDOMAIN
) catalog
159 sh .
/makelibccatalog.sh
$(MSGDOMAIN
)
165 # include MACH-specific library targets
166 include ..
/Makefile.mach