xref: /titanic_41/usr/src/cmd/sgs/packages/Makefile (revision 6a634c9dca3093f3922e4b7ab826d7bdf17bf78e)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
55aefb655Srie# Common Development and Distribution License (the "License").
65aefb655Srie# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
215aefb655Srie
225aefb655Srie#
23ba7866cdSAli Bahrami# Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gateinclude		$(SRC)/Makefile.master
277c478bd9Sstevel@tonic-gateinclude		$(SRC)/cmd/sgs/Makefile.var
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateBUILDLOG=	package_build.$(MACH).log
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateMACHS:sh=	if [ "$MACH" = "sparc" ]; \
327c478bd9Sstevel@tonic-gate		then echo "sparc sparcv9"; \
337c478bd9Sstevel@tonic-gate		elif [ "$MACH" = "i386" ]; \
347c478bd9Sstevel@tonic-gate		then echo "i386 amd64"; \
357c478bd9Sstevel@tonic-gate		else echo "unknown"; \
367c478bd9Sstevel@tonic-gate		fi
377c478bd9Sstevel@tonic-gate
38*20c1c355SRod EvansRDBDIRS=	$(MACHS:%=../librtld_db/demo/%)
397c478bd9Sstevel@tonic-gateLDMAKEDIRS=	$(MACHS:%=../libldmake/%)
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateSUBDIRS1=	../libconv \
427c478bd9Sstevel@tonic-gate		.WAIT \
437c478bd9Sstevel@tonic-gate	 	../libdl \
447c478bd9Sstevel@tonic-gate		.WAIT \
457c478bd9Sstevel@tonic-gate		../libelf \
467c478bd9Sstevel@tonic-gate		.WAIT \
477c478bd9Sstevel@tonic-gate		../liblddbg \
487c478bd9Sstevel@tonic-gate		../librtld_db \
497c478bd9Sstevel@tonic-gate		.WAIT \
507c478bd9Sstevel@tonic-gate		../librtld \
517c478bd9Sstevel@tonic-gate		../libcrle
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateSUBDIRS2 =	../rtld \
547c478bd9Sstevel@tonic-gate		../rtld.4.x \
557c478bd9Sstevel@tonic-gate		../libldstab \
567c478bd9Sstevel@tonic-gate		../lari \
577c478bd9Sstevel@tonic-gate		../ldprof \
587c478bd9Sstevel@tonic-gate		../lddstub \
597c478bd9Sstevel@tonic-gate		$(LDMAKEDIRS) \
607c478bd9Sstevel@tonic-gate		../0@0 \
617c478bd9Sstevel@tonic-gate		../tools \
627c478bd9Sstevel@tonic-gate		$(RDBDIRS)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate#
657c478bd9Sstevel@tonic-gate# Package dirs are directories which specifically
667c478bd9Sstevel@tonic-gate# have a 'package' target.  This target is used to key
677c478bd9Sstevel@tonic-gate# off of whether a system build is performed
687c478bd9Sstevel@tonic-gate# or a SUNWonld build.
697c478bd9Sstevel@tonic-gate#
707c478bd9Sstevel@tonic-gatePKGDIRS=	../libcrle \
717c478bd9Sstevel@tonic-gate		../libld \
727c478bd9Sstevel@tonic-gate		../elfdump \
73d29b2c44Sab196087		../elfedit \
74d29b2c44Sab196087		../elfedit/modules \
752722387fSrie		../elfwrap \
76ba7866cdSAli Bahrami		../ar \
777c478bd9Sstevel@tonic-gate		../crle \
78ba4e3c84Sab196087		../dump \
797c478bd9Sstevel@tonic-gate		../lari \
807c478bd9Sstevel@tonic-gate		../ld \
817c478bd9Sstevel@tonic-gate		../ldd \
827c478bd9Sstevel@tonic-gate		../ldprof \
83ba4e3c84Sab196087		../nm \
847c478bd9Sstevel@tonic-gate		../mcs \
857c478bd9Sstevel@tonic-gate		../moe \
86d29b2c44Sab196087		../pvs
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gate$(SUBDIRS1) $(SUBDIRS2) :=	TARGET = install
897c478bd9Sstevel@tonic-gate$(PKGDIRS) :=	TARGET = package
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gate../%:		FRC
927c478bd9Sstevel@tonic-gate		@ cd $@; pwd; $(MAKE) $(TARGET)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate.KEEP_STATE_FILE: .make.state.$(MACH)
957c478bd9Sstevel@tonic-gate.KEEP_STATE:
967c478bd9Sstevel@tonic-gate.PARALLEL:	$(SUBDIRS1) $(PKGDIRS) $(SUBDIRS2)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gateall clean clobber install: FRC
997c478bd9Sstevel@tonic-gate		@ cd $(MACH); pwd; $(MAKE) $@
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate#
1027c478bd9Sstevel@tonic-gate# invoke `package' to build this package from scratch.  It will
1037c478bd9Sstevel@tonic-gate# perform make install in the directories that contains components
1047c478bd9Sstevel@tonic-gate# that this package is dependent upon
1057c478bd9Sstevel@tonic-gate#
1067c478bd9Sstevel@tonic-gatepackage:	FRC
1077c478bd9Sstevel@tonic-gate	@/bin/time $(MAKE) package_build 2>&1 | tee $(BUILDLOG)
1087c478bd9Sstevel@tonic-gate	@ echo "===BUILD COMPLETED  checking for warnings...==="
1097c478bd9Sstevel@tonic-gate	@ grep -i "warning:" $(BUILDLOG) | grep -v PSTAMP | cat
1107c478bd9Sstevel@tonic-gate	@ echo "==================done========================="
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gatepackage_build:	package_dep .WAIT package_chkmsg .WAIT install
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gatepackage_chkmsg:	FRC
1157c478bd9Sstevel@tonic-gate		@ cd ..; pwd; $(MAKE) chkmsg
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gatepackage_dep:	package_dep_ .WAIT $(SUBDIRS1) .WAIT \
1187c478bd9Sstevel@tonic-gate	$(PKGDIRS) .WAIT $(SUBDIRS2)
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gatepackage_dep_:	FRC
12146d4d531Srie		@ cd ../tools; pwd; $(MAKE) proto && ./proto $(RELEASE)
12224da5b34Srie		@ cd $(SRC)/common/mapfiles/gen ; pwd; $(MAKE) install
1237c478bd9Sstevel@tonic-gate		@ cd $(SRC)/head; pwd; $(MAKE) \
1247c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/dlfcn.h \
1257c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/gelf.h \
1267c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/libelf.h \
1277c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/proc_service.h \
1287c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/rtld_db.h \
1297c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/link.h
1307c478bd9Sstevel@tonic-gate		@ cd $(SRC)/lib/libproc; pwd; $(MAKE) install_h
1317c478bd9Sstevel@tonic-gate		@ cd $(SRC)/uts/common/sys; pwd; $(MAKE) \
1327c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/elf.h \
1337c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/elf_386.h \
1347c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/elf_SPARC.h \
1357c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/elf_notes.h \
1367c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/elf_amd64.h \
1377c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/elftypes.h \
1387c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/auxv.h \
1397c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/auxv_SPARC.h \
1407c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/auxv_386.h \
1419ac6ca4dSRod Evans			$(ROOT)/usr/include/sys/avl.h \
1427c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/link.h \
143ba2be530Sab196087			$(ROOT)/usr/include/sys/machelf.h \
1447c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/note.h \
1457c478bd9Sstevel@tonic-gate			$(ROOT)/usr/include/sys/systeminfo.h
1467c478bd9Sstevel@tonic-gate		@ cd ../tools/$(MACH); pwd; $(MAKE) sgsmsg piglatin
1477c478bd9Sstevel@tonic-gate		@ cd ..; pwd; $(MAKE) _msg_sgsmsg
1487c478bd9Sstevel@tonic-gate		@ cd ..; pwd; $(MAKE) native-add
1497c478bd9Sstevel@tonic-gate		@ cd ../libconv; pwd; $(MAKE) all
1507c478bd9Sstevel@tonic-gate		@ cd ../link_audit; pwd; $(MAKE) package
1517c478bd9Sstevel@tonic-gate		@ cd ../messages/$(MACH); pwd; $(MAKE) test
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gatelint: FRC
1547c478bd9Sstevel@tonic-gate	$(MAKE) -f Makefile.lint lint
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gateFRC:
157