1*7c478bd9Sstevel@tonic-gate# 2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate# 4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate# with the License. 8*7c478bd9Sstevel@tonic-gate# 9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate# and limitations under the License. 13*7c478bd9Sstevel@tonic-gate# 14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate# 20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate# 22*7c478bd9Sstevel@tonic-gate# 23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate# 26*7c478bd9Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" 27*7c478bd9Sstevel@tonic-gate# 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gateLIBRARY = libdtrace.a 30*7c478bd9Sstevel@tonic-gateVERS = .1 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gateLIBSRCS = \ 33*7c478bd9Sstevel@tonic-gate dt_aggregate.c \ 34*7c478bd9Sstevel@tonic-gate dt_as.c \ 35*7c478bd9Sstevel@tonic-gate dt_buf.c \ 36*7c478bd9Sstevel@tonic-gate dt_cc.c \ 37*7c478bd9Sstevel@tonic-gate dt_cg.c \ 38*7c478bd9Sstevel@tonic-gate dt_consume.c \ 39*7c478bd9Sstevel@tonic-gate dt_decl.c \ 40*7c478bd9Sstevel@tonic-gate dt_dis.c \ 41*7c478bd9Sstevel@tonic-gate dt_dof.c \ 42*7c478bd9Sstevel@tonic-gate dt_error.c \ 43*7c478bd9Sstevel@tonic-gate dt_errtags.c \ 44*7c478bd9Sstevel@tonic-gate dt_handle.c \ 45*7c478bd9Sstevel@tonic-gate dt_ident.c \ 46*7c478bd9Sstevel@tonic-gate dt_inttab.c \ 47*7c478bd9Sstevel@tonic-gate dt_link.c \ 48*7c478bd9Sstevel@tonic-gate dt_list.c \ 49*7c478bd9Sstevel@tonic-gate dt_open.c \ 50*7c478bd9Sstevel@tonic-gate dt_options.c \ 51*7c478bd9Sstevel@tonic-gate dt_program.c \ 52*7c478bd9Sstevel@tonic-gate dt_map.c \ 53*7c478bd9Sstevel@tonic-gate dt_module.c \ 54*7c478bd9Sstevel@tonic-gate dt_parser.c \ 55*7c478bd9Sstevel@tonic-gate dt_pcb.c \ 56*7c478bd9Sstevel@tonic-gate dt_pid.c \ 57*7c478bd9Sstevel@tonic-gate dt_pragma.c \ 58*7c478bd9Sstevel@tonic-gate dt_printf.c \ 59*7c478bd9Sstevel@tonic-gate dt_proc.c \ 60*7c478bd9Sstevel@tonic-gate dt_provider.c \ 61*7c478bd9Sstevel@tonic-gate dt_regset.c \ 62*7c478bd9Sstevel@tonic-gate dt_string.c \ 63*7c478bd9Sstevel@tonic-gate dt_strtab.c \ 64*7c478bd9Sstevel@tonic-gate dt_subr.c \ 65*7c478bd9Sstevel@tonic-gate dt_work.c \ 66*7c478bd9Sstevel@tonic-gate dt_xlator.c 67*7c478bd9Sstevel@tonic-gate 68*7c478bd9Sstevel@tonic-gateLIBISASRCS = \ 69*7c478bd9Sstevel@tonic-gate dt_isadep.c 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gateOBJECTS = dt_lex.o dt_grammar.o $(MACHOBJS) $(LIBSRCS:%.c=%.o) $(LIBISASRCS:%.c=%.o) 72*7c478bd9Sstevel@tonic-gate 73*7c478bd9Sstevel@tonic-gateDRTISRC = drti.c 74*7c478bd9Sstevel@tonic-gateDRTIOBJ = $(DRTISRC:%.c=%.o) 75*7c478bd9Sstevel@tonic-gate 76*7c478bd9Sstevel@tonic-gateDLIBSRCS += \ 77*7c478bd9Sstevel@tonic-gate errno.d \ 78*7c478bd9Sstevel@tonic-gate io.d \ 79*7c478bd9Sstevel@tonic-gate procfs.d \ 80*7c478bd9Sstevel@tonic-gate regs.d \ 81*7c478bd9Sstevel@tonic-gate sched.d \ 82*7c478bd9Sstevel@tonic-gate signal.d \ 83*7c478bd9Sstevel@tonic-gate unistd.d 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gateinclude ../../Makefile.lib 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gateSRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c) 88*7c478bd9Sstevel@tonic-gateLIBS = $(DYNLIB) $(LINTLIB) 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gateSRCDIR = ../common 91*7c478bd9Sstevel@tonic-gateSPECMAPFILE = $(MAPDIR)/mapfile 92*7c478bd9Sstevel@tonic-gate 93*7c478bd9Sstevel@tonic-gateCLEANFILES += dt_lex.c dt_grammar.c dt_grammar.h y.output 94*7c478bd9Sstevel@tonic-gateCLEANFILES += ../common/procfs.sed ../common/procfs.d 95*7c478bd9Sstevel@tonic-gateCLEANFILES += ../common/io.sed ../common/io.d 96*7c478bd9Sstevel@tonic-gateCLEANFILES += ../common/dt_errtags.c ../common/errno.d ../common/signal.d 97*7c478bd9Sstevel@tonic-gate 98*7c478bd9Sstevel@tonic-gateCLOBBERFILES += drti.o 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gateCPPFLAGS += -I../common -I. 101*7c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) 102*7c478bd9Sstevel@tonic-gateCFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) 103*7c478bd9Sstevel@tonic-gateYYCFLAGS = 104*7c478bd9Sstevel@tonic-gateLDLIBS += -lgen -lproc -lrtld_db -lctf -lelf -lc 105*7c478bd9Sstevel@tonic-gateDRTILDLIBS = $(LDLIBS.lib) -lc 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gateyydebug := YYCFLAGS += -DYYDEBUG 108*7c478bd9Sstevel@tonic-gate 109*7c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gateLFLAGS = -t -v 112*7c478bd9Sstevel@tonic-gateYFLAGS = -d -v 113*7c478bd9Sstevel@tonic-gate 114*7c478bd9Sstevel@tonic-gateROOTDLIBDIR = $(ROOT)/usr/lib/dtrace 115*7c478bd9Sstevel@tonic-gateROOTDLIBDIR64 = $(ROOT)/usr/lib/dtrace/64 116*7c478bd9Sstevel@tonic-gate 117*7c478bd9Sstevel@tonic-gateROOTDLIBS = $(DLIBSRCS:%=$(ROOTDLIBDIR)/%) 118*7c478bd9Sstevel@tonic-gateROOTDOBJS = $(ROOTDLIBDIR)/$(DRTIOBJ) 119*7c478bd9Sstevel@tonic-gateROOTDOBJS64 = $(ROOTDLIBDIR64)/$(DRTIOBJ) 120*7c478bd9Sstevel@tonic-gate 121*7c478bd9Sstevel@tonic-gate.KEEP_STATE: 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gateall: $(LIBS) $(DRTIOBJ) 124*7c478bd9Sstevel@tonic-gate 125*7c478bd9Sstevel@tonic-gatelint: lintdrti lintcheck 126*7c478bd9Sstevel@tonic-gate 127*7c478bd9Sstevel@tonic-gatelintdrti: ../common/$(DRTISRC) 128*7c478bd9Sstevel@tonic-gate $(LINT.c) ../common/$(DRTISRC) $(DRTILDLIBS) 129*7c478bd9Sstevel@tonic-gate 130*7c478bd9Sstevel@tonic-gatedt_lex.c: $(SRCDIR)/dt_lex.l dt_grammar.h 131*7c478bd9Sstevel@tonic-gate $(LEX) $(LFLAGS) $(SRCDIR)/dt_lex.l > $@ 132*7c478bd9Sstevel@tonic-gate 133*7c478bd9Sstevel@tonic-gatedt_grammar.c dt_grammar.h: $(SRCDIR)/dt_grammar.y 134*7c478bd9Sstevel@tonic-gate $(YACC) $(YFLAGS) $(SRCDIR)/dt_grammar.y 135*7c478bd9Sstevel@tonic-gate @mv y.tab.h dt_grammar.h 136*7c478bd9Sstevel@tonic-gate @mv y.tab.c dt_grammar.c 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CFLAGS += $(YYCFLAGS) 139*7c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CFLAGS64 += $(YYCFLAGS) 140*7c478bd9Sstevel@tonic-gate 141*7c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CERRWARN += -erroff=E_STATEMENT_NOT_REACHED 142*7c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CCVERBOSE = 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gate../common/dt_errtags.c: ../common/mkerrtags.sh ../common/dt_errtags.h 145*7c478bd9Sstevel@tonic-gate sh ../common/mkerrtags.sh < ../common/dt_errtags.h > $@ 146*7c478bd9Sstevel@tonic-gate 147*7c478bd9Sstevel@tonic-gate../common/errno.d: ../common/mkerrno.sh $(SRC)/uts/common/sys/errno.h 148*7c478bd9Sstevel@tonic-gate sh ../common/mkerrno.sh < $(SRC)/uts/common/sys/errno.h > $@ 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate../common/signal.d: ../common/mksignal.sh $(SRC)/uts/common/sys/iso/signal_iso.h 151*7c478bd9Sstevel@tonic-gate sh ../common/mksignal.sh < $(SRC)/uts/common/sys/iso/signal_iso.h > $@ 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate../common/%.sed: ../common/%.sed.in 154*7c478bd9Sstevel@tonic-gate $(COMPILE.cpp) -D_KERNEL $< | tr -d ' ' | tr '"' '@' | grep '^s/' > $@ 155*7c478bd9Sstevel@tonic-gate 156*7c478bd9Sstevel@tonic-gate../common/procfs.d: ../common/procfs.sed ../common/procfs.d.in 157*7c478bd9Sstevel@tonic-gate sed -f ../common/procfs.sed < ../common/procfs.d.in > $@ 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate../common/io.d: ../common/io.sed ../common/io.d.in 160*7c478bd9Sstevel@tonic-gate sed -f ../common/io.sed < ../common/io.d.in > $@ 161*7c478bd9Sstevel@tonic-gate 162*7c478bd9Sstevel@tonic-gatepics/%.o: ../$(MACH)/%.c 163*7c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 164*7c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 165*7c478bd9Sstevel@tonic-gate 166*7c478bd9Sstevel@tonic-gatepics/%.o: ../$(MACH)/%.s 167*7c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $< 168*7c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 169*7c478bd9Sstevel@tonic-gate 170*7c478bd9Sstevel@tonic-gate%.o: ../common/%.c 171*7c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 172*7c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 173*7c478bd9Sstevel@tonic-gate 174*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR): 175*7c478bd9Sstevel@tonic-gate $(INS.dir) 176*7c478bd9Sstevel@tonic-gate 177*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR64): $(ROOTDLIBDIR) 178*7c478bd9Sstevel@tonic-gate $(INS.dir) 179*7c478bd9Sstevel@tonic-gate 180*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.d: ../common/%.d 181*7c478bd9Sstevel@tonic-gate $(INS.file) 182*7c478bd9Sstevel@tonic-gate 183*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.d: ../$(MACH)/%.d 184*7c478bd9Sstevel@tonic-gate $(INS.file) 185*7c478bd9Sstevel@tonic-gate 186*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.d: %.d 187*7c478bd9Sstevel@tonic-gate $(INS.file) 188*7c478bd9Sstevel@tonic-gate 189*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.o: %.o 190*7c478bd9Sstevel@tonic-gate $(INS.file) 191*7c478bd9Sstevel@tonic-gate 192*7c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR64)/%.o: %.o 193*7c478bd9Sstevel@tonic-gate $(INS.file) 194*7c478bd9Sstevel@tonic-gate 195*7c478bd9Sstevel@tonic-gate$(ROOTDLIBS): $(ROOTDLIBDIR) 196*7c478bd9Sstevel@tonic-gate 197*7c478bd9Sstevel@tonic-gate$(ROOTDOBJS): $(ROOTDLIBDIR) 198*7c478bd9Sstevel@tonic-gate 199*7c478bd9Sstevel@tonic-gate$(ROOTDOBJS64): $(ROOTDLIBDIR64) 200*7c478bd9Sstevel@tonic-gate 201*7c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 202