xref: /illumos-gate/usr/src/cmd/sgs/elfedit/modules/Makefile.targ (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 2008 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
128
129LINT_HDR=	perl $(SGSTOOLS)/lint_hdr.pl
130
131lint:
132		$(LINT_HDR) "elfedit modules"		 > $(LINTOUT)
133		$(LINT_HDR) -s "cap.so"			>> $(LINTOUT)
134		$(LINT.c) ../common/cap.c 		2>&1 | tee -a $(LINTOUT)
135
136		$(LINT_HDR) -s "dyn.so"			>> $(LINTOUT)
137		$(LINT.c) ../common/dyn.c 		2>&1 | tee -a $(LINTOUT)
138
139		$(LINT_HDR) -s "ehdr.so"		>> $(LINTOUT)
140		$(LINT.c) ../common/ehdr.c 		2>&1 | tee -a $(LINTOUT)
141
142		$(LINT_HDR) -s "phdr.so"		>> $(LINTOUT)
143		$(LINT.c) ../common/phdr.c 		2>&1 | tee -a $(LINTOUT)
144
145		$(LINT_HDR) -s "shdr.so"		>> $(LINTOUT)
146		$(LINT.c) ../common/shdr.c 		2>&1 | tee -a $(LINTOUT)
147
148		$(LINT_HDR) -s "str.so"			>> $(LINTOUT)
149		$(LINT.c) ../common/str.c 		2>&1 | tee -a $(LINTOUT)
150
151		$(LINT_HDR) -s "sym.so"			>> $(LINTOUT)
152		$(LINT.c) ../common/sym.c 		2>&1 | tee -a $(LINTOUT)
153
154		$(LINT_HDR) -s "syminfo.so"		>> $(LINTOUT)
155		$(LINT.c) ../common/syminfo.c 		2>&1 | tee -a $(LINTOUT)
156
157include		$(SRC)/lib/Makefile.targ
158