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