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