Makefile.kmdb.targ revision 170832d350f27fb90dabe317d86a86e60410a569
17c478bdstevel@tonic-gate#
27c478bdstevel@tonic-gate# CDDL HEADER START
37c478bdstevel@tonic-gate#
47c478bdstevel@tonic-gate# The contents of this file are subject to the terms of the
5b272bdapetede# Common Development and Distribution License (the "License").
6b272bdapetede# You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate#
87c478bdstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate# See the License for the specific language governing permissions
117c478bdstevel@tonic-gate# and limitations under the License.
127c478bdstevel@tonic-gate#
137c478bdstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate#
197c478bdstevel@tonic-gate# CDDL HEADER END
207c478bdstevel@tonic-gate#
217c478bdstevel@tonic-gate#
2224da5b3rie# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bdstevel@tonic-gate# Use is subject to license terms.
247c478bdstevel@tonic-gate#
25170832dAlbert Lee
26170832dAlbert LeeROOTTERMINFO = $(ROOTSHLIB)/terminfo
277c478bdstevel@tonic-gate
287c478bdstevel@tonic-gate$(PROG).core: $(OBJS) $(KMDBLIBS) $(MAPFILE)
2924da5b3rie	$(LD) -r $(BREDUCE) $(ZNOVERSION) $(ZDEFS) -M$(MAPFILE) -o $@ $(OBJS) \
307c478bdstevel@tonic-gate	    $(KMDBLIBS)
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate$(PROG): $(PROG).core $(KCTLOBJS)
337c478bdstevel@tonic-gate	$(LD) -dy -r -o $@ $@.core -Nmisc/ctf $(KCTLOBJS)
347c478bdstevel@tonic-gate	$(CTFMERGE) -L VERSION -o $@ $(OBJS) $(KCTLOBJS)
357c478bdstevel@tonic-gate	$(KMDB_FPTEST)
367c478bdstevel@tonic-gate	$(SETDYNFLAG) -f DF_1_IGNMULDEF,DF_1_NOKSYMS $@
377c478bdstevel@tonic-gate
387c478bdstevel@tonic-gateclean.lint:
397c478bdstevel@tonic-gate	$(RM) $(ALLLINTFILES)
407c478bdstevel@tonic-gate
417c478bdstevel@tonic-gateclean:
427c478bdstevel@tonic-gate	$(RM) $(OBJS) $(KCTLOBJS) $(PROG).core $(MAPFILE)
43b272bdapetede	$(RM) $(MAPFILE_INTERMEDIATE)
447c478bdstevel@tonic-gate	$(RM) kmdb_terminfo.c kmdb_modlinktest.c kmdb_modlinktest.o
457c478bdstevel@tonic-gate	$(RM) kaif_off.h kmdb_context_off.h
467c478bdstevel@tonic-gate	$(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output
477c478bdstevel@tonic-gate
487c478bdstevel@tonic-gateclobber: clean clean.lint
497c478bdstevel@tonic-gate	$(RM) $(PROG)
507c478bdstevel@tonic-gate
517c478bdstevel@tonic-gatedmods:
527c478bdstevel@tonic-gate
537c478bdstevel@tonic-gate#
547c478bdstevel@tonic-gate# Specialized object construction
557c478bdstevel@tonic-gate#
567c478bdstevel@tonic-gatekmdb_terminfo.c: 	../../../common/mdb/mdb_termio.c \
57170832dAlbert Lee			../../../common/kmdb/kmdb_terminfo_skel.c \
58170832dAlbert Lee			$(ROOTTERMINFO)
59170832dAlbert Lee	TERMINFO=$(ROOTTERMINFO) $(TIGEN) -s \
60170832dAlbert Lee	    ../../../common/kmdb/kmdb_terminfo_skel.c \
617c478bdstevel@tonic-gate	    -t ../../../common/mdb/mdb_termio.c \
627c478bdstevel@tonic-gate	    $(SUPPORTED_TERMS) > $@
637c478bdstevel@tonic-gate
64b272bdapetede$(MAPFILE_INTERMEDIATE): $(MAPFILE_SOURCES) $(MAPFILE_TEMPLATE)
65b272bdapetede	$(HDR2MAP) -t $(MAPFILE_TEMPLATE) $(MAPFILE_SOURCES) >$@
66b272bdapetede
67b272bdapetede$(MAPFILE): $(MAPFILE_INTERMEDIATE)
68b272bdapetede	$(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$@
697c478bdstevel@tonic-gate
707c478bdstevel@tonic-gatemdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
717c478bdstevel@tonic-gate	$(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
727c478bdstevel@tonic-gate
737c478bdstevel@tonic-gatemdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
747c478bdstevel@tonic-gate	$(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
757c478bdstevel@tonic-gate	@$(MV) y.tab.h mdb_grammar.h
767c478bdstevel@tonic-gate	@$(MV) y.tab.c mdb_grammar.c
777c478bdstevel@tonic-gate
787c478bdstevel@tonic-gate#
797c478bdstevel@tonic-gate# These should really be combined into a dynamic rule, but there's a bug in
807c478bdstevel@tonic-gate# dmake that'll cause it to get confused about dependencies if we do.
817c478bdstevel@tonic-gate#
827c478bdstevel@tonic-gate
837c478bdstevel@tonic-gatekaif_off.h := CPPFLAGS += $(SACPPCFLAGS)
847c478bdstevel@tonic-gate
85b272bdapetedekmdb_modlinktest.c: $(MAPFILE_INTERMEDIATE)
86b272bdapetede	$(MAP2LINKTEST) <$(MAPFILE_INTERMEDIATE) >$@
87b272bdapetede	$(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$(MAPFILE)
887c478bdstevel@tonic-gate
897c478bdstevel@tonic-gate#
907c478bdstevel@tonic-gate# Dynamic rules for object construction
917c478bdstevel@tonic-gate#
927c478bdstevel@tonic-gate%.o: ../../../common/kmdb/%.c
937c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
947c478bdstevel@tonic-gate	$(CTFCONVERT_O)
957c478bdstevel@tonic-gate
967c478bdstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.c
977c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
987c478bdstevel@tonic-gate	$(CTFCONVERT_O)
997c478bdstevel@tonic-gate
1007c478bdstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.s
1017c478bdstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1027c478bdstevel@tonic-gate
1037c478bdstevel@tonic-gate%.o: ../../../common/mdb/%.c
1047c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1057c478bdstevel@tonic-gate	$(CTFCONVERT_O)
1067c478bdstevel@tonic-gate
1077c478bdstevel@tonic-gate%.o: ../../kmdb/%.c
1087c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1097c478bdstevel@tonic-gate	$(CTFCONVERT_O)
1107c478bdstevel@tonic-gate
1117c478bdstevel@tonic-gate%.o: ../../kmdb/%.s
1127c478bdstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1137c478bdstevel@tonic-gate
1147c478bdstevel@tonic-gate%.o: ../../kmdb/kctl/%.c
1157c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1167c478bdstevel@tonic-gate	$(CTFCONVERT_O)
1177c478bdstevel@tonic-gate
1187c478bdstevel@tonic-gate%.o: ../../kmdb/kctl/%.s
1197c478bdstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1207c478bdstevel@tonic-gate
1217c478bdstevel@tonic-gate%.o: ../../mdb/%.c
1227c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1237c478bdstevel@tonic-gate	$(CTFCONVERT_O)
1247c478bdstevel@tonic-gate
1257c478bdstevel@tonic-gate%.o: %.c
1267c478bdstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1277c478bdstevel@tonic-gate	$(CTFCONVERT_O)
1287c478bdstevel@tonic-gate
1297c478bdstevel@tonic-gate%.o: %.s
1307c478bdstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1317c478bdstevel@tonic-gate
1327c478bdstevel@tonic-gate%.o: kctl/%.s
1337c478bdstevel@tonic-gate	$(COMPILE.s) -o $@ $<
1347c478bdstevel@tonic-gate
1357c478bdstevel@tonic-gate%.o: $(SRC)/common/net/util/%.c
1367c478bdstevel@tonic-gate	$(COMPILE.c) $<
1377c478bdstevel@tonic-gate	$(CTFCONVERT_O)
1387c478bdstevel@tonic-gate
13969bb4bbcarlsonj%.o: $(SRC)/common/util/%.c
14069bb4bbcarlsonj	$(COMPILE.c) $<
14169bb4bbcarlsonj	$(CTFCONVERT_O)
14269bb4bbcarlsonj
1437c478bdstevel@tonic-gate#
1447c478bdstevel@tonic-gate# Lint
1457c478bdstevel@tonic-gate#
1467c478bdstevel@tonic-gate
1477c478bdstevel@tonic-gate%.ln: ../../../common/kmdb/%.c
1487c478bdstevel@tonic-gate	$(LINT.c) -c $<
1497c478bdstevel@tonic-gate
1507c478bdstevel@tonic-gate%.ln: ../../../common/kmdb/kctl/%.c
1517c478bdstevel@tonic-gate	$(LINT.c) -c $<
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gate%.ln: ../../../common/kmdb/kctl/%.s
1547c478bdstevel@tonic-gate	$(LINT.s) -c $<
1557c478bdstevel@tonic-gate
1567c478bdstevel@tonic-gate%.ln: ../../../common/mdb/%.c
1577c478bdstevel@tonic-gate	$(LINT.c) -c $<
1587c478bdstevel@tonic-gate
1597c478bdstevel@tonic-gate%.ln: ../../kmdb/%.c
1607c478bdstevel@tonic-gate	$(LINT.c) -c $<
1617c478bdstevel@tonic-gate
1627c478bdstevel@tonic-gate%.ln: ../../kmdb/%.s
1637c478bdstevel@tonic-gate	$(LINT.s) -c $<
1647c478bdstevel@tonic-gate
1657c478bdstevel@tonic-gate%.ln: ../../kmdb/kctl/%.c
1667c478bdstevel@tonic-gate	$(LINT.c) -c $<
1677c478bdstevel@tonic-gate
1687c478bdstevel@tonic-gate%.ln: ../../kmdb/kctl/%.s
1697c478bdstevel@tonic-gate	$(LINT.s) -c $<
1707c478bdstevel@tonic-gate
1717c478bdstevel@tonic-gate%.ln: ../../mdb/%.c
1727c478bdstevel@tonic-gate	$(LINT.c) -c $<
1737c478bdstevel@tonic-gate
1747c478bdstevel@tonic-gate%.ln: %.c
1757c478bdstevel@tonic-gate	$(LINT.c) -c $<
1767c478bdstevel@tonic-gate
1777c478bdstevel@tonic-gate%.ln: %.s
1787c478bdstevel@tonic-gate	$(LINT.s) -c $<
1797c478bdstevel@tonic-gate
1807c478bdstevel@tonic-gate%.ln: kctl/%.s
1817c478bdstevel@tonic-gate	$(LINT.s) -c $<
1827c478bdstevel@tonic-gate
1837c478bdstevel@tonic-gate%.ln: $(SRC)/common/net/util/%.c
1847c478bdstevel@tonic-gate	$(LINT.c) -c $<
18569bb4bbcarlsonj
18669bb4bbcarlsonj%.ln: $(SRC)/common/util/%.c
18769bb4bbcarlsonj	$(LINT.c) -c $<
188