xref: /titanic_41/usr/src/ucblib/libucb/Makefile.com (revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# ucblib/libucb/Makefile.com
29# common part for i386/amd64/sparc/sparcv9
30#
31
32LIBRARY=	libucb.a
33VERS=		.1
34
35PORTSYSOBJS=		\
36	flock.o		\
37	getdtblsize.o	\
38	gethostid.o	\
39	gethostname.o	\
40	getpagesize.o	\
41	gettimeofday.o	\
42	killpg.o	\
43	mctl.o		\
44	reboot.o	\
45	setpgrp.o	\
46	wait3.o		\
47	wait4.o
48
49PORTSTDIOOBJS=		\
50	doprnt.o	\
51	fopen.o		\
52	fprintf.o	\
53	printf.o	\
54	sprintf.o	\
55	vfprintf.o	\
56	vprintf.o	\
57	vsprintf.o
58
59PORTGENOBJS=		\
60	_psignal.o	\
61	bcmp.o		\
62	bcopy.o		\
63	bzero.o		\
64	ftime.o		\
65	getwd.o		\
66	index.o		\
67	nice.o		\
68	nlist.o		\
69	psignal.o	\
70	rand.o		\
71	readdir.o	\
72	regex.o		\
73	rindex.o	\
74	scandir.o	\
75	setbuffer.o	\
76	siglist.o	\
77	statfs.o	\
78	times.o
79
80OBJECTS= $(SYSOBJS) $(PORTGENOBJS) $(PORTSYSOBJS) $(PORTSTDIOOBJS)
81
82# include library definitions
83include $(SRC)/lib/Makefile.lib
84
85ROOTLIBDIR=	$(ROOT)/usr/ucblib
86ROOTLIBDIR64=	$(ROOT)/usr/ucblib/$(MACH64)
87
88MAPFILE=	$(MAPDIR)/mapfile
89MAPOPTS=	$(MAPFILE:%=-M%)
90
91SRCS=		$(PORTGENOBJS:%.o=../port/gen/%.c) \
92		$(PORTSTDIOOBJS:%.o=../port/stdio/%.c) \
93		$(PORTSYSOBJS:%.o=../port/sys/%.c)
94
95LIBS = $(DYNLIB) $(LINTLIB)
96
97LINTSRC= $(LINTLIB:%.ln=%)
98ROOTLINTDIR= $(ROOTLIBDIR)
99ROOTLINTDIR64= $(ROOTLIBDIR)/$(MACH64)
100ROOTLINT= $(LINTSRC:%=$(ROOTLINTDIR)/%)
101ROOTLINT64= $(LINTSRC:%=$(ROOTLINTDIR64)/%)
102
103# install rule for lint source file target
104$(ROOTLINTDIR)/%: ../port/%
105	$(INS.file)
106$(ROOTLINTDIR64)/%: ../%
107	$(INS.file)
108
109$(LINTLIB):= SRCS=../port/llib-lucb
110
111CFLAGS	+=	$(CCVERBOSE)
112CFLAGS64 +=	$(CCVERBOSE)
113DYNFLAGS +=	$(MAPOPTS)
114LDLIBS +=	-lelf -lc
115
116CPPFLAGS = -D$(MACH) -I$(ROOT)/usr/ucbinclude -I../inc \
117		-I../../../lib/libc/inc $(CPPFLAGS.master)
118
119ASFLAGS= -P -D__STDC__ -DLOCORE -D_SYS_SYS_S -D_ASM $(CPPFLAGS)
120
121pics/%.o:= ASFLAGS += $(AS_PICFLAGS)
122
123# libc method of building an archive, using AT&T ordering
124BUILD.AR= $(RM) $@ ; \
125	$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
126
127.KEEP_STATE:
128
129all: $(LIBS)
130
131lint: lintcheck
132
133$(DYNLIB): 	$(MAPFILE)
134
135$(MAPFILE):
136	@cd $(MAPDIR); $(MAKE) mapfile
137
138objs/%.o pics/%.o: ../port/gen/%.c
139	$(COMPILE.c) -o $@ $<
140	$(POST_PROCESS_O)
141objs/%.o pics/%.o: ../port/stdio/%.c
142	$(COMPILE.c) -o $@ $<
143	$(POST_PROCESS_O)
144objs/%.o pics/%.o: ../port/sys/%.c
145	$(COMPILE.c) -o $@ $<
146	$(POST_PROCESS_O)
147
148# shared (sparc/sparcv9/i386/amd64) platform-specific rule
149objs/%.o pics/%.o: sys/%.c
150	$(COMPILE.c) -o $@ $<
151	$(POST_PROCESS_O)
152
153objs/%.o pics/%.o: ../$(MACH)/sys/%.s
154	$(BUILD.s)
155	$(POST_PROCESS_O)
156
157#
158# Include library targets
159#
160include $(SRC)/lib/Makefile.targ
161