xref: /illumos-gate/usr/src/ucblib/libucb/Makefile.com (revision 09fcda9fe16a733cc35aa3156a47ef4b909251a6)
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#
24# Copyright 2019 Joyent, Inc.
25# Copyright 2019 Peter Tribble.
26#
27
28LIBRARY=	libucb.a
29VERS=		.1
30
31PORTSYSOBJS=		\
32	flock.o		\
33	getdtblsize.o	\
34	gethostid.o	\
35	gethostname.o	\
36	getpagesize.o	\
37	gettimeofday.o	\
38	killpg.o	\
39	mctl.o		\
40	reboot.o	\
41	setpgrp.o	\
42	wait3.o		\
43	wait4.o
44
45PORTSTDIOOBJS=		\
46	doprnt.o	\
47	fopen.o		\
48	fprintf.o	\
49	printf.o	\
50	sprintf.o	\
51	vfprintf.o	\
52	vprintf.o	\
53	vsprintf.o
54
55PORTGENOBJS=		\
56	_psignal.o	\
57	bcmp.o		\
58	bcopy.o		\
59	bzero.o		\
60	ftime.o		\
61	getwd.o		\
62	index.o		\
63	nice.o		\
64	nlist.o		\
65	psignal.o	\
66	rand.o		\
67	readdir.o	\
68	regex.o		\
69	rindex.o	\
70	scandir.o	\
71	setbuffer.o	\
72	siglist.o	\
73	statfs.o	\
74	times.o
75
76OBJECTS= $(SYSOBJS) $(PORTGENOBJS) $(PORTSYSOBJS) $(PORTSTDIOOBJS)
77
78# include library definitions
79include $(SRC)/lib/Makefile.lib
80
81ROOTLIBDIR=	$(ROOT)/usr/ucblib
82ROOTLIBDIR64=	$(ROOT)/usr/ucblib/$(MACH64)
83
84MAPFILES =	../port/mapfile-vers
85
86SRCS=		$(PORTGENOBJS:%.o=../port/gen/%.c) \
87		$(PORTSTDIOOBJS:%.o=../port/stdio/%.c) \
88		$(PORTSYSOBJS:%.o=../port/sys/%.c)
89
90LIBS = $(DYNLIB)
91
92CFLAGS	+=	$(CCVERBOSE)
93CFLAGS64 +=	$(CCVERBOSE)
94LDLIBS +=	-lelf -lc
95
96CPPFLAGS = -D$(MACH) -I$(SRC)/ucbhead -I../inc \
97		-I../../../lib/libc/inc $(CPPFLAGS.master)
98
99CERRWARN +=	-_gcc=-Wno-unused-variable
100CERRWARN +=	-_gcc=-Wno-parentheses
101CERRWARN +=	-_gcc=-Wno-char-subscripts
102CERRWARN +=	-_gcc=-Wno-uninitialized
103
104# not linted
105SMATCH=off
106
107ASFLAGS= -P -D__STDC__ -DLOCORE -D_SYS_SYS_S -D_ASM $(CPPFLAGS)
108
109pics/%.o:= ASFLAGS += $(AS_PICFLAGS)
110
111# libc method of building an archive, using AT&T ordering
112BUILD.AR= $(RM) $@ ; \
113	$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
114
115.KEEP_STATE:
116
117all: $(LIBS)
118
119lint: lintcheck
120
121pics/%.o: ../port/gen/%.c
122	$(COMPILE.c) -o $@ $<
123	$(POST_PROCESS_O)
124pics/%.o: ../port/stdio/%.c
125	$(COMPILE.c) -o $@ $<
126	$(POST_PROCESS_O)
127pics/%.o: ../port/sys/%.c
128	$(COMPILE.c) -o $@ $<
129	$(POST_PROCESS_O)
130
131# shared (sparc/sparcv9/i386/amd64) platform-specific rule
132pics/%.o: sys/%.c
133	$(COMPILE.c) -o $@ $<
134	$(POST_PROCESS_O)
135
136pics/%.o: ../$(MACH)/sys/%.s
137	$(BUILD.s)
138	$(POST_PROCESS_S_O)
139
140#
141# Include library targets
142#
143include $(SRC)/lib/Makefile.targ
144