xref: /titanic_41/usr/src/cmd/sgs/packages/Makefile (revision 2dd2efa5a06a9befe46075cf41e16f57533c9f98)
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 2007 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#
70# Package dirs are directories which specifically
71# have a 'package' target.  This target is used to key
72# off of whether a system build is performed
73# or a SUNWonld build.
74#
75PKGDIRS=	../libcrle \
76		../libld \
77		../elfdump \
78		../elfedit \
79		../elfedit/modules \
80		../crle \
81		../dump \
82		../lari \
83		../ld \
84		../ldd \
85		../ldprof \
86		../nm \
87		../mcs \
88		../moe \
89		../pvs
90
91$(SUBDIRS1) $(SUBDIRS2) :=	TARGET = install
92$(PKGDIRS) :=	TARGET = package
93
94
95M32:sh=		if [ "$MACH" = "sparc" ]; \
96			then echo sparc; \
97		elif [ "$MACH" = "i386" ]; \
98			then echo "$(VAR_I386_ARCH)"; \
99		else \
100			echo "unknown"; \
101		fi
102
103../%:		FRC
104		@ cd $@; pwd; $(MAKE) $(TARGET)
105
106.KEEP_STATE_FILE: .make.state.$(MACH)
107.KEEP_STATE:
108.PARALLEL:	$(SUBDIRS1) $(PKGDIRS) $(SUBDIRS2)
109
110all clean clobber install: FRC
111		@ cd $(MACH); pwd; $(MAKE) $@
112
113#
114# invoke `package' to build this package from scratch.  It will
115# perform make install in the directories that contains components
116# that this package is dependent upon
117#
118package:	FRC
119	@/bin/time $(MAKE) package_build 2>&1 | tee $(BUILDLOG)
120	@ echo "===BUILD COMPLETED  checking for warnings...==="
121	@ grep -i "warning:" $(BUILDLOG) | grep -v PSTAMP | cat
122	@ echo "==================done========================="
123
124package_build:	package_dep .WAIT package_chkmsg .WAIT install
125
126package_chkmsg:	FRC
127		@ cd ..; pwd; $(MAKE) chkmsg
128
129package_dep:	package_dep_ .WAIT $(SUBDIRS1) .WAIT \
130	$(PKGDIRS) .WAIT $(SUBDIRS2)
131
132package_dep_:	FRC
133		@ cd ../tools; pwd; $(MAKE) proto && ./proto $(RELEASE)
134		@ cd $(SRC)/common/mapfiles/gen ; pwd; $(MAKE) install
135		@ cd $(SRC)/head; pwd; $(MAKE) \
136			$(ROOT)/usr/include/dlfcn.h \
137			$(ROOT)/usr/include/gelf.h \
138			$(ROOT)/usr/include/libelf.h \
139			$(ROOT)/usr/include/proc_service.h \
140			$(ROOT)/usr/include/rtld_db.h \
141			$(ROOT)/usr/include/link.h
142		@ cd $(SRC)/lib/libproc; pwd; $(MAKE) install_h
143		@ cd $(SRC)/uts/common/sys; pwd; $(MAKE) \
144			$(ROOT)/usr/include/sys/elf.h \
145			$(ROOT)/usr/include/sys/elf_386.h \
146			$(ROOT)/usr/include/sys/elf_SPARC.h \
147			$(ROOT)/usr/include/sys/elf_notes.h \
148			$(ROOT)/usr/include/sys/elf_amd64.h \
149			$(ROOT)/usr/include/sys/elftypes.h \
150			$(ROOT)/usr/include/sys/auxv.h \
151			$(ROOT)/usr/include/sys/auxv_SPARC.h \
152			$(ROOT)/usr/include/sys/auxv_386.h \
153			$(ROOT)/usr/include/sys/link.h \
154			$(ROOT)/usr/include/sys/note.h \
155			$(ROOT)/usr/include/sys/systeminfo.h
156		@ cd $(SRC)/uts/$(M32)/sys; pwd; $(MAKE) \
157			$(ROOT)/usr/include/sys/machelf.h
158		@ cd ../tools/$(MACH); pwd; $(MAKE) sgsmsg piglatin
159		@ cd ..; pwd; $(MAKE) _msg_sgsmsg
160		@ cd ..; pwd; $(MAKE) native-add
161		@ cd ../libconv; pwd; $(MAKE) all
162		@ cd ../link_audit; pwd; $(MAKE) package
163		@ cd ../messages/$(MACH); pwd; $(MAKE) test
164		@ cd ../sgsdemangler; pwd; $(MAKE) all
165
166lint: FRC
167	$(MAKE) -f Makefile.lint lint
168
169FRC:
170