xref: /titanic_51/usr/src/lib/libdtrace/Makefile.com (revision a668b114487acbb725f522170849c39f8e844673)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5f808c858Sraf# Common Development and Distribution License (the "License").
6f808c858Sraf# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
225f549bd2SSam Cramer# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateLIBRARY = libdtrace.a
287c478bd9Sstevel@tonic-gateVERS = .1
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateLIBSRCS = \
317c478bd9Sstevel@tonic-gate	dt_aggregate.c \
327c478bd9Sstevel@tonic-gate	dt_as.c \
337c478bd9Sstevel@tonic-gate	dt_buf.c \
347c478bd9Sstevel@tonic-gate	dt_cc.c \
357c478bd9Sstevel@tonic-gate	dt_cg.c \
367c478bd9Sstevel@tonic-gate	dt_consume.c \
377c478bd9Sstevel@tonic-gate	dt_decl.c \
387c478bd9Sstevel@tonic-gate	dt_dis.c \
397c478bd9Sstevel@tonic-gate	dt_dof.c \
407c478bd9Sstevel@tonic-gate	dt_error.c \
417c478bd9Sstevel@tonic-gate	dt_errtags.c \
427c478bd9Sstevel@tonic-gate	dt_handle.c \
437c478bd9Sstevel@tonic-gate	dt_ident.c \
447c478bd9Sstevel@tonic-gate	dt_inttab.c \
457c478bd9Sstevel@tonic-gate	dt_link.c \
467c478bd9Sstevel@tonic-gate	dt_list.c \
477c478bd9Sstevel@tonic-gate	dt_open.c \
487c478bd9Sstevel@tonic-gate	dt_options.c \
497c478bd9Sstevel@tonic-gate	dt_program.c \
507c478bd9Sstevel@tonic-gate	dt_map.c \
517c478bd9Sstevel@tonic-gate	dt_module.c \
521a7c1b72Smws	dt_names.c \
537c478bd9Sstevel@tonic-gate	dt_parser.c \
547c478bd9Sstevel@tonic-gate	dt_pcb.c \
557c478bd9Sstevel@tonic-gate	dt_pid.c \
567c478bd9Sstevel@tonic-gate	dt_pragma.c \
577c478bd9Sstevel@tonic-gate	dt_printf.c \
587c478bd9Sstevel@tonic-gate	dt_proc.c \
597c478bd9Sstevel@tonic-gate	dt_provider.c \
607c478bd9Sstevel@tonic-gate	dt_regset.c \
617c478bd9Sstevel@tonic-gate        dt_string.c \
627c478bd9Sstevel@tonic-gate	dt_strtab.c \
637c478bd9Sstevel@tonic-gate	dt_subr.c \
647c478bd9Sstevel@tonic-gate	dt_work.c \
657c478bd9Sstevel@tonic-gate	dt_xlator.c
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gateLIBISASRCS = \
687c478bd9Sstevel@tonic-gate	dt_isadep.c
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gateOBJECTS = dt_lex.o dt_grammar.o $(MACHOBJS) $(LIBSRCS:%.c=%.o) $(LIBISASRCS:%.c=%.o)
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gateDRTISRC = drti.c
737c478bd9Sstevel@tonic-gateDRTIOBJ = $(DRTISRC:%.c=%.o)
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gateDLIBSRCS += \
767c478bd9Sstevel@tonic-gate	errno.d \
775f549bd2SSam Cramer	fc.d \
787c478bd9Sstevel@tonic-gate	io.d \
794edabff4Sbrendan	ip.d \
80*a668b114SPriya Krishnan	iscsit.d \
81f3b585ceSsamf	net.d \
82f3b585ceSsamf	nfs.d \
837c478bd9Sstevel@tonic-gate	procfs.d \
847c478bd9Sstevel@tonic-gate	regs.d \
857c478bd9Sstevel@tonic-gate	sched.d \
867c478bd9Sstevel@tonic-gate	signal.d \
875f549bd2SSam Cramer	scsi.d \
88e04145d0Seschrock	sysevent.d \
897c478bd9Sstevel@tonic-gate	unistd.d
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gateinclude ../../Makefile.lib
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gateSRCS = $(LIBSRCS:%.c=../common/%.c) $(LIBISASRCS:%.c=../$(MACH)/%.c)
947c478bd9Sstevel@tonic-gateLIBS = $(DYNLIB) $(LINTLIB)
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gateSRCDIR = ../common
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gateCLEANFILES += dt_lex.c dt_grammar.c dt_grammar.h y.output
997c478bd9Sstevel@tonic-gateCLEANFILES += ../common/procfs.sed ../common/procfs.d
1007c478bd9Sstevel@tonic-gateCLEANFILES += ../common/io.sed ../common/io.d
1014edabff4SbrendanCLEANFILES += ../common/ip.sed ../common/ip.d
10210e6dadfSbrendanCLEANFILES += ../common/net.sed ../common/net.d
1031a7c1b72SmwsCLEANFILES += ../common/errno.d ../common/signal.d
1041a7c1b72SmwsCLEANFILES += ../common/dt_errtags.c ../common/dt_names.c
105e04145d0SeschrockCLEANFILES += ../common/sysevent.sed ../common/sysevent.d
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gateCLOBBERFILES += drti.o
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gateCPPFLAGS += -I../common -I.
1107c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
1117c478bd9Sstevel@tonic-gateCFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
1127c478bd9Sstevel@tonic-gateYYCFLAGS =
1137c478bd9Sstevel@tonic-gateLDLIBS += -lgen -lproc -lrtld_db -lctf -lelf -lc
1147c478bd9Sstevel@tonic-gateDRTILDLIBS = $(LDLIBS.lib) -lc
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gateyydebug := YYCFLAGS += -DYYDEBUG
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gateLFLAGS = -t -v
1217c478bd9Sstevel@tonic-gateYFLAGS = -d -v
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gateROOTDLIBDIR = $(ROOT)/usr/lib/dtrace
1247c478bd9Sstevel@tonic-gateROOTDLIBDIR64 = $(ROOT)/usr/lib/dtrace/64
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gateROOTDLIBS = $(DLIBSRCS:%=$(ROOTDLIBDIR)/%)
1277c478bd9Sstevel@tonic-gateROOTDOBJS = $(ROOTDLIBDIR)/$(DRTIOBJ)
1287c478bd9Sstevel@tonic-gateROOTDOBJS64 = $(ROOTDLIBDIR64)/$(DRTIOBJ)
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gate.KEEP_STATE:
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gateall: $(LIBS) $(DRTIOBJ)
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gatelint: lintdrti lintcheck
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gatelintdrti: ../common/$(DRTISRC)
1377c478bd9Sstevel@tonic-gate	$(LINT.c) ../common/$(DRTISRC) $(DRTILDLIBS)
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gatedt_lex.c: $(SRCDIR)/dt_lex.l dt_grammar.h
1407c478bd9Sstevel@tonic-gate	$(LEX) $(LFLAGS) $(SRCDIR)/dt_lex.l > $@
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gatedt_grammar.c dt_grammar.h: $(SRCDIR)/dt_grammar.y
1437c478bd9Sstevel@tonic-gate	$(YACC) $(YFLAGS) $(SRCDIR)/dt_grammar.y
1447c478bd9Sstevel@tonic-gate	@mv y.tab.h dt_grammar.h
1457c478bd9Sstevel@tonic-gate	@mv y.tab.c dt_grammar.c
1467c478bd9Sstevel@tonic-gate
1477c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CFLAGS += $(YYCFLAGS)
1487c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CFLAGS64 += $(YYCFLAGS)
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
1517c478bd9Sstevel@tonic-gatepics/dt_lex.o pics/dt_grammar.o := CCVERBOSE =
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gate../common/dt_errtags.c: ../common/mkerrtags.sh ../common/dt_errtags.h
1547c478bd9Sstevel@tonic-gate	sh ../common/mkerrtags.sh < ../common/dt_errtags.h > $@
1557c478bd9Sstevel@tonic-gate
1561a7c1b72Smws../common/dt_names.c: ../common/mknames.sh $(SRC)/uts/common/sys/dtrace.h
1571a7c1b72Smws	sh ../common/mknames.sh < $(SRC)/uts/common/sys/dtrace.h > $@
1581a7c1b72Smws
1597c478bd9Sstevel@tonic-gate../common/errno.d: ../common/mkerrno.sh $(SRC)/uts/common/sys/errno.h
1607c478bd9Sstevel@tonic-gate	sh ../common/mkerrno.sh < $(SRC)/uts/common/sys/errno.h > $@
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gate../common/signal.d: ../common/mksignal.sh $(SRC)/uts/common/sys/iso/signal_iso.h
1637c478bd9Sstevel@tonic-gate	sh ../common/mksignal.sh < $(SRC)/uts/common/sys/iso/signal_iso.h > $@
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gate../common/%.sed: ../common/%.sed.in
166e04145d0Seschrock	$(COMPILE.cpp) -D_KERNEL $< | tr -d ' ' | tr '"' '@' | \
167e04145d0Seschrock	    sed 's/\&/\\\&/g' | grep '^s/' > $@
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gate../common/procfs.d: ../common/procfs.sed ../common/procfs.d.in
1707c478bd9Sstevel@tonic-gate	sed -f ../common/procfs.sed < ../common/procfs.d.in > $@
1717c478bd9Sstevel@tonic-gate
1727c478bd9Sstevel@tonic-gate../common/io.d: ../common/io.sed ../common/io.d.in
1737c478bd9Sstevel@tonic-gate	sed -f ../common/io.sed < ../common/io.d.in > $@
1747c478bd9Sstevel@tonic-gate
1754edabff4Sbrendan../common/ip.d: ../common/ip.sed ../common/ip.d.in
1764edabff4Sbrendan	sed -f ../common/ip.sed < ../common/ip.d.in > $@
1774edabff4Sbrendan
17810e6dadfSbrendan../common/net.d: ../common/net.sed ../common/net.d.in
17910e6dadfSbrendan	sed -f ../common/net.sed < ../common/net.d.in > $@
18010e6dadfSbrendan
181e04145d0Seschrock../common/sysevent.d: ../common/sysevent.sed ../common/sysevent.d.in
182e04145d0Seschrock	sed -f ../common/sysevent.sed < ../common/sysevent.d.in > $@
183e04145d0Seschrock
1847c478bd9Sstevel@tonic-gatepics/%.o: ../$(MACH)/%.c
1857c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1867c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1877c478bd9Sstevel@tonic-gate
1887c478bd9Sstevel@tonic-gatepics/%.o: ../$(MACH)/%.s
1897c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1907c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1917c478bd9Sstevel@tonic-gate
1927c478bd9Sstevel@tonic-gate%.o: ../common/%.c
1937c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1947c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR):
1977c478bd9Sstevel@tonic-gate	$(INS.dir)
1987c478bd9Sstevel@tonic-gate
1997c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR64): $(ROOTDLIBDIR)
2007c478bd9Sstevel@tonic-gate	$(INS.dir)
2017c478bd9Sstevel@tonic-gate
2027c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.d: ../common/%.d
2037c478bd9Sstevel@tonic-gate	$(INS.file)
2047c478bd9Sstevel@tonic-gate
2057c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.d: ../$(MACH)/%.d
2067c478bd9Sstevel@tonic-gate	$(INS.file)
2077c478bd9Sstevel@tonic-gate
2087c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.d: %.d
2097c478bd9Sstevel@tonic-gate	$(INS.file)
2107c478bd9Sstevel@tonic-gate
2117c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR)/%.o: %.o
2127c478bd9Sstevel@tonic-gate	$(INS.file)
2137c478bd9Sstevel@tonic-gate
2147c478bd9Sstevel@tonic-gate$(ROOTDLIBDIR64)/%.o: %.o
2157c478bd9Sstevel@tonic-gate	$(INS.file)
2167c478bd9Sstevel@tonic-gate
2177c478bd9Sstevel@tonic-gate$(ROOTDLIBS): $(ROOTDLIBDIR)
2187c478bd9Sstevel@tonic-gate
2197c478bd9Sstevel@tonic-gate$(ROOTDOBJS): $(ROOTDLIBDIR)
2207c478bd9Sstevel@tonic-gate
2217c478bd9Sstevel@tonic-gate$(ROOTDOBJS64): $(ROOTDLIBDIR64)
2227c478bd9Sstevel@tonic-gate
2237c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
224