xref: /illumos-gate/usr/src/tools/svc/libuutil/Makefile (revision 9b9d39d2a32ff806d2431dbcc50968ef1e6d46b2)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27include $(SRC)/tools/Makefile.tools
28include $(SRC)/lib/libuutil/Makefile.shared.com
29
30SRCDIR = $(SRC)/lib/libuutil/common
31
32# This must be re-set to avoid proto area references
33LDLIBS =	-lc
34NATIVE_LIBS +=	libc.so
35
36CPPFLAGS +=	-I. -DNATIVE_BUILD
37
38#
39# We must use the build's avl headers, to match the common avl.c
40#
41AVLDIR =	$(SRC)/common/avl
42AVLHEADERS =	sys/avl.h sys/avl_impl.h
43CLOBBERFILES += $(AVLHEADERS) $(LIBS)
44
45LIBLINKS =	libuutil.so
46
47include $(SRC)/Makefile.native
48
49.KEEP_STATE:
50
51all: $(LIBS)
52
53install: all $(ROOTONBLDLIBMACH)/$(DYNLIB)  $(ROOTONBLDLIBMACH)/$(LIBLINKS)
54
55$(PICS): $(AVLHEADERS)
56
57sys/%: $(SRC)/uts/common/sys/%
58	@mkdir -p sys
59	cp -f $< $@
60
61pics/%.o:	$(SRCDIR)/%.c
62	$(COMPILE.c) -o $@ $<
63	$(POST_PROCESS_O)
64
65$(ROOTONBLDLIBMACH)/$(DYNLIB): $(ROOTONBLDLIBMACH) $(DYNLIB)
66	$(INS.file) $(DYNLIB)
67
68$(ROOTONBLDLIBMACH)/$(LIBLINKS): $(ROOTONBLDLIBMACH)/$(DYNLIB)
69		@$(RM) $(ROOTONBLDLIBMACH)/$(LIBLINKS)
70		$(SYMLINK) $(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS)
71
72include $(SRC)/lib/Makefile.targ
73include $(SRC)/lib/libuutil/Makefile.shared.targ
74