4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
22 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
26 ROOTTERMINFO = $(ROOTSHLIB)/terminfo
28 $(PROG).core: $(OBJS) $(KMDBLIBS) $(MAPFILE)
29 $(LD) -r $(BREDUCE) $(ZNOVERSION) $(ZDEFS) -M$(MAPFILE) -o $@ $(OBJS) \
32 $(PROG): $(PROG).core $(KCTLOBJS)
33 $(LD) -dy -r -o $@ $@.core -Nmisc/ctf $(KCTLOBJS)
34 $(CTFMERGE) -L VERSION -o $@ $(OBJS) $(KCTLOBJS)
37 $(SETDYNFLAG) -f DF_1_IGNMULDEF,DF_1_NOKSYMS $@
43 $(RM) $(OBJS) $(KCTLOBJS) $(PROG).core $(MAPFILE)
44 $(RM) $(MAPFILE_INTERMEDIATE)
45 $(RM) kmdb_terminfo.c kmdb_modlinktest.c kmdb_modlinktest.o
46 $(RM) kaif_off.h kmdb_context_off.h
47 $(RM) mdb_lex.c mdb_grammar.c mdb_grammar.h y.tab.h y.tab.c y.output
49 clobber: clean clean.lint
55 # Specialized object construction
57 kmdb_terminfo.c: ../../../common/mdb/mdb_termio.c \
58 ../../../common/kmdb/kmdb_terminfo_skel.c \
60 TERMINFO=$(ROOTTERMINFO) $(TIGEN) -s \
61 ../../../common/kmdb/kmdb_terminfo_skel.c \
62 -t ../../../common/mdb/mdb_termio.c \
63 $(SUPPORTED_TERMS) > $@
65 $(MAPFILE_INTERMEDIATE): $(MAPFILE_SOURCES) $(MAPFILE_TEMPLATE)
66 $(HDR2MAP) -t $(MAPFILE_TEMPLATE) $(MAPFILE_SOURCES) >$@
68 $(MAPFILE): $(MAPFILE_INTERMEDIATE)
69 $(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$@
71 mdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h
72 $(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@
74 mdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y
75 $(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y
76 @$(MV) y.tab.h mdb_grammar.h
77 @$(MV) y.tab.c mdb_grammar.c
80 # These should really be combined into a dynamic rule, but there's a bug in
81 # dmake that'll cause it to get confused about dependencies if we do.
84 kaif_off.h := CPPFLAGS += $(SACPPCFLAGS)
86 kmdb_modlinktest.c: $(MAPFILE_INTERMEDIATE)
87 $(MAP2LINKTEST) <$(MAPFILE_INTERMEDIATE) >$@
88 $(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$(MAPFILE)
91 # Dynamic rules for object construction
93 %.o: ../../../common/kmdb/%.c
97 %.o: ../../../common/kmdb/kctl/%.c
101 %.o: ../../../common/kmdb/kctl/%.s
102 $(COMPILE.s) -o $@ $<
104 %.o: ../../../common/mdb/%.c
105 $(COMPILE.c) -o $@ $<
109 $(COMPILE.c) -o $@ $<
113 $(COMPILE.s) -o $@ $<
115 %.o: ../../kmdb/kctl/%.c
116 $(COMPILE.c) -o $@ $<
119 %.o: ../../kmdb/kctl/%.s
120 $(COMPILE.s) -o $@ $<
123 $(COMPILE.c) -o $@ $<
127 $(COMPILE.c) -o $@ $<
131 $(COMPILE.s) -o $@ $<
134 $(COMPILE.s) -o $@ $<
136 %.o: $(SRC)/common/net/util/%.c
140 %.o: $(SRC)/common/util/%.c
148 %.ln: ../../../common/kmdb/%.c
151 %.ln: ../../../common/kmdb/kctl/%.c
154 %.ln: ../../../common/kmdb/kctl/%.s
157 %.ln: ../../../common/mdb/%.c
166 %.ln: ../../kmdb/kctl/%.c
169 %.ln: ../../kmdb/kctl/%.s
184 %.ln: $(SRC)/common/net/util/%.c
187 %.ln: $(SRC)/common/util/%.c