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# 2506abc743SJohn Levon# Copyright 2019 Joyent, Inc. 2606abc743SJohn Levon# 27170832d3SAlbert Lee 28170832d3SAlbert LeeROOTTERMINFO = $(ROOTSHLIB)/terminfo 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate$(PROG).core: $(OBJS) $(KMDBLIBS) $(MAPFILE) 31*85f4cb87SRichard Lowe $(LD) -r $(BREDUCE) $(ZNOVERSION) $(ZDEFS) -Wl,-M$(MAPFILE) -o $@ $(OBJS) \ 327c478bd9Sstevel@tonic-gate $(KMDBLIBS) 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate$(PROG): $(PROG).core $(KCTLOBJS) 357c478bd9Sstevel@tonic-gate $(LD) -dy -r -o $@ $@.core -Nmisc/ctf $(KCTLOBJS) 3606abc743SJohn Levon $(CTFMERGE) -l "$(UTS_LABEL)" -o $@ $(OBJS) $(KCTLOBJS) 377c478bd9Sstevel@tonic-gate $(KMDB_FPTEST) 386ddb3373SRichard Lowe $(POST_PROCESS) 397c478bd9Sstevel@tonic-gate $(SETDYNFLAG) -f DF_1_IGNMULDEF,DF_1_NOKSYMS $@ 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 48*85f4cb87SRichard Loweclobber: clean 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# 5606abc743SJohn Levonkmdb_terminfo.c: ../../../common/mdb/mdb_termio.c \ 57170832d3SAlbert Lee ../../../common/kmdb/kmdb_terminfo_skel.c \ 58170832d3SAlbert Lee $(ROOTTERMINFO) 59170832d3SAlbert Lee TERMINFO=$(ROOTTERMINFO) $(TIGEN) -s \ 60170832d3SAlbert Lee ../../../common/kmdb/kmdb_terminfo_skel.c \ 617c478bd9Sstevel@tonic-gate -t ../../../common/mdb/mdb_termio.c \ 627c478bd9Sstevel@tonic-gate $(SUPPORTED_TERMS) > $@ 637c478bd9Sstevel@tonic-gate 64b272bda5Spetede$(MAPFILE_INTERMEDIATE): $(MAPFILE_SOURCES) $(MAPFILE_TEMPLATE) 65b272bda5Spetede $(HDR2MAP) -t $(MAPFILE_TEMPLATE) $(MAPFILE_SOURCES) >$@ 66b272bda5Spetede 67b272bda5Spetede$(MAPFILE): $(MAPFILE_INTERMEDIATE) 68b272bda5Spetede $(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$@ 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gatemdb_lex.c: ../../../common/mdb/mdb_lex.l mdb_grammar.h 717c478bd9Sstevel@tonic-gate $(LEX) $(LFLAGS) ../../../common/mdb/mdb_lex.l > $@ 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gatemdb_grammar.h mdb_grammar.c: ../../../common/mdb/mdb_grammar.y 747c478bd9Sstevel@tonic-gate $(YACC) $(YFLAGS) ../../../common/mdb/mdb_grammar.y 757c478bd9Sstevel@tonic-gate @$(MV) y.tab.h mdb_grammar.h 767c478bd9Sstevel@tonic-gate @$(MV) y.tab.c mdb_grammar.c 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate# 797c478bd9Sstevel@tonic-gate# These should really be combined into a dynamic rule, but there's a bug in 807c478bd9Sstevel@tonic-gate# dmake that'll cause it to get confused about dependencies if we do. 817c478bd9Sstevel@tonic-gate# 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gatekaif_off.h := CPPFLAGS += $(SACPPCFLAGS) 847c478bd9Sstevel@tonic-gate 85b272bda5Spetedekmdb_modlinktest.c: $(MAPFILE_INTERMEDIATE) 86b272bda5Spetede $(MAP2LINKTEST) <$(MAPFILE_INTERMEDIATE) >$@ 87b272bda5Spetede $(CPP) -P $(SACPPFLAGS) <$(MAPFILE_INTERMEDIATE) >$(MAPFILE) 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate# 907c478bd9Sstevel@tonic-gate# Dynamic rules for object construction 917c478bd9Sstevel@tonic-gate# 927c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/%.c 937c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 947c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.c 977c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 987c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate%.o: ../../../common/kmdb/kctl/%.s 1017c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $< 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate%.o: ../../../common/mdb/%.c 1047c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1057c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate%.o: ../../kmdb/%.c 1087c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1097c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gate%.o: ../../kmdb/%.s 1127c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $< 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate%.o: ../../kmdb/kctl/%.c 1157c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1167c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate%.o: ../../kmdb/kctl/%.s 1197c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $< 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate%.o: ../../mdb/%.c 1227c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1237c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate%.o: %.c 1267c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1277c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate%.o: %.s 1307c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $< 1317c478bd9Sstevel@tonic-gate 1327c478bd9Sstevel@tonic-gate%.o: kctl/%.s 1337c478bd9Sstevel@tonic-gate $(COMPILE.s) -o $@ $< 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate%.o: $(SRC)/common/net/util/%.c 1367c478bd9Sstevel@tonic-gate $(COMPILE.c) $< 1377c478bd9Sstevel@tonic-gate $(CTFCONVERT_O) 1387c478bd9Sstevel@tonic-gate 13969bb4bb4Scarlsonj%.o: $(SRC)/common/util/%.c 14069bb4bb4Scarlsonj $(COMPILE.c) $< 14169bb4bb4Scarlsonj $(CTFCONVERT_O) 142