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