xref: /illumos-gate/usr/src/lib/libproc/Makefile.com (revision f52943a93040563107b95bccb9db87d9971ef47d)
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) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
24# Copyright (c) 2013 by Delphix. All rights reserved.
25#
26# Copyright (c) 2018, Joyent, Inc.
27
28LIBRARY = libproc.a
29VERS = .1
30
31CMNOBJS =	\
32	P32ton.o	\
33	Pcontrol.o	\
34	Pcore.o		\
35	Pexecname.o	\
36	Pfdinfo.o	\
37	Pgcore.o	\
38	Pidle.o		\
39	Pisprocdir.o	\
40	Plwpregs.o	\
41	Pservice.o	\
42	Psymtab.o	\
43	Psymtab_machelf32.o \
44	$(CMNOBJS64)	\
45	Pscantext.o	\
46	Pstack.o	\
47	Psyscall.o	\
48	Putil.o		\
49	Pzone.o		\
50	pr_door.o	\
51	pr_exit.o	\
52	pr_fcntl.o	\
53	pr_getitimer.o	\
54	pr_getrctl.o	\
55	pr_getrlimit.o	\
56	pr_getsockname.o \
57	pr_ioctl.o	\
58	pr_lseek.o	\
59	pr_memcntl.o	\
60	pr_meminfo.o	\
61	pr_mmap.o	\
62	pr_open.o	\
63	pr_pbind.o	\
64	pr_rename.o	\
65	pr_sigaction.o	\
66	pr_stat.o	\
67	pr_statvfs.o	\
68	pr_tasksys.o	\
69	pr_waitid.o	\
70	proc_get_info.o	\
71	proc_names.o	\
72	proc_arg.o	\
73	proc_set.o	\
74	proc_stdio.o
75
76ISAOBJS =	\
77	Pisadep.o
78
79OBJECTS = $(CMNOBJS) $(ISAOBJS) $(SAVEOBJS)
80
81# include library definitions
82include ../../Makefile.lib
83include ../../Makefile.rootfs
84
85SRCS =		$(CMNOBJS:%.o=../common/%.c) $(ISAOBJS:%.o=%.c)
86
87LIBS =		$(DYNLIB) $(LINTLIB)
88LDLIBS +=	-lrtld_db -lelf -lctf -lc
89CSTD =	$(CSTD_GNU99)
90CPPFLAGS +=	$($(MACH64)_CPPFLAGS)
91
92SRCDIR =	../common
93$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
94
95CFLAGS +=	$(CCVERBOSE)
96CPPFLAGS +=	-I$(SRCDIR)
97
98CERRWARN +=	$(CNOWARN_UNINIT)
99CERRWARN +=	-_gcc=-Wno-parentheses
100CERRWARN +=	-_gcc=-Wno-type-limits
101CERRWARN +=	-_gcc=-Wno-unused-label
102
103# not linted
104SMATCH=off
105
106# All interfaces are interposable, therefore don't allow direct binding to
107# libproc.  Disable libproc from directly binding to itself, but allow libperl
108# to directly bind to its dependencies (ie. map -Bdirect -> -zdirect).  Ensure
109# lazy loading is established (which is enabled automatically with -Bdirect).
110BDIRECT =
111DYNFLAGS +=	$(BNODIRECT) $(ZDIRECT) $(ZLAZYLOAD)
112
113.KEEP_STATE:
114
115all: $(LIBS)
116
117lint: lintcheck
118
119# include library targets
120include ../../Makefile.targ
121
122objs/%.o pics/%.o: %.c
123	$(COMPILE.c) -o $@ $<
124	$(POST_PROCESS_O)
125
126objs/%.o pics/%.o: $(SRC)/common/saveargs/%.c
127	$(COMPILE.c) -o $@ $<
128	$(POST_PROCESS_O)
129