xref: /illumos-gate/usr/src/cmd/sgs/libelf/Makefile.targ (revision 03270635d68df6a0392fb8f4b7c04acad764648b)
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 (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2016 RackTop Systems.
24#
25
26objs/%.o \
27pics/%.o:	%.c
28		$(COMPILE.c) -o $@ $<
29		$(POST_PROCESS_O)
30
31objs/%64.o \
32pics/%64.o:	../common/%.c
33		$(COMPILE.c) -D_ELF64 -o $@ $<
34		$(POST_PROCESS_O)
35
36objs/%.o \
37pics/%.o:	../misc/%.c
38		$(COMPILE.c) -DELF -o $@ $<
39		$(POST_PROCESS_O)
40
41objs/%.o \
42pics/%.o:	../common/%.c
43		$(COMPILE.c) -o $@ $<
44		$(POST_PROCESS_O)
45
46all:		$(BLTSRCS) .WAIT $(LIBS) $(LIBLINKS)
47
48install:	all .WAIT $(ROOTFS_LIBS) $(ROOTFS_LINKS) \
49		$(ROOTFS_LINTLIB) \
50		.WAIT $(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES) \
51		$(ROOTFS_LIBDIR)/$(LINTLIBSRC)
52
53$(ROOTFS_LIBDIR)/$(LINTLIBSRC): ../common/$(LINTLIBSRC)
54		$(VAR_POUND_1)  $(INS.file) ../common/$(LINTLIBSRC)
55
56lint:		$(LINTLIB) $(LINTOUT32) $(LINTOUT64) $(SGSLINTOUT)
57
58.PARALLEL:	$(LINTOUT32) $(LINTOUT64)
59
60delete:
61		$(RM) $(DYNLIB)
62
63$(LIBLINKS):
64		$(RM) $(LIBLINKS)
65		$(SYMLINK) $(DYNLIB) $(LIBLINKS)
66
67CLOBBERFILES += $(LIBLINKS)
68
69# include common library targets
70#
71include		$(SRC)/lib/Makefile.targ
72include		$(SRC)/cmd/sgs/Makefile.targ
73
74xlate.c:	../common/xlate.m4
75		$(M4) < ../common/xlate.m4 > xlate.c
76
77xlate64.c:	../common/xlate64.m4
78		$(M4) < ../common/xlate64.m4 > xlate64.c
79
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# Special target for native builds (ie. when we need to build a version of ld
94# to build a version of ld :-).
95
96native:		$(SGSLIBDIR)/$(LIBLINKS)
97
98$(PICS):	pics
99
100$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR)
101		$(BUILD.SO)
102		$(POST_PROCESS_SO)
103
104$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
105		-@$(RM) $(SGSLIBDIR)/$(LIBLINKS)
106		$(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
107
108
109# Derived source and header files (messaging).  Make sure that the sgsmsg
110# command is constructed - libelf might not be built with the whole sgs.
111
112catalog:	$(BLTMESG)
113
114chkmsg:		$(LIBSRCS)
115		sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS)
116
117$(BLTDEFS) + \
118$(BLTDATA):	$(SGSMSG) $(SGSMSGTARG)
119		$(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG)
120
121$(BLTMESG):	$(SGSMSG) $(SGSMSGALL) xlate.c xlate64.c
122		$(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL)
123
124$(SGSMSG):	FRC
125		@ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog
126		@ pwd
127
128FRC:
129