xref: /titanic_51/usr/src/cmd/sgs/packages/Makefile (revision 113f42324b1acf3e5144da27ddbda36e338fbd07)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/sgs/packages/Makefile
29
30include		$(SRC)/Makefile.master
31include		$(SRC)/cmd/sgs/Makefile.var
32
33BUILDLOG=	package_build.$(MACH).log
34
35MACHS:sh=	if [ "$MACH" = "sparc" ]; \
36		then echo "sparc sparcv9"; \
37		elif [ "$MACH" = "i386" ]; \
38		then echo "i386 amd64"; \
39		else echo "unknown"; \
40		fi
41
42RDBDIRS=	$(MACHS:%=../librtld_db/rdb_demo/%)
43LDMAKEDIRS=	$(MACHS:%=../libldmake/%)
44
45
46SUBDIRS1=	../libconv \
47		.WAIT \
48	 	../libdl \
49		.WAIT \
50		../libelf \
51		.WAIT \
52		../liblddbg \
53		../librtld_db \
54		.WAIT \
55		../librtld \
56		../libcrle
57
58SUBDIRS2 =	../rtld \
59		../rtld.4.x \
60		../libldstab \
61		../lari \
62		../ldprof \
63		../lddstub \
64		$(LDMAKEDIRS) \
65		../0@0 \
66		../tools \
67		$(RDBDIRS)
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		../crle \
79		../lari \
80		../ld \
81		../ldd \
82		../ldprof \
83		../mcs \
84		../moe \
85		../pvs
86
87$(SUBDIRS1) $(SUBDIRS2) :=	TARGET = install
88$(PKGDIRS) :=	TARGET = package
89
90
91M32:sh=		if [ "$MACH" = "sparc" ]; \
92			then echo sparc; \
93		elif [ "$MACH" = "i386" ]; \
94			then echo "$(VAR_I386_ARCH)"; \
95		else \
96			echo "unknown"; \
97		fi
98
99../%:		FRC
100		@ cd $@; pwd; $(MAKE) $(TARGET)
101
102.KEEP_STATE_FILE: .make.state.$(MACH)
103.KEEP_STATE:
104.PARALLEL:	$(SUBDIRS1) $(PKGDIRS) $(SUBDIRS2)
105
106all clean clobber install: FRC
107		@ cd $(MACH); pwd; $(MAKE) $@
108
109#
110# invoke `package' to build this package from scratch.  It will
111# perform make install in the directories that contains components
112# that this package is dependent upon
113#
114package:	FRC
115	@/bin/time $(MAKE) package_build 2>&1 | tee $(BUILDLOG)
116	@ echo "===BUILD COMPLETED  checking for warnings...==="
117	@ grep -i "warning:" $(BUILDLOG) | grep -v PSTAMP | cat
118	@ echo "==================done========================="
119
120package_build:	package_dep .WAIT package_chkmsg .WAIT install
121
122package_chkmsg:	FRC
123		@ cd ..; pwd; $(MAKE) chkmsg
124
125package_dep:	package_dep_ .WAIT $(SUBDIRS1) .WAIT \
126	$(PKGDIRS) .WAIT $(SUBDIRS2)
127
128package_dep_:	FRC
129		@ cd ../tools; pwd; $(MAKE) proto && ./proto
130		@ cd $(SRC)/head; pwd; $(MAKE) \
131			$(ROOT)/usr/include/dlfcn.h \
132			$(ROOT)/usr/include/gelf.h \
133			$(ROOT)/usr/include/libelf.h \
134			$(ROOT)/usr/include/proc_service.h \
135			$(ROOT)/usr/include/rtld_db.h \
136			$(ROOT)/usr/include/link.h
137		@ cd $(SRC)/lib/libproc; pwd; $(MAKE) install_h
138$(VAR_SPEC_ON)	@ cd $(SRC)/head; pwd;	$(MAKE) \
139$(VAR_SPEC_ON)		$(ROOT)/usr/include/apptrace.h \
140$(VAR_SPEC_ON)		$(ROOT)/usr/include/apptrace_impl.h
141		@ cd $(SRC)/uts/common/sys; pwd; $(MAKE) \
142			$(ROOT)/usr/include/sys/elf.h \
143			$(ROOT)/usr/include/sys/elf_386.h \
144			$(ROOT)/usr/include/sys/elf_M32.h \
145			$(ROOT)/usr/include/sys/elf_SPARC.h \
146			$(ROOT)/usr/include/sys/elf_notes.h \
147			$(ROOT)/usr/include/sys/elf_amd64.h \
148			$(ROOT)/usr/include/sys/elftypes.h \
149			$(ROOT)/usr/include/sys/auxv.h \
150			$(ROOT)/usr/include/sys/auxv_SPARC.h \
151			$(ROOT)/usr/include/sys/auxv_386.h \
152			$(ROOT)/usr/include/sys/link.h \
153			$(ROOT)/usr/include/sys/note.h \
154			$(ROOT)/usr/include/sys/systeminfo.h
155$(VAR_SPEC_ON)	@ cd $(SRC)/uts/$(M32)/sys; pwd; $(MAKE) \
156			$(ROOT)/usr/include/sys/machelf.h
157$(VAR_SPEC_ON)	@ cd $(SRC)/lib/abi; pwd; $(MAKE) spec
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