xref: /titanic_41/usr/src/cmd/sgs/packages/Makefile (revision 82629e3015252bf18319ba3815c773df23e21436)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27include		$(SRC)/Makefile.master
28include		$(SRC)/cmd/sgs/Makefile.var
29
30BUILDLOG=	package_build.$(MACH).log
31
32MACHS:sh=	if [ "$MACH" = "sparc" ]; \
33		then echo "sparc sparcv9"; \
34		elif [ "$MACH" = "i386" ]; \
35		then echo "i386 amd64"; \
36		else echo "unknown"; \
37		fi
38
39RDBDIRS=	$(MACHS:%=../librtld_db/rdb_demo/%)
40LDMAKEDIRS=	$(MACHS:%=../libldmake/%)
41
42
43SUBDIRS1=	../libconv \
44		.WAIT \
45	 	../libdl \
46		.WAIT \
47		../libelf \
48		.WAIT \
49		../liblddbg \
50		../librtld_db \
51		.WAIT \
52		../librtld \
53		../libcrle
54
55SUBDIRS2 =	../rtld \
56		../rtld.4.x \
57		../libldstab \
58		../lari \
59		../ldprof \
60		../lddstub \
61		$(LDMAKEDIRS) \
62		../0@0 \
63		../tools \
64		$(RDBDIRS)
65
66
67#
68# Package dirs are directories which specifically
69# have a 'package' target.  This target is used to key
70# off of whether a system build is performed
71# or a SUNWonld build.
72#
73PKGDIRS=	../libcrle \
74		../libld \
75		../elfdump \
76		../elfedit \
77		../elfedit/modules \
78		../elfwrap \
79		../crle \
80		../dump \
81		../lari \
82		../ld \
83		../ldd \
84		../ldprof \
85		../nm \
86		../mcs \
87		../moe \
88		../pvs
89
90$(SUBDIRS1) $(SUBDIRS2) :=	TARGET = install
91$(PKGDIRS) :=	TARGET = package
92
93../%:		FRC
94		@ cd $@; pwd; $(MAKE) $(TARGET)
95
96.KEEP_STATE_FILE: .make.state.$(MACH)
97.KEEP_STATE:
98.PARALLEL:	$(SUBDIRS1) $(PKGDIRS) $(SUBDIRS2)
99
100all clean clobber install: FRC
101		@ cd $(MACH); pwd; $(MAKE) $@
102
103#
104# invoke `package' to build this package from scratch.  It will
105# perform make install in the directories that contains components
106# that this package is dependent upon
107#
108package:	FRC
109	@/bin/time $(MAKE) package_build 2>&1 | tee $(BUILDLOG)
110	@ echo "===BUILD COMPLETED  checking for warnings...==="
111	@ grep -i "warning:" $(BUILDLOG) | grep -v PSTAMP | cat
112	@ echo "==================done========================="
113
114package_build:	package_dep .WAIT package_chkmsg .WAIT install
115
116package_chkmsg:	FRC
117		@ cd ..; pwd; $(MAKE) chkmsg
118
119package_dep:	package_dep_ .WAIT $(SUBDIRS1) .WAIT \
120	$(PKGDIRS) .WAIT $(SUBDIRS2)
121
122package_dep_:	FRC
123		@ cd ../tools; pwd; $(MAKE) proto && ./proto $(RELEASE)
124		@ cd $(SRC)/common/mapfiles/gen ; pwd; $(MAKE) install
125		@ cd $(SRC)/head; pwd; $(MAKE) \
126			$(ROOT)/usr/include/dlfcn.h \
127			$(ROOT)/usr/include/gelf.h \
128			$(ROOT)/usr/include/libelf.h \
129			$(ROOT)/usr/include/proc_service.h \
130			$(ROOT)/usr/include/rtld_db.h \
131			$(ROOT)/usr/include/link.h
132		@ cd $(SRC)/lib/libproc; pwd; $(MAKE) install_h
133		@ cd $(SRC)/uts/common/sys; pwd; $(MAKE) \
134			$(ROOT)/usr/include/sys/elf.h \
135			$(ROOT)/usr/include/sys/elf_386.h \
136			$(ROOT)/usr/include/sys/elf_SPARC.h \
137			$(ROOT)/usr/include/sys/elf_notes.h \
138			$(ROOT)/usr/include/sys/elf_amd64.h \
139			$(ROOT)/usr/include/sys/elftypes.h \
140			$(ROOT)/usr/include/sys/auxv.h \
141			$(ROOT)/usr/include/sys/auxv_SPARC.h \
142			$(ROOT)/usr/include/sys/auxv_386.h \
143			$(ROOT)/usr/include/sys/avl.h \
144			$(ROOT)/usr/include/sys/link.h \
145			$(ROOT)/usr/include/sys/machelf.h \
146			$(ROOT)/usr/include/sys/note.h \
147			$(ROOT)/usr/include/sys/systeminfo.h
148		@ cd ../tools/$(MACH); pwd; $(MAKE) sgsmsg piglatin
149		@ cd ..; pwd; $(MAKE) _msg_sgsmsg
150		@ cd ..; pwd; $(MAKE) native-add
151		@ cd ../libconv; pwd; $(MAKE) all
152		@ cd ../link_audit; pwd; $(MAKE) package
153		@ cd ../messages/$(MACH); pwd; $(MAKE) test
154
155lint: FRC
156	$(MAKE) -f Makefile.lint lint
157
158FRC:
159