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.
12 #
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]
18 #
19 # CDDL HEADER END
20 #
21 #
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright (c) 2013 by Delphix. All rights reserved.
26 # Copyright (c) 2019 Carlos Neira <cneirabustos@gmail.com>
27 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
28 # Copyright (c) 2019, Joyent, Inc.
29 #
30
31 .KEEP_STATE:
32 .SUFFIXES:
33
34 include $(SRC)/cmd/mdb/Makefile.tools
35
36 #
37 # Make sure we're getting a consistent execution environment for the
38 # embedded scripts.
39 #
40 SHELL= /usr/bin/ksh93
41
42 $(KMOD_SOURCES_DIFFERENT)KMODSRCS = $(MODSRCS)
43 $(KMOD_SOURCES_DIFFERENT)KMODASMSRCS = $(MODASMSRCS)
44
45 MODOBJS = $(MODSRCS:%.c=dmod/%.o) $(MODASMSRCS:%.s=dmod/%.o)
46 KMODOBJS = $(KMODSRCS:%.c=kmod/%.o) $(KMODASMSRCS:%.s=kmod/%.o)
47
48 MODNAME_cmd = if [ -n "$(MODULE_NAME)" ]; then print $(MODULE_NAME); else print $(MODULE)| sed -e 's:\.so$$::'; fi
194 LINKTESTOBJ = $(KMDBDIR)/kmdb_modlinktest.o
195
196 KMDB_LINKTEST = \
197 $(LD) $(ZDEFS) -dy -r -o $@.linktest $(KMODOBJS) \
198 $(STANDOBJS) $(LINKTESTOBJ) && \
199 $(RM) $@.linktest
200
201 KMDB_LINKTEST_ENABLE=$(POUND_SIGN)
202 $(KMDB_LINKTEST_ENABLE)KMDB_LINKTEST_CMD = $(KMDB_LINKTEST)
203
204 #
205 # Ensure that dmods don't use floating point
206 #
207 KMDB_FPTEST_CMD = $(KMDB_FPTEST)
208
209 $(KMODFILE): kmod .WAIT $(KMODOBJS) $(MAPFILE)
210 $(LD) -dy -r $(MAPFILE:%=-M%) -Nmisc/kmdbmod -o $@ $(KMODOBJS) \
211 $(STANDOBJS)
212 $(KMDB_LINKTEST_CMD)
213 $(KMDB_FPTEST_CMD)
214 $(CTFMERGE) -f -L VERSION -o $@ $(KMODOBJS)
215 $(POST_PROCESS)
216 $(SETDYNFLAG) -f DF_1_NOKSYMS $@
217
218 linktest: linktest_check .WAIT kmod .WAIT $(KMODOBJS)
219 $(KMDB_LINKTEST)
220
221 linktest_check:
222 @if [ "$(MDBTGT)" != "kvm" ] ; then \
223 echo "ERROR: linktest is not supported non-kvm/disasm dmods" \
224 >&2 ; \
225 exit 1 ; \
226 fi
227
228 #
229 # Dynamic rules for object construction
230 #
231 dmod/%.o kmod/%.o: %.c
232 $(COMPILE.c) -o $@ $<
233 $(CTFCONVERT_O)
234
|
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.
12 #
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]
18 #
19 # CDDL HEADER END
20 #
21 #
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright (c) 2013 by Delphix. All rights reserved.
26 # Copyright (c) 2019 Carlos Neira <cneirabustos@gmail.com>
27 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
28 # Copyright 2019 Joyent, Inc.
29 #
30
31 .KEEP_STATE:
32 .SUFFIXES:
33
34 include $(SRC)/cmd/mdb/Makefile.tools
35
36 #
37 # Make sure we're getting a consistent execution environment for the
38 # embedded scripts.
39 #
40 SHELL= /usr/bin/ksh93
41
42 $(KMOD_SOURCES_DIFFERENT)KMODSRCS = $(MODSRCS)
43 $(KMOD_SOURCES_DIFFERENT)KMODASMSRCS = $(MODASMSRCS)
44
45 MODOBJS = $(MODSRCS:%.c=dmod/%.o) $(MODASMSRCS:%.s=dmod/%.o)
46 KMODOBJS = $(KMODSRCS:%.c=kmod/%.o) $(KMODASMSRCS:%.s=kmod/%.o)
47
48 MODNAME_cmd = if [ -n "$(MODULE_NAME)" ]; then print $(MODULE_NAME); else print $(MODULE)| sed -e 's:\.so$$::'; fi
194 LINKTESTOBJ = $(KMDBDIR)/kmdb_modlinktest.o
195
196 KMDB_LINKTEST = \
197 $(LD) $(ZDEFS) -dy -r -o $@.linktest $(KMODOBJS) \
198 $(STANDOBJS) $(LINKTESTOBJ) && \
199 $(RM) $@.linktest
200
201 KMDB_LINKTEST_ENABLE=$(POUND_SIGN)
202 $(KMDB_LINKTEST_ENABLE)KMDB_LINKTEST_CMD = $(KMDB_LINKTEST)
203
204 #
205 # Ensure that dmods don't use floating point
206 #
207 KMDB_FPTEST_CMD = $(KMDB_FPTEST)
208
209 $(KMODFILE): kmod .WAIT $(KMODOBJS) $(MAPFILE)
210 $(LD) -dy -r $(MAPFILE:%=-M%) -Nmisc/kmdbmod -o $@ $(KMODOBJS) \
211 $(STANDOBJS)
212 $(KMDB_LINKTEST_CMD)
213 $(KMDB_FPTEST_CMD)
214 $(CTFMERGE) -l "$(UTS_LABEL)" -o $@ $(KMODOBJS)
215 $(POST_PROCESS)
216 $(SETDYNFLAG) -f DF_1_NOKSYMS $@
217
218 linktest: linktest_check .WAIT kmod .WAIT $(KMODOBJS)
219 $(KMDB_LINKTEST)
220
221 linktest_check:
222 @if [ "$(MDBTGT)" != "kvm" ] ; then \
223 echo "ERROR: linktest is not supported non-kvm/disasm dmods" \
224 >&2 ; \
225 exit 1 ; \
226 fi
227
228 #
229 # Dynamic rules for object construction
230 #
231 dmod/%.o kmod/%.o: %.c
232 $(COMPILE.c) -o $@ $<
233 $(CTFCONVERT_O)
234
|