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.
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.
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]
22 # Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
26 # This builds all objects needed for libbc.
30 # Default rules in ../../Makefile.targ not used.
34 #DYNLIBS5 is also defined in ../Makefile
39 # objects are grouped by source directory.
42 gtty.o lockf.o pause.o stty.o tell.o ulimit.o \
46 ftime.o nice.o rand.o vlimit.o vtimes.o getpw.o times.o
49 nice.o rand.o getpw.o times.o
52 _ftou.o misalign.o ptr_call.o \
54 alloc_pbuf.o mon.o muldiv.o
57 _crypt.o _nlist.o _perror.o _psignal.o a64l.o abs.o alarm.o\
58 asctime.o atof.o atoi.o atol.o bcmp.o bsearch.o\
59 clock.o closedir.o crypt.o ctime.o ctype_.o\
60 drand48.o dysize.o errlst.o execvp.o exit.o exportent.o ecvt.o\
61 fabs.o fmod.o frexp.o\
62 fstab.o ftok.o ftw.o getauid.o getauditflags.o \
63 getcwd.o getenv.o getgraent.o getlogin.o \
64 getopt.o getsubopt.o getpwaent.o getttyent.o\
65 getttynam.o getusershell.o grpauth.o hsearch.o\
66 ieee_globals.o index.o isatty.o \
67 issecure.o jcsetpgrp.o\
68 l64a.o labeltostring.o ldexp.o lfind.o lsearch.o\
70 euc.multibyte.o iso.multibyte.o xccs.multibyte.o \
71 mblib.o mbstowcs.o mbtowc.o wcstombs.o wctomb.o \
72 memalign.o memccpy.o memchr.o memcmp.o\
73 mkstemp.o mktemp.o mlock.o mlockall.o\
74 mntent.o modf.o msync.o munlock.o munlockall.o\
75 nl_cxtime.o nl_strncmp.o ndbm.o on_exit.o\
76 opendir.o optind.o perror.o plock.o \
77 posix_sig.o posix_tty.o popen.o psignal.o putenv.o \
78 pwdauth.o pwdnm.o qsort.o\
79 random.o readdir.o realpath.o regex.o rindex.o scandir.o seekdir.o\
80 setlocale.o setregid.o setreuid.o setrgid.o setruid.o sigfpe.o siglist.o\
81 ssignal.o strchr.o stricmp.o \
82 strftime.o strncat.o \
83 strpbrk.o strptime.o strrchr.o strspn.o strstr.o \
84 strtod.o strtok.o strtol.o swab.o syslog.o\
85 telldir.o tfind.o time.o tsearch.o \
86 ualarm.o usleep.o valloc.o string_decim.o \
87 file_decim.o func_decim.o econvert.o seconvert.o gconvert.o \
88 decimal_bin.o float_decim.o double_decim.o \
89 pack_float.o _unpack_dble.o unpack_float.o \
90 _base_S.o _base_il.o _base_sup.o _big_power.o _small_power.o \
91 _sprintf_sup.o _times_power.o qeconvert.o \
92 _Q_neg.o _Q_add.o _Q_sub.o _Q_mul.o _Q_div.o _Q_cmp.o \
93 _Q_cmpe.o _Q_stoq.o _Q_dtoq.o _Q_itoq.o _Q_utoq.o _Q_qtos.o _Q_qtod.o \
94 _Q_qtoi.o _Q_qtou.o _Q_sqrt.o _Qfaddsub.o _Qfcompare.o _Qfdiv.o \
95 _Qfmul.o _Qfpack.o _Qfunpack.o _Qfutility.o _Q_fcc.o _Q_get_rp_rd.o \
97 getpass.o localtime.o ttyslot.o
100 alloca.o ffs.o insque.o remque.o isinf.o base_conv.o
103 nlist.o timezone.o sleep.o system.o
106 assert.o nlist.o sgetl.o sleep.o sputl.o system.o \
110 clrerr.o ctermid.o cuserid.o doprnt.o doscan.o fdopen.o \
111 feof.o ferror.o fgetc.o fgets.o fileno.o findiop.o \
112 fputc.o fputs.o fread.o fseek.o ftell.o \
113 fwrite.o getc.o getchar.o gets.o getw.o iob.o \
114 putc.o putchar.o puts.o putw.o remove.o \
115 rew.o scanf.o setbuffer.o setvbuf.o tmpnam.o tempnam.o \
119 filbuf.o fopen.o fprintf.o printf.o flsbuf.o setbuf.o \
120 sprintf.o vfprintf.o vprintf.o vsprintf.o
123 filbuf.o fopen.o fprintf.o flsbuf.o printf.o setbuf.o \
124 sprintf.o vfprintf.o vprintf.o vsprintf.o
127 _access.o acct.o adjtime.o close.o _creat.o dup.o dup2.o \
129 fdlist.o flock.o fpathconf.o fsync.o ftruncate.o getdents.o \
130 getdtablesize.o getgid.o getitimer.o getpid.o gettimeofday.o \
131 getuid.o ioctl.o kill.o lseek.o mincore.o mprotect.o munmap.o\
132 _open.o profil.o setitimer.o \
133 rlimit.o _statfs.o sync.o umask.o uname.o\
134 execl.o execle.o execv.o mkfifo.o msgsys.o\
135 pathconf.o semsys.o shmsys.o unmount.o wait.o setuid.o\
136 setgid.o _stat.o seteuid.o setegid.o signalmap.o syscall.o \
137 maperror.o sigsetjmp.o accept.o bind.o connect.o getpeername.o \
138 getsockname.o getsockopt.o listen.o recv.o send.o \
139 setsockopt.o shutdown.o socket.o socketpair.o setsid.o sigaction.o
142 _exit.o brk.o cerror.o errno.o \
143 getegid.o geteuid.o getppid.o mmap.o pipe.o putmsg.o \
144 sbrk.o _syscall.o getmsg.o _read.o _write.o \
145 _readv.o _writev.o sendsig.o
148 access.o chdir.o chmod.o chown.o chroot.o \
149 creat.o execve.o getpgrp.o link.o mkdir.o \
150 mknod.o open.o readlink.o rename.o rmdir.o \
151 setpgrp.o stat.o symlink.o truncate.o unlink.o \
152 statfs.o fcntl.o read.o write.o readv.o \
153 writev.o setjmp.o mount.o
156 getgroups.o setgroups.o
159 access.o chdir.o chmod.o chown.o chroot.o \
160 creat.o execve.o getgroups.o getpgrp.o link.o \
161 mkdir.o mknod.o open.o readlink.o rename.o \
162 rmdir.o setgroups.o setpgrp.o stat.o statfs.o \
163 stime.o symlink.o truncate.o unlink.o fcntl.o \
164 read.o write.o readv.o writev.o setjmp.o \
168 #_getpgrp.o _kill.o _lseek.o _mknod.o _mount.o _setpgrp.o \
172 inet_addr.o inet_lnaof.o inet_makeaddr.o inet_netof.o \
173 inet_network.o inet_ntoa.o
176 ether_addr.o bindresvport.o getrpcport.o rcmd.o \
177 rexec.o ruserpass.o authunix.o
179 NETSPARC
= htonl.o htons.o ntohl.o ntohs.o
184 PSEUDO_SRCS
= adjtime.s fchdir.s \
186 fpathconf.s getitimer.s getpid.s \
187 mincore.s mprotect.s munmap.s \
188 profil.s setitimer.s \
189 sync.s sysconf.s umask.s ustat.s \
194 pics
/%.o s5pics
/%.o
: ..
/libc
/compat
/common
/%.c
195 $(COMPILE.c
) -o
$@
$<
198 pics
/%.o
: ..
/libc
/compat
/4.1/%.c
199 $(COMPILE.c
) -o
$@
$<
202 s5pics
/%.o
: ..
/libc
/compat
/sys5
/%.c
203 $(COMPILE.c
) -o
$@
$<
206 pics
/%.o s5pics
/%.o
: ..
/libc
/crt
/sparc
/%.s
210 pics
/%.o s5pics
/%.o
: ..
/libc
/crt
/sparc
/%.c
211 $(COMPILE.c
) -o
$@
$<
214 pics
/%.o s5pics
/%.o
: ..
/csu
/common
/%.c
215 $(COMPILE.c
) -o
$@
$<
218 pics
/%.o s5pics
/%.o
: ..
/libc
/gen
/common
/%.S
222 pics
/%.o s5pics
/%.o
: ..
/libc
/gen
/common
/%.c
223 $(COMPILE.c
) -o
$@
$<
226 pics
/%.o s5pics
/%.o
: ..
/libc
/gen
/common
/sparc
/%.s
230 pics
/%.o s5pics
/%.o
: ..
/libc
/gen
/common
/sparc
/%.c
231 $(COMPILE.c
) -o
$@
$<
234 pics
/%.o
: ..
/libc
/gen
/4.2/%.c
235 $(COMPILE.c
) -o
$@
$<
238 s5pics
/%.o
: ..
/libc
/gen
/sys5
/%.c
239 $(COMPILE.c
) -o
$@
$<
242 pics
/%.o s5pics
/%.o
: ..
/libc
/inet
/%.c
243 $(COMPILE.c
) -o
$@
$<
246 pics
/%.o s5pics
/%.o
: ..
/libc
/net
/%.c
247 $(COMPILE.c
) -o
$@
$<
250 pics
/%.o s5pics
/%.o
: ..
/libc
/net
/sparc
/%.c
251 $(COMPILE.c
) -o
$@
$<
254 pics
/%.o s5pics
/%.o
: ..
/libc
/stdio
/common
/%.c
255 $(COMPILE.c
) -o
$@
$<
258 pics
/%.o
: ..
/libc
/stdio
/4.2/%.c
259 $(COMPILE.c
) -o
$@
$<
262 s5pics
/%.o
: ..
/libc
/stdio
/sys5
/%.c
263 $(COMPILE.c
) -o
$@
$<
266 pics
/%.o s5pics
/%.o
: ..
/libc
/sys
/common
/%.s
270 pics
/%.o s5pics
/%.o
: ..
/libc
/sys
/common
/%.c
271 $(COMPILE.c
) -o
$@
$<
274 pics
/%.o s5pics
/%.o
: ..
/libc
/sys
/common
/sparc
/%.s
278 pics
/%.o
: ..
/libc
/sys
/4.2/%.c
279 $(COMPILE.c
) -o
$@
$<
282 pics
/%.o
: ..
/libc
/sys
/4.2/sparc
/%.s
286 s5pics
/%.o
: ..
/libc
/sys
/sys5
/%.c
287 $(COMPILE.c
) -o
$@
$<
290 s5pics
/%.o
: ..
/libc
/sys
/sys5
/sparc
/%.s
294 s5pics
/%.o
: ..
/libc
/stdio
/sys5
/%.c
295 $(COMPILE.c
) -o
$@
$<
298 pics
/%.o s5pics
/%.o
: ..
/libc
/rpc
/%.c
299 $(COMPILE.c
) -o
$@
$<
302 pics
/%.o s5pics
/%.o
: ..
/libc
/yp
/%.c
303 $(COMPILE.c
) -o
$@
$<
307 # include common library definitions
308 include ..
/..
/Makefile.lib
310 # There should be a mapfile here
313 C99MODE
= $(C99_DISABLE
)
316 # The BCP include files depend on old preprocessor semantics.
320 # the bcp libraries go in /usr/4lib. override ROOTLIBDIR from ../../Makefile.lib
321 # and save it so we can find the libraries with which to link
322 ROOTLIBDIR
= $(ROOT
)/usr
/4lib
325 -I.
-Iinc
-I..
/inc
/include -I..
/inc
/include/sys
$(CPPFLAGS.master
)
326 ASFLAGS
= -P
-D__STDC__
-DLOCORE
-D_SYS_SYS_S
-D_ASM
$(CPPFLAGS
)
327 LDLIBS
= -t
-R
/usr
/ucblib
-L
$(ROOT
)/usr
/ucblib
$(LDLIBS.lib
) \
328 -lucb
-lc
-lnsl
-lsocket
330 CERRWARN
+= -_gcc
=-Wno-implicit-function-declaration
331 CERRWARN
+= -_gcc
=-Wno-char-subscripts
332 CERRWARN
+= -_gcc
=-Wno-extra
333 CERRWARN
+= -_gcc
=-Wno-parentheses
334 CERRWARN
+= -_gcc
=-Wno-uninitialized
335 CERRWARN
+= -_gcc
=-Wno-unused
336 CERRWARN
+= -_gcc
=-Wno-switch
337 CERRWARN
+= -_gcc
=-Wno-address
339 # SONAME is used by DYNFLAGS
340 $(DYNLIB4X
) := SONAME
= $(DYNLIB4X
)
341 $(DYNLIBS5
) := SONAME
= $(DYNLIBS5
)
343 pics
/%.o
:= ASFLAGS
+= -K pic
-DPIC
344 pics
/%.o
:= CPPFLAGS
+= -K pic
-DPIC
345 s5pics
/%.o
:= ASFLAGS
+= -K pic
-DPIC
346 DYNFLAGS
+= $(ZINTERPOSE
)
348 BUILD.s
= $(AS
) $(ASFLAGS
) $< -o
$@
350 # libbc method of building an archive
351 BUILD.AR
= $(RM
) $@
; \
352 $(AR
) q
$@
$(OBJECTS
:%=$(DIR
)/%)
354 # the TXTS macro is used for NSE bootstrapping.
355 TXTS
= inc
/SYS.h inc
/PIC.h inc
/machine
/asm_linkage.h
357 LIBS
= $(DYNLIB4X
) $(DYNLIBS5
)
359 OBJECTS
= $(COMPATCOM
) $(COMPAT4.1
) $(CRTSPARC
) $(GENCOM
) \
360 $(GENCOMSPARC
) $(GEN4.2
) $(STDIOCOM
) $(STDIO4.2
) \
361 $(INET
) $(NET
) $(NETSPARC
) $(YP
) \
362 $(SYSCOM
) $(SYSCOMSPARC
) $(SYS4.2
)
365 # Since this library is strictly for binary compability with ancient
366 # applications, we deactivate CTF to avoid kicking up dust.
371 S5OBJECTS
= $(COMPATCOM
) $(COMPATSYS5
) $(CRTSPARC
) $(GENCOM
) \
372 $(GENCOMSPARC
) $(GENSYS5
) $(STDIOCOM
) $(STDIOSYS5
) \
373 $(SYSCOM
) $(SYSCOMSPARC
) $(SYSSYS5
) $(SSYS5SPARC
) \
374 $(INET
) $(NET
) $(NETSPARC
) $(YP
)
376 S5PICOBJS
= $(S5OBJECTS
:%=s5pics
/%)
378 CLEANFILES
= ..
/libc
/yp
/ypupdate_prot.c ..
/inc
/include/rpcsvc
/ypupdate_prot.h \
379 ..
/libc
/compat
/sys5
/epoch.h \
381 CLOBBERFILES
= ..
/libc
/compat
/sys5
/mkepoch
383 # conditional assignments
384 s5pics
/%.o
:= CPPFLAGS
= -Dsparc
-DS5EMUL
-K pic
-DPIC
-I.
-Iinc \
385 -I..
/inc
/5include -I..
/inc
/include -I..
/inc
/include/sys \
388 s5pics
/%.o
:= CFLAGS
+= -xregs
=no
%appl
389 pics
/%.o
:= CFLAGS
+= -xregs
=no
%appl
391 $(DYNLIB4X
):= DIR
= pics
392 $(DYNLIBS5
):= DIR
= s5pics
396 # Declare that all .o's can be made in parallel.
397 .PARALLEL
: $(PICS
) $(S5PICOBJS
)
401 $(DYNLIB4X
): pics .WAIT
$(PICS
)
402 $(CC
) -o
$@
-G
$(DYNFLAGS
) $(PICS
) $(LDLIBS
)
405 $(DYNLIBS5
): s5pics .WAIT
$(S5PICOBJS
)
406 $(CC
) -o
$@
-G
$(DYNFLAGS
) $(S5PICOBJS
) $(LDLIBS
)
409 # include common library targets
410 include ..
/..
/Makefile.targ
416 PSEUDO_POBJS
= $(PSEUDO_SRCS
:%.s
=pics
/%.o
)
417 PSEUDO_PS5OBJS
= $(PSEUDO_SRCS
:%.s
=s5pics
/%.o
)
419 $(PSEUDO_POBJS
) $(PSEUDO_PS5OBJS
):
420 @
(echo
'#include "SYS.h"'; \
421 echo
' SYSCALL($(@F:.o=))'; \
423 echo
' SET_SIZE($(@F:.o=))') > tmp.
$(@F
:.o
=).s
424 $(AS
) $(ASFLAGS
) -o
$@ tmp.
$(@F
:.o
=).s
426 @
$(RM
) tmp.
$(@F
:.o
=).s
428 s5pics
/times.o
: ..
/libc
/compat
/sys5
/epoch.h ..
/libc
/compat
/sys5
/times.c
429 $(COMPILE.c
) -o
$@ ..
/libc
/compat
/sys5
/times.c
432 ..
/libc
/compat
/sys5
/epoch.h
: ..
/libc
/compat
/sys5
/mkepoch
433 ..
/libc
/compat
/sys5
/mkepoch
> $@
435 ..
/libc
/compat
/sys5
/mkepoch
: ..
/libc
/compat
/sys5
/mkepoch.c
436 $(NATIVECC
) -O
-o
$@ ..
/libc
/compat
/sys5
/mkepoch.c
438 pics
/maperror.o s5pics
/maperror.o
: ..
/libc
/sys
/common
/maperror.c
439 $(CC
) -I..
/libc
/sys
/common
$(CPPFLAGS
) $(CFLAGS
) -c
-o
$@ ..
/libc
/sys
/common
/maperror.c
442 # The following rules generate the .h file and XDR routines from the
443 # rpcgen source. Objects built here, look for it here. Further, when
444 # building ypupdated it should look here too, but doesn't at the moment.
446 # It would be nice to use a ".x.h" rule for this, but that causes problems.
449 s5pics
/yp_update.o
: ..
/inc
/include/rpcsvc
/ypupdate_prot.h ..
/libc
/yp
/yp_update.c
450 $(COMPILE.c
) -o
$@ ..
/libc
/yp
/yp_update.c
453 pics
/ypupdate_prot.o s5pics
/ypupdate_prot.o
: ..
/inc
/include/rpcsvc
/ypupdate_prot.h\
454 ..
/libc
/yp
/ypupdate_prot.c
455 $(COMPILE.c
) -o
$@ ..
/libc
/yp
/ypupdate_prot.c
458 ..
/libc
/yp
/ypupdate_prot.c
: ..
/libc
/yp
/ypupdate_prot.x
460 $(RPCGEN
) -c
-o
$@ ..
/libc
/yp
/ypupdate_prot.x
462 ..
/libc
/yp
/ypupdate_prot.h
: ..
/libc
/yp
/ypupdate_prot.x
463 $(RM
) $@ ..
/libc
/yp
/ypupdate_prot.h
464 $(RPCGEN
) -h
-o ..
/libc
/yp
/ypupdate_prot.h ..
/libc
/yp
/ypupdate_prot.x
466 ..
/inc
/include/rpcsvc
/ypupdate_prot.h
: ..
/libc
/yp
/ypupdate_prot.h
467 cp ..
/libc
/yp
/ypupdate_prot.h
$@