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