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) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 23 # Copyright (c) 2011 by Delphix. All rights reserved. 24 # 25 26 LIBRARY = libdtrace.a 27 VERS = .1 28 29 LIBSRCS = \ 30 dt_aggregate.c \ 31 dt_as.c \ 32 dt_buf.c \ 33 dt_cc.c \ 34 dt_cg.c \ 35 dt_consume.c \ 36 dt_decl.c \ 37 dt_dis.c \ 38 dt_dof.c \ 39 dt_error.c \ 40 dt_errtags.c \ 41 dt_handle.c \ 42 dt_ident.c \ 43 dt_inttab.c \ 44 dt_link.c \ 45 dt_list.c \ 46 dt_open.c \ 47 dt_options.c \ 48 dt_program.c \ 49 dt_map.c \ 50 dt_module.c \ 51 dt_names.c \ 52 dt_parser.c \ 53 dt_pcb.c \ 54 dt_pid.c \ 55 dt_pragma.c \ 56 dt_print.c \ 57 dt_printf.c \ 58 dt_proc.c \ 59 dt_provider.c \ 60 dt_regset.c \ 61 dt_string.c \ 62 dt_strtab.c \ 63 dt_subr.c \ 64 dt_work.c \ 65 dt_xlator.c 66 67 LIBISASRCS = \ 68 dt_isadep.c 69 70 OBJECTS = dt_lex.o dt_grammar.o $(MACHOBJS) $(LIBSRCS:%.c=%.o) $(LIBISASRCS:%.c=%.o) 71 72 DRTISRC = drti.c 73 DRTIOBJ = $(DRTISRC:%.c=%.o) 74 75 DLIBSRCS += \ 76 errno.d \ 77 fc.d \ 78 io.d \ 79 ip.d \ 80 iscsit.d \ 81 net.d \ 82 nfs.d \ 83 nfssrv.d \ 84 procfs.d \ 85 regs.d \ 86 sched.d \ 87 signal.d \ 88 scsi.d \ 89 srp.d \ 90 sysevent.d \ 91 tcp.d \ 92 udp.d \ 93 unistd.d 94 95 include ../../Makefile.lib 96 97 SRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c) 98 LIBS = $(DYNLIB) $(LINTLIB) 99 100 SRCDIR = ../common 101 102 CLEANFILES += dt_lex.c dt_grammar.c dt_grammar.h y.output 103 CLEANFILES += ../common/procfs.sed ../common/procfs.d 104 CLEANFILES += ../common/io.sed ../common/io.d 105 CLEANFILES += ../common/ip.sed ../common/ip.d 106 CLEANFILES += ../common/net.sed ../common/net.d 107 CLEANFILES += ../common/errno.d ../common/signal.d 108 CLEANFILES += ../common/dt_errtags.c ../common/dt_names.c 109 CLEANFILES += ../common/sysevent.sed ../common/sysevent.d 110 CLEANFILES += ../common/tcp.sed ../common/tcp.d 111 CLEANFILES += ../common/udp.sed ../common/udp.d 112 113 CLOBBERFILES += drti.o 114 115 CPPFLAGS += -I../common -I. 116 CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) 117 CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) 118 YYCFLAGS = 119 LDLIBS += -lgen -lproc -lrtld_db -lnsl -lsocket -lctf -lelf -lc 120 DRTILDLIBS = $(LDLIBS.lib) -lc 121 122 yydebug := YYCFLAGS += -DYYDEBUG 123 124 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 125 126 LFLAGS = -t -v 127 YFLAGS = -d -v 128 129 ROOTDLIBDIR = $(ROOT)/usr/lib/dtrace 130 ROOTDLIBDIR64 = $(ROOT)/usr/lib/dtrace/64 131 132 ROOTDLIBS = $(DLIBSRCS:%=$(ROOTDLIBDIR)/%) 133 ROOTDOBJS = $(ROOTDLIBDIR)/$(DRTIOBJ) 134 ROOTDOBJS64 = $(ROOTDLIBDIR64)/$(DRTIOBJ) 135 136 .KEEP_STATE: 137 138 all: $(LIBS) $(DRTIOBJ) 139 140 lint: lintdrti lintcheck 141 142 lintdrti: ../common/$(DRTISRC) 143 $(LINT.c) ../common/$(DRTISRC) $(DRTILDLIBS) 144 145 dt_lex.c: $(SRCDIR)/dt_lex.l dt_grammar.h 146 $(LEX) $(LFLAGS) $(SRCDIR)/dt_lex.l > $@ 147 148 dt_grammar.c dt_grammar.h: $(SRCDIR)/dt_grammar.y 149 $(YACC) $(YFLAGS) $(SRCDIR)/dt_grammar.y 150 @mv y.tab.h dt_grammar.h 151 @mv y.tab.c dt_grammar.c 152 153 pics/dt_lex.o pics/dt_grammar.o := CFLAGS += $(YYCFLAGS) 154 pics/dt_lex.o pics/dt_grammar.o := CFLAGS64 += $(YYCFLAGS) 155 156 pics/dt_lex.o pics/dt_grammar.o := CERRWARN += -erroff=E_STATEMENT_NOT_REACHED 157 pics/dt_lex.o pics/dt_grammar.o := CCVERBOSE = 158 159 ../common/dt_errtags.c: ../common/mkerrtags.sh ../common/dt_errtags.h 160 sh ../common/mkerrtags.sh < ../common/dt_errtags.h > $@ 161 162 ../common/dt_names.c: ../common/mknames.sh $(SRC)/uts/common/sys/dtrace.h 163 sh ../common/mknames.sh < $(SRC)/uts/common/sys/dtrace.h > $@ 164 165 ../common/errno.d: ../common/mkerrno.sh $(SRC)/uts/common/sys/errno.h 166 sh ../common/mkerrno.sh < $(SRC)/uts/common/sys/errno.h > $@ 167 168 ../common/signal.d: ../common/mksignal.sh $(SRC)/uts/common/sys/iso/signal_iso.h 169 sh ../common/mksignal.sh < $(SRC)/uts/common/sys/iso/signal_iso.h > $@ 170 171 ../common/%.sed: ../common/%.sed.in 172 $(COMPILE.cpp) -D_KERNEL $< | tr -d ' ' | tr '"' '@' | \ 173 sed 's/\&/\\\&/g' | grep '^s/' > $@ 174 175 ../common/procfs.d: ../common/procfs.sed ../common/procfs.d.in 176 sed -f ../common/procfs.sed < ../common/procfs.d.in > $@ 177 178 ../common/io.d: ../common/io.sed ../common/io.d.in 179 sed -f ../common/io.sed < ../common/io.d.in > $@ 180 181 ../common/ip.d: ../common/ip.sed ../common/ip.d.in 182 sed -f ../common/ip.sed < ../common/ip.d.in > $@ 183 184 ../common/net.d: ../common/net.sed ../common/net.d.in 185 sed -f ../common/net.sed < ../common/net.d.in > $@ 186 187 ../common/sysevent.d: ../common/sysevent.sed ../common/sysevent.d.in 188 sed -f ../common/sysevent.sed < ../common/sysevent.d.in > $@ 189 190 ../common/tcp.d: ..//common/tcp.sed ../common/tcp.d.in 191 sed -f ../common/tcp.sed < ../common/tcp.d.in > $@ 192 193 ../common/udp.d: ../common/udp.sed ../common/udp.d.in 194 sed -f ../common/udp.sed < ../common/udp.d.in > $@ 195 196 pics/%.o: ../$(MACH)/%.c 197 $(COMPILE.c) -o $@ $< 198 $(POST_PROCESS_O) 199 200 pics/%.o: ../$(MACH)/%.s 201 $(COMPILE.s) -o $@ $< 202 $(POST_PROCESS_O) 203 204 %.o: ../common/%.c 205 $(COMPILE.c) -o $@ $< 206 $(POST_PROCESS_O) 207 208 $(ROOTDLIBDIR): 209 $(INS.dir) 210 211 $(ROOTDLIBDIR64): $(ROOTDLIBDIR) 212 $(INS.dir) 213 214 $(ROOTDLIBDIR)/%.d: ../common/%.d 215 $(INS.file) 216 217 $(ROOTDLIBDIR)/%.d: ../$(MACH)/%.d 218 $(INS.file) 219 220 $(ROOTDLIBDIR)/%.d: %.d 221 $(INS.file) 222 223 $(ROOTDLIBDIR)/%.o: %.o 224 $(INS.file) 225 226 $(ROOTDLIBDIR64)/%.o: %.o 227 $(INS.file) 228 229 $(ROOTDLIBS): $(ROOTDLIBDIR) 230 231 $(ROOTDOBJS): $(ROOTDLIBDIR) 232 233 $(ROOTDOBJS64): $(ROOTDLIBDIR64) 234 235 include ../../Makefile.targ