xref: /illumos-gate/usr/src/cmd/mdb/Makefile.kmdb.targ (revision 69bb4bb45c98da60d21839c4dc3c01ea1be60585)
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
5b272bda5Spetede# Common Development and Distribution License (the "License").
6b272bda5Spetede# 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#
22b272bda5Spetede# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate$(PROG).core: $(OBJS) $(KMDBLIBS) $(MAPFILE)
297c478bd9Sstevel@tonic-gate	$(LD) -r -Breduce -znoversion -zdefs -M$(MAPFILE) -o $@ $(OBJS) \
307c478bd9Sstevel@tonic-gate	    $(KMDBLIBS)
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gate$(PROG): $(PROG).core $(KCTLOBJS)
337c478bd9Sstevel@tonic-gate	$(LD) -dy -r -o $@ $@.core -Nmisc/ctf $(KCTLOBJS)
347c478bd9Sstevel@tonic-gate	$(CTFMERGE) -L VERSION -o $@ $(OBJS) $(KCTLOBJS)
357c478bd9Sstevel@tonic-gate	$(KMDB_FPTEST)
367c478bd9Sstevel@tonic-gate	$(SETDYNFLAG) -f DF_1_IGNMULDEF,DF_1_NOKSYMS $@
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateclean.lint:
397c478bd9Sstevel@tonic-gate	$(RM) $(ALLLINTFILES)
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateclean:
427c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(KCTLOBJS) $(PROG).core $(MAPFILE)
43b272bda5Spetede	$(RM) $(MAPFILE_INTERMEDIATE)
447c478bd9Sstevel@tonic-gate	$(RM) kmdb_terminfo.c kmdb_modlinktest.c kmdb_modlinktest.o
457c478bd9Sstevel@tonic-gate	$(RM) kaif_off.h kmdb_context_off.h
467c478bd9Sstevel@tonic-gate	$(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gateclobber: clean clean.lint
497c478bd9Sstevel@tonic-gate	$(RM) $(PROG)
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gatedmods:
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gate#
547c478bd9Sstevel@tonic-gate# Specialized object construction
557c478bd9Sstevel@tonic-gate#
567c478bd9Sstevel@tonic-gatekmdb_terminfo.c: 	../../../common/mdb/mdb_termio.c \
577c478bd9Sstevel@tonic-gate			../../../common/kmdb/kmdb_terminfo_skel.c
587c478bd9Sstevel@tonic-gate	$(TIGEN) -s ../../../common/kmdb/kmdb_terminfo_skel.c \
597c478bd9Sstevel@tonic-gate	    -t ../../../common/mdb/mdb_termio.c \
607c478bd9Sstevel@tonic-gate	    $(SUPPORTED_TERMS) > $@
617c478bd9Sstevel@tonic-gate
62b272bda5Spetede$(MAPFILE_INTERMEDIATE): $(MAPFILE_SOURCES) $(MAPFILE_TEMPLATE)
63b272bda5Spetede	$(HDR2MAP) -t $(MAPFILE_TEMPLATE) $(MAPFILE_SOURCES) >$@
64b272bda5Spetede
65b272bda5Spetede$(MAPFILE): $(MAPFILE_INTERMEDIATE)
66b272bda5Spetede	$(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$@
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gatemdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
697c478bd9Sstevel@tonic-gate	$(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gatemdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
727c478bd9Sstevel@tonic-gate	$(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
737c478bd9Sstevel@tonic-gate	@$(MV) y.tab.h mdb_grammar.h
747c478bd9Sstevel@tonic-gate	@$(MV) y.tab.c mdb_grammar.c
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate#
777c478bd9Sstevel@tonic-gate# These should really be combined into a dynamic rule, but there's a bug in
787c478bd9Sstevel@tonic-gate# dmake that'll cause it to get confused about dependencies if we do.
797c478bd9Sstevel@tonic-gate#
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gatekaif_off.h := CPPFLAGS += $(SACPPCFLAGS)
827c478bd9Sstevel@tonic-gate
83b272bda5Spetedekmdb_modlinktest.c: $(MAPFILE_INTERMEDIATE)
84b272bda5Spetede	$(MAP2LINKTEST) <$(MAPFILE_INTERMEDIATE) >$@
85b272bda5Spetede	$(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$(MAPFILE)
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate#
887c478bd9Sstevel@tonic-gate# Dynamic rules for object construction
897c478bd9Sstevel@tonic-gate#
907c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/%.c
917c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
927c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.c
957c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
967c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.s
997c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate%.o: ../../../common/mdb/%.c
1027c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1037c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gate%.o: ../../kmdb/%.c
1067c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1077c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate%.o: ../../kmdb/%.s
1107c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate%.o: ../../kmdb/kctl/%.c
1137c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1147c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gate%.o: ../../kmdb/kctl/%.s
1177c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gate%.o: ../../mdb/%.c
1207c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1217c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate%.o: %.c
1247c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1257c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate%.o: %.s
1287c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gate%.o: kctl/%.s
1317c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate%.o: $(SRC)/common/net/util/%.c
1347c478bd9Sstevel@tonic-gate	$(COMPILE.c) $<
1357c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1367c478bd9Sstevel@tonic-gate
137*69bb4bb4Scarlsonj%.o: $(SRC)/common/util/%.c
138*69bb4bb4Scarlsonj	$(COMPILE.c) $<
139*69bb4bb4Scarlsonj	$(CTFCONVERT_O)
140*69bb4bb4Scarlsonj
1417c478bd9Sstevel@tonic-gate#
1427c478bd9Sstevel@tonic-gate# Lint
1437c478bd9Sstevel@tonic-gate#
1447c478bd9Sstevel@tonic-gate
1457c478bd9Sstevel@tonic-gate%.ln: ../../../common/kmdb/%.c
1467c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate%.ln: ../../../common/kmdb/kctl/%.c
1497c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gate%.ln: ../../../common/kmdb/kctl/%.s
1527c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate%.ln: ../../../common/mdb/%.c
1557c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/%.c
1587c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/%.s
1617c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/kctl/%.c
1647c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/kctl/%.s
1677c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gate%.ln: ../../mdb/%.c
1707c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1717c478bd9Sstevel@tonic-gate
1727c478bd9Sstevel@tonic-gate%.ln: %.c
1737c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate%.ln: %.s
1767c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gate%.ln: kctl/%.s
1797c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gate%.ln: $(SRC)/common/net/util/%.c
1827c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
183*69bb4bb4Scarlsonj
184*69bb4bb4Scarlsonj%.ln: $(SRC)/common/util/%.c
185*69bb4bb4Scarlsonj	$(LINT.c) -c $<
186