xref: /illumos-gate/usr/src/cmd/sgs/elfedit/modules/Makefile.targ (revision 64cfc8ed0c5da83f827c424588bfe709e3fb5a7a)
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$(SYM_LIB): $(SYM_PICS)
67		$(BUILD.SO) $(LLDFLAGS)
68		$(POST_PROCESS_SO)
69
70$(SYMINFO_LIB): $(SYMINFO_PICS)
71		$(BUILD.SO) $(LLDFLAGS)
72		$(POST_PROCESS_SO)
73
74
75$(ROOTELFEDITDIR):
76		$(INS.dir)
77
78$(ROOTELFEDITDIR64):
79		$(INS.dir)
80
81
82$(ROOTELFEDITDIR)/%: %
83		$(INS.file)
84
85$(ROOTELFEDITDIR64)/%: %
86		$(INS.file)
87
88
89../common/%.c:	%_msg.h
90
91%_msg.h %_msg.c:	$(SGSMSG) ../common/%.msg
92		$(SGSMSG) $(SGSMSGFLAGS) -l -h $@ -d $@ \
93			-m $(SGSMSGDIR)/elfedit_$* -n $*_msg $<
94
95# This rule causes the message catalog file to be created under
96# sgs/messages, but does not regenerate the C or header file for the module.
97$(SGSMSGDIR)/elfedit_%: $(SGSMSG) ../common/%.msg
98		$(SGSMSG) $(SGSMSGFLAGS) -l -m $(SGSMSGDIR)/elfedit_$* $<
99
100$(SGSMSG):
101		@ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog
102		@ pwd
103
104catalog:	$(SGSMSGDIR)/elfedit_cap \
105		$(SGSMSGDIR)/elfedit_dyn \
106		$(SGSMSGDIR)/elfedit_ehdr \
107		$(SGSMSGDIR)/elfedit_phdr \
108		$(SGSMSGDIR)/elfedit_shdr \
109		$(SGSMSGDIR)/elfedit_sym \
110		$(SGSMSGDIR)/elfedit_syminfo
111
112
113chkmsg:		$(SRCS)
114		sh $(CHKMSG) -m ../common/cap.msg ../common/cap.c
115		sh $(CHKMSG) -m ../common/dyn.msg ../common/dyn.c
116		sh $(CHKMSG) -m ../common/ehdr.msg ../common/ehdr.c
117		sh $(CHKMSG) -m ../common/phdr.msg ../common/phdr.c
118		sh $(CHKMSG) -m ../common/shdr.msg ../common/shdr.c
119		sh $(CHKMSG) -m ../common/sym.msg ../common/sym.c
120		sh $(CHKMSG) -m ../common/syminfo.msg ../common/syminfo.c
121
122lint:
123		@echo "\nLint of: cap.so"		 > $(LINTOUT)
124		@echo "========================"	>> $(LINTOUT)
125		$(LINT.c) ../common/cap.c 		>> $(LINTOUT) 2>&1
126		@echo "\nLint of: dyn.so"		>> $(LINTOUT)
127		@echo "========================"	>> $(LINTOUT)
128		$(LINT.c) ../common/dyn.c 		>> $(LINTOUT) 2>&1
129		@echo "\nLint of: ehdr.so"		>> $(LINTOUT)
130		@echo "========================"	>> $(LINTOUT)
131		$(LINT.c) ../common/ehdr.c 		>> $(LINTOUT) 2>&1
132		@echo "\nLint of: phdr.so"		>> $(LINTOUT)
133		@echo "========================"	>> $(LINTOUT)
134		$(LINT.c) ../common/phdr.c 		>> $(LINTOUT) 2>&1
135		@echo "\nLint of: shdr.so"		>> $(LINTOUT)
136		@echo "========================"	>> $(LINTOUT)
137		$(LINT.c) ../common/shdr.c 		>> $(LINTOUT) 2>&1
138		@echo "\nLint of: sym.so"		>> $(LINTOUT)
139		@echo "========================"	>> $(LINTOUT)
140		$(LINT.c) ../common/sym.c 		>> $(LINTOUT) 2>&1
141		@echo "\nLint of: syminfo.so"		>> $(LINTOUT)
142		@echo "========================"	>> $(LINTOUT)
143		$(LINT.c) ../common/syminfo.c 		>> $(LINTOUT) 2>&1
144
145include		$(SRC)/lib/Makefile.targ
146