xref: /illumos-gate/usr/src/cmd/sgs/demo_rdb/Makefile (revision 689b9301078f0c35c7f198fcee8032a0d30eff3a)
1#
2# CDDL HEADER START
3#
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.
7#
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# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
22# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
23#
24
25include		$(SRC)/Makefile.master
26include		$(SRC)/cmd/sgs/Makefile.sub
27
28MACHDEMOFILES= \
29		i386/regs.c \
30		i386/m_utils.c \
31		i386/rdb_mach.h \
32		i386/Makefile \
33		amd64/regs.c \
34		amd64/rdb_mach.h \
35		amd64/Makefile \
36		sparc/regs.c \
37		sparc/m_utils.c \
38		sparc/rdb_mach.h \
39		sparc/Makefile \
40		sparcv9/regs.c \
41		sparcv9/m_utils.c \
42		sparcv9/rdb_mach.h \
43		sparcv9/Makefile
44
45DEMOFILES= \
46		00README \
47		Makefile.com \
48		Makefile.targ \
49		common/bpt.c \
50		common/dis.c \
51		common/disasm.c \
52		common/disasm.h \
53		common/main.c \
54		common/ps.c \
55		common/gram.y \
56		common/lex.l \
57		common/globals.c \
58		common/help.c \
59		common/utils.c \
60		common/maps.c \
61		common/syms.c \
62		common/callstack.c \
63		common/rdb.h \
64		common/rdb.man \
65		tests/breaks \
66		tests/loadmaps \
67		tests/object_padding_maps \
68		tests/plt_skip \
69		tests/steps \
70		tests/test-sparc-regs \
71		tests/simp.c \
72		tests/sub.c \
73		$(MACHDEMOFILES)
74
75ROOTDEMODIRBASE=	$(ROOT)/usr/demo/librtld_db
76
77ROOTDEMODIRS=	$(ROOTDEMODIRBASE) \
78		$(ROOTDEMODIRBASE)/common \
79		$(ROOTDEMODIRBASE)/tests \
80		$(ROOTDEMODIRBASE)/i386 \
81		$(ROOTDEMODIRBASE)/amd64 \
82		$(ROOTDEMODIRBASE)/sparc \
83		$(ROOTDEMODIRBASE)/sparcv9
84
85ROOTDEMOFILES=	$(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
86
87$(ROOTDEMODIRS) :=	DIRMODE =	755
88
89SED=		sed -e "/DEMO DELETE START/,/DEMO DELETE END/d"
90
91CLEANFILES=	*.demo */*.demo
92
93.KEEP_STATE:
94.PARALLEL:	$(ROOTDEMOFILES)
95
96all catalog chkmsg:
97
98install:	$(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES)
99
100clean clobber: FRC
101		$(RM) $(CLEANFILES)
102
103$(ROOTDEMODIRS):
104		$(INS.dir)
105
106$(ROOTDEMODIRBASE)/Makefile.%: Makefile.%.demo
107		$(INS.rename)
108
109$(ROOTDEMODIRBASE)/%/Makefile: %/Makefile.demo
110		$(INS.rename)
111
112Makefile.%.demo: Makefile.%
113		$(SED) < $< > $@
114
115%/Makefile.demo: %/Makefile
116		$(SED) < $< > $@
117
118$(ROOTDEMODIRBASE)/%: %
119		$(INS.file)
120
121$(ROOTDEMODIRBASE)/common/%:	common/%
122		$(INS.file)
123
124$(ROOTDEMODIRBASE)/tests/%:	tests/%
125		$(INS.file)
126
127$(ROOTDEMODIRBASE)/sparc/%:	sparc/%
128		$(INS.file)
129
130$(ROOTDEMODIRBASE)/sparcv9/%:	sparcv9/%
131		$(INS.file)
132
133$(ROOTDEMODIRBASE)/i386/%:	i386/%
134		$(INS.file)
135
136FRC:
137