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