# # 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 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" # # # Makefile.master, global definitions for system source # ROOT= /proto # Historically, ON builds were always done with root permissions, and the # owner/group information was duplicated in the Makefiles and the packaging # data and kept in sync by manual intervention. This is no longer true. # The only source of this information is packaging. The proto area ($ROOT) # does not have definitive onwer/group information, and no Makefile should # attempt to set this. CH once toggled operations restricted to root. It # is now just set to `#'. # # At some point in the future, CH, CHOWN, CHGRP, OWNER, and GROUP should all # be stripped completely from the source base. They are kept for now until # on10-based projects can merge and transition away from them. # # RELEASE_BUILD should be cleared for final release builds. This is completely # independent of CH. 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 CH= $(POUND_SIGN) 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 10 compiler for all processor types. __GNUC= $(POUND_SIGN) # set __GNUC64= in the environment to build 64-bit with the gcc compiler. # The default is to use the Sun Studio 10 compiler by using the __GNUC # setting. __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) RPCGEN= /usr/bin/rpcgen STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs ECHO= echo INS= install TRUE= true SYMLINK= /usr/bin/ln -s LN= /usr/bin/ln CHMOD= /usr/bin/chmod CHOWN= $(TRUE) CHGRP= $(TRUE) MV= /usr/bin/mv -f RM= /usr/bin/rm -f GREP= /usr/bin/grep SED= /usr/bin/sed NAWK= /usr/bin/nawk CP= /usr/bin/cp -f MCS= /usr/ccs/bin/mcs CAT= /usr/bin/cat M4= /usr/ccs/bin/m4 STRIP= /usr/ccs/bin/strip LEX= /usr/ccs/bin/lex 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 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 SORT= /usr/bin/sort TOUCH= /usr/bin/touch WC= /usr/bin/wc XARGS= /usr/bin/xargs ELFSIGN= /usr/bin/elfsign DTRACE= /usr/sbin/dtrace FILEMODE= 644 DIRMODE= 755 # Note: owner and group for proto area objects is no longer set by # Makefiles at all. These have no real effect and are kept here for # transition purposes. They (along with CH, CHOWN, and CHGRP) should be # removed early in the s11 development cycle. OWNER= root GROUP= bin # # 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= cstyle CSTYLE_TAIL= HDRCHK= hdrchk HDRCHK_TAIL= JSTYLE= 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 \ $(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) $< # # Rules to create message catalogue files from .sh, .c, .y, and .l files. # For .sh files, 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: $(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" }' > $@ # # When using xgettext, we want messages to go to the default domain, # rather than the specified one. This special version of the # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN, # causing xgettext to put all messages into the default domain. # CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN) .c.i: $(CPPFORPO) $< > $@ .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: $(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' $< > $@