# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. # # # Makefile.master, global definitions for system source # ROOT= /proto # # Adjunct root, containing an additional proto area to be used for headers # and libraries. # ADJUNCT_PROTO= # # Adjunct for building things that run on the build machine. # NATIVE_ADJUNCT= /usr # # RELEASE_BUILD should be cleared for final release builds. # NOT_RELEASE_BUILD is exactly what the name implies. # # __GNUC toggles the building of ON components using gcc and related tools. # Normally set to `#', set it to `' to do gcc build. # # The declaration POUND_SIGN is always '#'. This is needed to get around the # make feature that '#' is always a comment delimiter, even when escaped or # quoted. We use this macro expansion method to get POUND_SIGN rather than # always breaking out a shell because the general case can cause a noticable # slowdown in build times when so many Makefiles include Makefile.master. # # While the majority of users are expected to override the setting below # with an env file (via nightly or bldenv), if you aren't building that way # (ie, you're using "ws" or some other bootstrapping method) then you need # this definition in order to avoid the subshell invocation mentioned above. # PRE_POUND= pre\# POUND_SIGN= $(PRE_POUND:pre\%=%) NOT_RELEASE_BUILD= RELEASE_BUILD= $(POUND_SIGN) $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN) PATCH_BUILD= $(POUND_SIGN) # SPARC_BLD is '#' for an Intel build. # INTEL_BLD is '#' for a Sparc build. SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN)) SPARC_BLD= $(SPARC_BLD_1:sparc=) INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN)) INTEL_BLD= $(INTEL_BLD_1:i386=) # The variables below control the compilers used during the build. # There are a number of permutations. # # __GNUC and __SUNC control (and indicate) the primary compiler. Whichever # one is not POUND_SIGN is the primary, with the other as the shadow. They # may also be used to control entirely compiler-specific Makefile assignments. # __SUNC and Sun Studio are the default. # # __GNUC64 indicates that the 64bit build should use the GNU C compiler. # There is no Sun C analogue. # # The following version-specific options are operative regardless of which # compiler is primary, and control the versions of the given compilers to be # used. They also allow compiler-version specific Makefile fragments. # __GNUC= $(POUND_SIGN) $(__GNUC)__SUNC= $(POUND_SIGN) __GNUC64= $(__GNUC) # CLOSED is the root of the tree that contains source which isn't released # as open source CLOSED= $(SRC)/../closed # BUILD_TOOLS is the root of all tools including compilers. # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld. BUILD_TOOLS= /ws/onnv-tools ONBLD_TOOLS= $(BUILD_TOOLS)/onbld JAVA_ROOT= /usr/java SFW_ROOT= /usr/sfw SFWINCDIR= $(SFW_ROOT)/include SFWLIBDIR= $(SFW_ROOT)/lib SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64) GCC_ROOT= /opt/gcc/4.4.4 GCCLIBDIR= $(GCC_ROOT)/lib GCCLIBDIR64= $(GCC_ROOT)/lib/$(MACH64) DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets RPCGEN= /usr/bin/rpcgen STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch ECHO= echo INS= install TRUE= true SYMLINK= /usr/bin/ln -s LN= /usr/bin/ln CHMOD= /usr/bin/chmod MV= /usr/bin/mv -f RM= /usr/bin/rm -f CUT= /usr/bin/cut NM= /usr/ccs/bin/nm DIFF= /usr/bin/diff GREP= /usr/bin/grep EGREP= /usr/bin/egrep ELFWRAP= /usr/bin/elfwrap KSH93= /usr/bin/ksh93 SED= /usr/bin/sed NAWK= /usr/bin/nawk CP= /usr/bin/cp -f MCS= /usr/ccs/bin/mcs CAT= /usr/bin/cat ELFDUMP= /usr/ccs/bin/elfdump M4= /usr/ccs/bin/m4 STRIP= /usr/ccs/bin/strip LEX= /usr/ccs/bin/lex FLEX= $(SFW_ROOT)/bin/flex YACC= /usr/ccs/bin/yacc CPP= /usr/lib/cpp JAVAC= $(JAVA_ROOT)/bin/javac JAVAH= $(JAVA_ROOT)/bin/javah JAVADOC= $(JAVA_ROOT)/bin/javadoc RMIC= $(JAVA_ROOT)/bin/rmic JAR= $(JAVA_ROOT)/bin/jar CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets CTFCVTPTBL= $(ONBLD_TOOLS)/bin/ctfcvtptbl CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod XREF= $(ONBLD_TOOLS)/bin/xref FIND= /usr/bin/find PERL= /usr/bin/perl PYTHON_26= /usr/bin/python2.6 PYTHON= $(PYTHON_26) SORT= /usr/bin/sort TOUCH= /usr/bin/touch WC= /usr/bin/wc XARGS= /usr/bin/xargs ELFEDIT= /usr/bin/elfedit ELFSIGN= /usr/bin/elfsign DTRACE= /usr/sbin/dtrace -xnolibs UNIQ= /usr/bin/uniq TAR= /usr/bin/tar ASTBINDIR= /usr/ast/bin MSGCC= $(ASTBINDIR)/msgcc FILEMODE= 644 DIRMODE= 755 # # The version of the patch makeup table optimized for build-time use. Used # during patch builds only. $(PATCH_BUILD)PMTMO_FILE=$(SRC)/patch_makeup_table.mo # Declare that nothing should be built in parallel. # Individual Makefiles can use the .PARALLEL target to declare otherwise. .NO_PARALLEL: # For stylistic checks # # Note that the X and C checks are not used at this time and may need # modification when they are actually used. # CSTYLE= $(ONBLD_TOOLS)/bin/cstyle CSTYLE_TAIL= HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk HDRCHK_TAIL= JSTYLE= $(ONBLD_TOOLS)/bin/jstyle DOT_H_CHECK= \ @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \ $(HDRCHK) $< $(HDRCHK_TAIL) DOT_X_CHECK= \ @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \ $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL) DOT_C_CHECK= \ @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL) MANIFEST_CHECK= \ @$(ECHO) "checking $<"; \ SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \ SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \ SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \ $(SRC)/cmd/svc/svccfg/svccfg-native validate $< INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $< INS.dir= $(INS) -s -d -m $(DIRMODE) $@ # installs and renames at once # INS.rename= $(INS.file); $(MV) $(@D)/$( $@ ;\ $(RM) $( $*.c $(LINK.c) -o $@ $*.c -ll $(LDLIBS) $(POST_PROCESS) $(RM) $*.c .l.o: $(RM) $*.c $(LEX.l) $< > $*.c $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK) $(POST_PROCESS_O) $(RM) $*.c .bin.o: $(COMPILE.b) -o $@ $< $(POST_PROCESS_O) .java.class: $(COMPILE.java) $< # Bourne and Korn shell script message catalog build rules. # We extract all gettext strings with sed(1) (being careful to permit # multiple gettext strings on the same line), weed out the dups, and # build the catalogue with awk(1). .sh.po .ksh.po: $(SED) -n -e ":a" \ -e "h" \ -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \ -e "x" \ -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \ -e "t a" \ $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@ # # Python and Perl executable and message catalog build rules. # .SUFFIXES: .pl .pm .py .pyc .pl: $(RM) $@; $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@; $(CHMOD) +x $@ .py: $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@ .py.pyc: $(RM) $@ $(PYTHON) -mpy_compile $< @[ $(<)c = $@ ] || $(MV) $(<)c $@ .py.po: $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $( $@ ; $(RM) $( $@ .h.i: $(CPPFORPO) $< > $@ .y.i: $(YACC) -d $< $(CPPFORPO) y.tab.c > $@ $(RM) y.tab.c .l.i: $(LEX) $< $(CPPFORPO) lex.yy.c > $@ $(RM) lex.yy.c .c.po: $(CPPFORPO) $< > $<.i $(BUILD.po) .y.po: $(YACC) -d $< $(CPPFORPO) y.tab.c > $<.i $(BUILD.po) $(RM) y.tab.c .l.po: $(LEX) $< $(CPPFORPO) lex.yy.c > $<.i $(BUILD.po) $(RM) lex.yy.c # # Rules to perform stylistic checks # .SUFFIXES: .x .xml .check .xmlchk .h.check: $(DOT_H_CHECK) .x.check: $(DOT_X_CHECK) .xml.xmlchk: $(MANIFEST_CHECK) # # Include rules to render automated sccs get rules "safe". # include $(SRC)/Makefile.noget