xref: /titanic_51/usr/src/cmd/sgs/elfedit/modules/Makefile.targ (revision ac19272f7eb4a433cfccf2fdccc769cca5528169)
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#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28
29$(PICDIR)/%.o:	%.c
30		$(COMPILE.c) $< -o $@
31		$(POST_PROCESS_O)
32
33$(PICDIR)/%.o:	../common/%.c
34		$(COMPILE.c) $< -o $@
35		$(POST_PROCESS_O)
36
37$(PICDIR)/%32.o:	../common/%.c
38		$(COMPILE.c) $< -o $@
39		$(POST_PROCESS_O)
40
41$(PICDIR)/%64.o:	../common/%.c
42		$(COMPILE.c) -D_ELF64 $< -o $@
43		$(POST_PROCESS_O)
44
45
46$(CAP_LIB): $(CAP_PICS)
47		$(BUILD.SO) $(LLDFLAGS)
48		$(POST_PROCESS_SO)
49
50$(DYN_LIB): $(DYN_PICS)
51		$(BUILD.SO) $(LLDFLAGS)
52		$(POST_PROCESS_SO)
53
54$(EHDR_LIB): $(EHDR_PICS)
55		$(BUILD.SO) $(LLDFLAGS)
56		$(POST_PROCESS_SO)
57
58$(PHDR_LIB): $(PHDR_PICS)
59		$(BUILD.SO) $(LLDFLAGS)
60		$(POST_PROCESS_SO)
61
62$(SHDR_LIB): $(SHDR_PICS)
63		$(BUILD.SO) $(LLDFLAGS)
64		$(POST_PROCESS_SO)
65
66$(STR_LIB): $(STR_PICS)
67		$(BUILD.SO) $(LLDFLAGS)
68		$(POST_PROCESS_SO)
69
70$(SYM_LIB): $(SYM_PICS)
71		$(BUILD.SO) $(LLDFLAGS)
72		$(POST_PROCESS_SO)
73
74$(SYMINFO_LIB): $(SYMINFO_PICS)
75		$(BUILD.SO) $(LLDFLAGS)
76		$(POST_PROCESS_SO)
77
78
79$(ROOTELFEDITDIR):
80		$(INS.dir)
81
82$(ROOTELFEDITDIR64):
83		$(INS.dir)
84
85
86$(ROOTELFEDITDIR)/%: %
87		$(INS.file)
88
89$(ROOTELFEDITDIR64)/%: %
90		$(INS.file)
91
92
93../common/%.c:	%_msg.h
94
95%_msg.h %_msg.c:	$(SGSMSG) ../common/%.msg
96		$(SGSMSG) $(SGSMSGFLAGS) -l -h $@ -d $@ \
97			-m $(SGSMSGDIR)/elfedit_$* -n $*_msg $<
98
99# This rule causes the message catalog file to be created under
100# sgs/messages, but does not regenerate the C or header file for the module.
101$(SGSMSGDIR)/elfedit_%: $(SGSMSG) ../common/%.msg
102		$(SGSMSG) $(SGSMSGFLAGS) -l -m $(SGSMSGDIR)/elfedit_$* $<
103
104$(SGSMSG):
105		@ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog
106		@ pwd
107
108catalog:	$(SGSMSGDIR)/elfedit_cap \
109		$(SGSMSGDIR)/elfedit_dyn \
110		$(SGSMSGDIR)/elfedit_ehdr \
111		$(SGSMSGDIR)/elfedit_phdr \
112		$(SGSMSGDIR)/elfedit_shdr \
113		$(SGSMSGDIR)/elfedit_str \
114		$(SGSMSGDIR)/elfedit_sym \
115		$(SGSMSGDIR)/elfedit_syminfo
116
117
118chkmsg:		$(SRCS)
119		sh $(CHKMSG) -m ../common/cap.msg ../common/cap.c
120		sh $(CHKMSG) -m ../common/dyn.msg ../common/dyn.c
121		sh $(CHKMSG) -m ../common/ehdr.msg ../common/ehdr.c
122		sh $(CHKMSG) -m ../common/phdr.msg ../common/phdr.c
123		sh $(CHKMSG) -m ../common/shdr.msg ../common/shdr.c
124		sh $(CHKMSG) -m ../common/str.msg ../common/str.c
125		sh $(CHKMSG) -m ../common/sym.msg ../common/sym.c
126		sh $(CHKMSG) -m ../common/syminfo.msg ../common/syminfo.c
127
128lint:
129		@echo "\nLint of: cap.so"		 > $(LINTOUT)
130		@echo "========================"	>> $(LINTOUT)
131		$(LINT.c) ../common/cap.c 		>> $(LINTOUT) 2>&1
132		@echo "\nLint of: dyn.so"		>> $(LINTOUT)
133		@echo "========================"	>> $(LINTOUT)
134		$(LINT.c) ../common/dyn.c 		>> $(LINTOUT) 2>&1
135		@echo "\nLint of: ehdr.so"		>> $(LINTOUT)
136		@echo "========================"	>> $(LINTOUT)
137		$(LINT.c) ../common/ehdr.c 		>> $(LINTOUT) 2>&1
138		@echo "\nLint of: phdr.so"		>> $(LINTOUT)
139		@echo "========================"	>> $(LINTOUT)
140		$(LINT.c) ../common/phdr.c 		>> $(LINTOUT) 2>&1
141		@echo "\nLint of: shdr.so"		>> $(LINTOUT)
142		@echo "========================"	>> $(LINTOUT)
143		$(LINT.c) ../common/shdr.c 		>> $(LINTOUT) 2>&1
144		@echo "\nLint of: str.so"		>> $(LINTOUT)
145		@echo "========================"	>> $(LINTOUT)
146		$(LINT.c) ../common/str.c 		>> $(LINTOUT) 2>&1
147		@echo "\nLint of: sym.so"		>> $(LINTOUT)
148		@echo "========================"	>> $(LINTOUT)
149		$(LINT.c) ../common/sym.c 		>> $(LINTOUT) 2>&1
150		@echo "\nLint of: syminfo.so"		>> $(LINTOUT)
151		@echo "========================"	>> $(LINTOUT)
152		$(LINT.c) ../common/syminfo.c 		>> $(LINTOUT) 2>&1
153
154include		$(SRC)/lib/Makefile.targ
155