xref: /titanic_52/usr/src/cmd/mdb/Makefile.kmdb.targ (revision 6ddb3373ce2752b5535cbbda4370c8c550876098)
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#
2224da5b34Srie# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
25170832d3SAlbert Lee
26170832d3SAlbert LeeROOTTERMINFO = $(ROOTSHLIB)/terminfo
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate$(PROG).core: $(OBJS) $(KMDBLIBS) $(MAPFILE)
2924da5b34Srie	$(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)
36*6ddb3373SRichard Lowe	$(POST_PROCESS)
377c478bd9Sstevel@tonic-gate	$(SETDYNFLAG) -f DF_1_IGNMULDEF,DF_1_NOKSYMS $@
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateclean.lint:
407c478bd9Sstevel@tonic-gate	$(RM) $(ALLLINTFILES)
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateclean:
437c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(KCTLOBJS) $(PROG).core $(MAPFILE)
44b272bda5Spetede	$(RM) $(MAPFILE_INTERMEDIATE)
457c478bd9Sstevel@tonic-gate	$(RM) kmdb_terminfo.c kmdb_modlinktest.c kmdb_modlinktest.o
467c478bd9Sstevel@tonic-gate	$(RM) kaif_off.h kmdb_context_off.h
477c478bd9Sstevel@tonic-gate	$(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gateclobber: clean clean.lint
507c478bd9Sstevel@tonic-gate	$(RM) $(PROG)
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gatedmods:
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gate#
557c478bd9Sstevel@tonic-gate# Specialized object construction
567c478bd9Sstevel@tonic-gate#
577c478bd9Sstevel@tonic-gatekmdb_terminfo.c: 	../../../common/mdb/mdb_termio.c \
58170832d3SAlbert Lee			../../../common/kmdb/kmdb_terminfo_skel.c \
59170832d3SAlbert Lee			$(ROOTTERMINFO)
60170832d3SAlbert Lee	TERMINFO=$(ROOTTERMINFO) $(TIGEN) -s \
61170832d3SAlbert Lee	    ../../../common/kmdb/kmdb_terminfo_skel.c \
627c478bd9Sstevel@tonic-gate	    -t ../../../common/mdb/mdb_termio.c \
637c478bd9Sstevel@tonic-gate	    $(SUPPORTED_TERMS) > $@
647c478bd9Sstevel@tonic-gate
65b272bda5Spetede$(MAPFILE_INTERMEDIATE): $(MAPFILE_SOURCES) $(MAPFILE_TEMPLATE)
66b272bda5Spetede	$(HDR2MAP) -t $(MAPFILE_TEMPLATE) $(MAPFILE_SOURCES) >$@
67b272bda5Spetede
68b272bda5Spetede$(MAPFILE): $(MAPFILE_INTERMEDIATE)
69b272bda5Spetede	$(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$@
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gatemdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
727c478bd9Sstevel@tonic-gate	$(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gatemdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
757c478bd9Sstevel@tonic-gate	$(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
767c478bd9Sstevel@tonic-gate	@$(MV) y.tab.h mdb_grammar.h
777c478bd9Sstevel@tonic-gate	@$(MV) y.tab.c mdb_grammar.c
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate#
807c478bd9Sstevel@tonic-gate# These should really be combined into a dynamic rule, but there's a bug in
817c478bd9Sstevel@tonic-gate# dmake that'll cause it to get confused about dependencies if we do.
827c478bd9Sstevel@tonic-gate#
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gatekaif_off.h := CPPFLAGS += $(SACPPCFLAGS)
857c478bd9Sstevel@tonic-gate
86b272bda5Spetedekmdb_modlinktest.c: $(MAPFILE_INTERMEDIATE)
87b272bda5Spetede	$(MAP2LINKTEST) <$(MAPFILE_INTERMEDIATE) >$@
88b272bda5Spetede	$(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$(MAPFILE)
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gate#
917c478bd9Sstevel@tonic-gate# Dynamic rules for object construction
927c478bd9Sstevel@tonic-gate#
937c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/%.c
947c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
957c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.c
987c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
997c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.s
1027c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate%.o: ../../../common/mdb/%.c
1057c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1067c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gate%.o: ../../kmdb/%.c
1097c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1107c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate%.o: ../../kmdb/%.s
1137c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gate%.o: ../../kmdb/kctl/%.c
1167c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1177c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gate%.o: ../../kmdb/kctl/%.s
1207c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gate%.o: ../../mdb/%.c
1237c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1247c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate%.o: %.c
1277c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1287c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gate%.o: %.s
1317c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate%.o: kctl/%.s
1347c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gate%.o: $(SRC)/common/net/util/%.c
1377c478bd9Sstevel@tonic-gate	$(COMPILE.c) $<
1387c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
1397c478bd9Sstevel@tonic-gate
14069bb4bb4Scarlsonj%.o: $(SRC)/common/util/%.c
14169bb4bb4Scarlsonj	$(COMPILE.c) $<
14269bb4bb4Scarlsonj	$(CTFCONVERT_O)
14369bb4bb4Scarlsonj
1447c478bd9Sstevel@tonic-gate#
1457c478bd9Sstevel@tonic-gate# Lint
1467c478bd9Sstevel@tonic-gate#
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate%.ln: ../../../common/kmdb/%.c
1497c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gate%.ln: ../../../common/kmdb/kctl/%.c
1527c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate%.ln: ../../../common/kmdb/kctl/%.s
1557c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gate%.ln: ../../../common/mdb/%.c
1587c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/%.c
1617c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/%.s
1647c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/kctl/%.c
1677c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gate%.ln: ../../kmdb/kctl/%.s
1707c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1717c478bd9Sstevel@tonic-gate
1727c478bd9Sstevel@tonic-gate%.ln: ../../mdb/%.c
1737c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate%.ln: %.c
1767c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gate%.ln: %.s
1797c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gate%.ln: kctl/%.s
1827c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
1837c478bd9Sstevel@tonic-gate
1847c478bd9Sstevel@tonic-gate%.ln: $(SRC)/common/net/util/%.c
1857c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
18669bb4bb4Scarlsonj
18769bb4bb4Scarlsonj%.ln: $(SRC)/common/util/%.c
18869bb4bb4Scarlsonj	$(LINT.c) -c $<
189