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 # Copyright 2019 Peter Tribble. 26 # 27 28 LIBRARY= libucb.a 29 VERS= .1 30 31 PORTSYSOBJS= \ 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 45 PORTSTDIOOBJS= \ 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 55 PORTGENOBJS= \ 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 76 OBJECTS= $(SYSOBJS) $(PORTGENOBJS) $(PORTSYSOBJS) $(PORTSTDIOOBJS) 77 78 # include library definitions 79 include $(SRC)/lib/Makefile.lib 80 81 ROOTLIBDIR= $(ROOT)/usr/ucblib 82 ROOTLIBDIR64= $(ROOT)/usr/ucblib/$(MACH64) 83 84 MAPFILES = ../port/mapfile-vers 85 86 SRCS= $(PORTGENOBJS:%.o=../port/gen/%.c) \ 87 $(PORTSTDIOOBJS:%.o=../port/stdio/%.c) \ 88 $(PORTSYSOBJS:%.o=../port/sys/%.c) 89 90 LIBS = $(DYNLIB) 91 92 CFLAGS += $(CCVERBOSE) 93 CFLAGS64 += $(CCVERBOSE) 94 LDLIBS += -lelf -lc 95 96 CPPFLAGS = -D$(MACH) -I$(SRC)/ucbhead -I../inc \ 97 -I../../../lib/libc/inc $(CPPFLAGS.master) 98 99 CERRWARN += -_gcc=-Wno-unused-variable 100 CERRWARN += -_gcc=-Wno-parentheses 101 CERRWARN += -_gcc=-Wno-char-subscripts 102 CERRWARN += -_gcc=-Wno-uninitialized 103 104 # not linted 105 SMATCH=off 106 107 ASFLAGS= -P -D__STDC__ -DLOCORE -D_SYS_SYS_S -D_ASM $(CPPFLAGS) 108 109 pics/%.o:= ASFLAGS += $(AS_PICFLAGS) 110 111 # libc method of building an archive, using AT&T ordering 112 BUILD.AR= $(RM) $@ ; \ 113 $(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)` 114 115 .KEEP_STATE: 116 117 all: $(LIBS) 118 119 lint: lintcheck 120 121 pics/%.o: ../port/gen/%.c 122 $(COMPILE.c) -o $@ $< 123 $(POST_PROCESS_O) 124 pics/%.o: ../port/stdio/%.c 125 $(COMPILE.c) -o $@ $< 126 $(POST_PROCESS_O) 127 pics/%.o: ../port/sys/%.c 128 $(COMPILE.c) -o $@ $< 129 $(POST_PROCESS_O) 130 131 # shared (sparc/sparcv9/i386/amd64) platform-specific rule 132 pics/%.o: sys/%.c 133 $(COMPILE.c) -o $@ $< 134 $(POST_PROCESS_O) 135 136 pics/%.o: ../$(MACH)/sys/%.s 137 $(BUILD.s) 138 $(POST_PROCESS_S_O) 139 140 # 141 # Include library targets 142 # 143 include $(SRC)/lib/Makefile.targ