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#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29objs/%.o \
30pics/%.o:	%.c
31		$(COMPILE.c) -o $@ $<
32		$(POST_PROCESS_O)
33
34objs/%64.o \
35pics/%64.o:	../common/%.c
36		$(COMPILE.c) -D_ELF64 -o $@ $<
37		$(POST_PROCESS_O)
38
39objs/%.o \
40pics/%.o:	../misc/%.c
41		$(COMPILE.c) -DELF -o $@ $<
42		$(POST_PROCESS_O)
43
44objs/%.o \
45pics/%.o:	../common/%.c
46		$(COMPILE.c) -o $@ $<
47		$(POST_PROCESS_O)
48
49all:		$(BLTSRCS) .WAIT $(LIBS) $(LIBLINKS)
50
51install:	all .WAIT $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
52		$(ROOTFS_LINTLIB64)
53
54lint:		$(LINTLIB) $(LINTOUT32) $(LINTOUT64) $(SGSLINTOUT)
55
56$(VAR_POUND_2)lint :=		LIBTHREADFLAG=-lthread
57
58.PARALLEL:	$(LINTOUT32) $(LINTOUT64)
59
60
61delete:
62		$(RM) $(DYNLIB)
63
64$(DYNLIB):	$(MAPFILES)
65
66$(LIBLINKS):
67		$(RM) $(LIBLINKS)
68		$(SYMLINK) $(DYNLIB) $(LIBLINKS)
69
70# include common library targets
71#
72include		$(SRC)/lib/Makefile.targ
73include		$(SRC)/cmd/sgs/Makefile.targ
74
75xlate.c:	../common/xlate.m4
76		$(M4) < ../common/xlate.m4 > xlate.c
77
78xlate64.c:	../common/xlate64.m4
79		$(M4) < ../common/xlate64.m4 > xlate64.c
80
81objs/msg.o \
82pics/msg.o:	msg.c
83
84objs/error.o \
85pics/error.o:	msg.h
86
87objs/ar.o \
88pics/ar.o:	msg.h
89
90objs/xlate.o \
91pics/xlate.o:	xlate.c
92
93
94# Derived source and header files (messaging).  Make sure that the sgsmsg
95# command is constructed - libelf might not be built with the whole sgs.
96
97catalog:	$(BLTMESG)
98
99chkmsg:		$(LIBSRCS)
100		sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS)
101
102$(BLTDEFS) + \
103$(BLTDATA):	$(SGSMSG) $(SGSMSGTARG)
104		$(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG)
105
106$(BLTMESG):	$(SGSMSG) $(SGSMSGALL) xlate.c xlate64.c
107		$(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL)
108
109$(SGSMSG):	FRC
110		@ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog
111		@ pwd
112
113#
114# 64-bit overrides
115#
116include ../../Makefile.sub.64
117
118FRC:
119