# # 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 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # Makefile.master, global definitions for system source # ROOT= /proto # # RELEASE_BUILD should be cleared for final release builds. # NOT_RELEASE_BUILD is exactly what the name implies. # # INTERNAL_RELEASE_BUILD is a subset of RELEASE_BUILD. It mostly controls # identification strings. Enabling RELEASE_BUILD automatically enables # INTERNAL_RELEASE_BUILD. # # EXPORT_RELEASE_BUILD controls whether binaries are built in a form that # can be released for export under a binary license. It is orthogonal to # the other *RELEASE_BUILD settings. ("#" means do an export release # build, "" means do a normal build.) # # CLOSED_BUILD controls whether we try to build files under # usr/closed. ("" means to build closed code, "#" means don't try to # build it.) Skipping the closed code implies doing an export release # build. # # STRIP_COMMENTS toggles comment section striping. Generally the same setting # as INTERNAL_RELEASE_BUILD. # # __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. The only way of generating this is the :sh macro mechanism. Note # however that in general :sh macros should be avoided in makefiles that are # widely included into other makefiles, as the resulting shell executions can # cause a noticable slowdown in build times. # POUND_SIGN:sh= echo \\043 NOT_RELEASE_BUILD= INTERNAL_RELEASE_BUILD= $(POUND_SIGN) RELEASE_BUILD= $(POUND_SIGN) $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN) $(RELEASE_BUILD)INTERNAL_RELEASE_BUILD= PATCH_BUILD= $(POUND_SIGN) # If CLOSED_IS_PRESENT is not set, assume the closed tree is present. CLOSED_BUILD_1= $(CLOSED_IS_PRESENT:yes=) CLOSED_BUILD= $(CLOSED_BUILD_1:no=$(POUND_SIGN)) EXPORT_RELEASE_BUILD= $(POUND_SIGN) $(CLOSED_BUILD)EXPORT_RELEASE_BUILD= # 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=) STRIP_COMMENTS= $(INTERNAL_RELEASE_BUILD) # set __GNUC= in the environment to build 32-bit with the gcc compiler. # The default is to use the Sun Studio compiler for all processor types. __GNUC= $(POUND_SIGN) # set __GNUC64= in the environment to build 64-bit with the gcc compiler. # Inherit the __GNUC value by default, and if that is set to $(POUND_SIGN) # then this means use the Sun Studio compiler. __GNUC64= $(__GNUC) # set __SSNEXT= in the enviroment to build with the 'next' release of # the Sun Studio compiler. This will cause command line options specific # to the 'next' version of the Sun Studio compiler to be used. __SSNEXT= $(POUND_SIGN) # 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) 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 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 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= /usr/bin/python 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 UNIQ= /usr/bin/uniq 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 .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) # # Rules to process ONC+ Source partial files # %_onc_plus: % @$(ECHO) "extracting code from $< ... " sed -n -e '/ONC_PLUS EXTRACT START/,/ONC_PLUS EXTRACT END/p' $< > $@ # # Include rules to render automated sccs get rules "safe". # include $(SRC)/Makefile.noget