# Copyright 1990-1995 Silicon Graphics, Inc. All rights reserved. # #ident "$Revision: 1.195 $" # # Common makefile definitions. # # Notes: # - Definitions with the same names only need to be passed on the # command line of recursive makes if they would be redefined by # the sub-makefile. Definitions passed on the command line are # not reset by the environment or the definitions in the makefile. # - C++ style macros are deprecated and will be removed when out of use. # They must be interwoven in definitions to keep upward compatibility. # # - The contents of this header are changed based on some variables # should be defined BEFORE including this file: # OBJECT_STYLE - define basic ABI/ISA that should be used to create product. # this also sets LD search paths, C/C++/Fortran/Pascal options. # NO_OBJECT_STYLE - disable all this new OBJECT_STYLE business. # Note that if one does this all the info in releasedefs about # compiler versions, default compilation modes etc will be ignored. # Only smake-files can do this. # NO_LSRCH - do not set any library searching rules for LD options. # ASTYLE - by default, the ABI/ISA for C is used for assembler - # setting ASTYLE (to be assembler options) can override the OBJECT_STYLE # to permit fine-tuning of asm code. # NO_STARTOPT - don't set any of the DSO start option macros - this # will keep the global so_locations files from being updated. # COMMONRULES= $(ROOT)/usr/include/make/commonrules COMMONTARGS= clobber clean rmtargets fluff tags PRODUCTDEFS= $(ROOT)/usr/include/make/$(PRODUCT)defs RELEASEDEFS= $(ROOT)/usr/include/make/releasedefs # include releasedefs by default #if !defined(NO_RELEASEDEFS) include $(RELEASEDEFS) #endif # Build tools, i.e., programs which are used as part of the build # process. These must run on all supported build environments # (currently IRIX 6.2 and up). AR = $(TOOLROOT)/usr/bin/ar AS = $(TOOLROOT)/usr/bin/as $(ENDIAN) BISON = $(TOOLROOTSAFE) $(TOOLROOT)/usr/bin/bison C++ = $(TOOLROOT)/usr/bin/CC C++C = $(TOOLROOT)/usr/bin/CC CC = $(TOOLROOT)/usr/bin/cc CORD = $(TOOLROOT)/usr/bin/cord CXX = $(C++) F77 = $(TOOLROOT)/usr/bin/f77 FC = $(TOOLROOT)/usr/bin/f77 FLEX = $(TOOLROOTSAFE) $(TOOLROOT)/usr/bin/flex GNUM4 = $(TOOLROOTSAFE) $(TOOLROOT)/usr/bin/gnum4 LEX = $(TOOLROOT)/usr/bin/lex -l $(ROOT)/usr/lib/lex/ncform LD = $(TOOLROOT)/usr/bin/ld LIBSPEC = $(TOOLROOT)/usr/sbin/libspec LINT = $(TOOLROOT)/usr/bin/lint LORDER = $(TOOLROOT)/usr/bin/lorder MKF2C = $(TOOLROOT)/usr/bin/mkf2c NM = $(TOOLROOT)/usr/bin/nm PC = $(TOOLROOT)/usr/bin/pc SETMAGIC= $(TOOLROOT)/usr/sbin/setmagic SIZE = $(TOOLROOT)/usr/bin/size STRIP = $(TOOLROOT)/usr/bin/strip TAG = $(TOOLROOT)/usr/sbin/tag TLINK = $(TOOLROOT)/usr/sbin/tlink YACC = $(TOOLROOTSAFE) $(TOOLROOT)/usr/bin/yacc -P $(ROOT)/usr/lib/yaccpar # A shell script which does whatever needs to be done to make toolroot # binaries run on build machines (which may be running anything from # IRIX 6.2 to 6.5). #if defined(TOOLROOT) && $(TOOLROOT) != "/" TOOLROOTSAFE = $(TOOLROOT)/usr/sbin/toolrootsafe #endif # XXX remove this as soon as we port libgl's makefiles to DSO MKSHLIB = $(TOOLROOT)/usr/bin/mkshlib # Old TOOLROOT-prefixed macros. References should be replaced with # native 'echo', sh, etc. since special versions shouldn't really be # needed SHELL = /bin/sh AWK = awk NAWK = nawk ECHO = echo M4 = m4 # # The native tools, which must be used when building programs that are # run on the build host from a makefile. Use of these macros are # deprecated, since we don't want to make assumptions about what's # installed on the host. Instead, we rely on TOOLROOTSAFE to make sure # that everything in the toolroot can run on all supported build # environments. HOST_CC = TOOLROOT= /usr/bin/cc HOST_C++ = TOOLROOT= /usr/bin/CC HOST_CXX = $(HOST_C++) HOST_LD = TOOLROOT= /usr/bin/ld HOST_YACC = _XPG= TOOLROOT= /usr/bin/yacc -p /usr/lib/yaccpar HOST_LEX = TOOLROOT= /usr/bin/lex -l /usr/lib/lex/ncform HOST_CFLAGS = $(CFLAGS:S/$(ROOT)//g) HOST_C++FLAGS = $(C++FLAGS:S/$(ROOT)//g) HOST_CXXFLAGS = $(HOST_C++FLAGS) HOST_LDFLAGS = $(LDFLAGS:S/$(ROOT)//g) HOST_CCF = $(HOST_CC) $(HOST_CFLAGS) HOST_C++F = $(HOST_C++) $(HOST_C++FLAGS) HOST_CXXF = $(HOST_C++F) HOST_LDF = $(HOST_LD) $(HOST_LDFLAGS) HOST_YACCF = $(HOST_YACC) $(YFLAGS) HOST_LEXF = $(HOST_LEX) $(LFLAGS) # # Popular ABI/ISA combinations supported here: # # 32_M2 - MIPS/ABI; 32 bit; mips2 # 32_ABI - MIPS/ABI; 32 bit; mips1; ABI restrictions # N32_M3 - new calling convention; 32 bit; mips3 # N32_M4 - new calling convention; 32 bit; mips4 # 64_M3 - new calling convention; 64 bit; mips3 # 64_M4 - new calling convention; 64 bit; mips4 # 64_ABI - MIPS/ABI; 64 bit; mips3/4; ABI restrictions # # The following are 'generic' these should be used unless fine control # over ISA is required (releasedefs decides which ISA): # # 32 - MIPS/ABI; 32 bit; # N32 - new calling convention; 32 bit; # 64 - new calling convention; 64 bit; # ALLSTYLES=32 32_M2 32_ABI N32 N32_M3 N32_M4 64 64_M3 64_M4 64_ABI # # ENDIAN is defined only when cross-compiling # it normally comes from the $(PRODUCT)defs file. # # The -nostdinc flag is defined to defeat searches of /usr/include in # a cross development environment. Where it is placed on the command line # does not matter. This replaces the nullary -I flag. # Turn off some silly ansi warnings: # The $(LWOFF) allows makefiles to set local warnings to ignore # (note that a leading ',' with no whitespace is required). # # Criteria for adding a global woff: # a) it in no way could indicate a potential bug in the software. # This assumes that the software is required only to run on # SGI equipment with SGI compilers. # b) The infraction is ubiquitous. If only a few pieces of software # suffer from a given warning - they should turn it off in # their own Makefile (or fix it!). # # The ignored 3.XX compiler warnings are as followings: # # 515 - Constant is out of range and may be truncated # 608 - Undefined the ANSI standard library defined macro # 658 - bit-field type required to be int, unsigned int, # or signed int # 799 - is not standard ANSI # 803 - Ignored invalid warning number(s) in -woff option # 852 - can be const qualified (-wlint) # # The ignored 4.XX compiler warnings are as follows: # 1048 - cast between pointer-to-object and pointer-to-function # 1233 - explicit type is missing ("int" assumed) # 1499 - -woff arguments must be in the range ... # 1685 - The v6.02 compiler changes woff #1499 to 1685. # The specific error is "invalid error number " WOFF=-woff 1685,515,608,658,799,803,852,1048,1233,1499$(LWOFF) # # Default C version, optimizer, common global options, and make-depend options. # CVERSION = OPTIMIZER = -O MKDEPOPT = -MDupdate $(MKDEPFILE) COMMONGOPTS=$(OPTIMIZER) $(MKDEPOPT) $(ENDIAN) # # Pick appropriate STYLE - releasedefs defines the default # Note that binaries that don't have absolute ISA requirements should use # the generic OBJECT_STYLE={64, 32, N32}. This permits the default to be # set by releasedefs # CSTYLE_32_M2 = -mips2 -o32 CSTYLE_32_ABI= -mips1 -o32 -D_MIPSABI_SOURCE=3 CSTYLE_N32_M3= -mips3 -n32 CSTYLE_N32_M4= -mips4 -n32 CSTYLE_R32 = -mips3 -r32 CSTYLE_64_M3 = -mips3 -64 CSTYLE_64_M4 = -mips4 -64 CSTYLE_64_ABI = -mips3 -64 -D_MIPSABI_SOURCE=3 # 'generic' styles - per ABI. releasedefs sets what it is. # DEF_CSTYLE's are set in releasedefs CSTYLE_32 = $(DEF_CSTYLE_32) CSTYLE_N32 = $(DEF_CSTYLE_N32) CSTYLE_64 = $(DEF_CSTYLE_64) # # Set OBJECT_STYLE if it hasn't already been set - note that std 'make'files # will get this value. This is somewhat convoluted to be sure that # 'make'-files will get the 'correct' value # #if defined(NO_OBJECT_STYLE) OBJECT_STYLE=NONE #endif #if !defined(OBJECT_STYLE) OBJECT_STYLE = $(DEF_OBJECT_STYLE) #endif #if $(OBJECT_STYLE) == "64" CSTYLE=$(CSTYLE_64) #elif $(OBJECT_STYLE) == "64_M3" CSTYLE=$(CSTYLE_64_M3) #elif $(OBJECT_STYLE) == "64_M4" CSTYLE=$(CSTYLE_64_M4) #elif $(OBJECT_STYLE) == "64_ABI" CSTYLE=$(CSTYLE_64_ABI) #elif $(OBJECT_STYLE) == "32_ABI" CSTYLE=$(CSTYLE_32_ABI) #elif $(OBJECT_STYLE) == "N32" CSTYLE=$(CSTYLE_N32) #elif $(OBJECT_STYLE) == "N32_M3" CSTYLE=$(CSTYLE_N32_M3) #elif $(OBJECT_STYLE) == "N32_M4" CSTYLE=$(CSTYLE_N32_M4) #elif $(OBJECT_STYLE) == "R32" CSTYLE=$(CSTYLE_R32) #elif $(OBJECT_STYLE) == "32" CSTYLE=$(CSTYLE_32) #elif $(OBJECT_STYLE) == "32_M2" CSTYLE=$(CSTYLE_32_M2) #elif $(OBJECT_STYLE) == "NONE" CSTYLE= #else # set in releasedefs # This is the one that 'make' sees CSTYLE=$(DEF_CSTYLE) #endif GCOPTS = $(CSTYLE) $(OPTIMIZER) $(ENDIAN) $(MKDEPOPT) $(WOFF) GCDEFS = GCINCS = -nostdinc -I$(INCLDIR) # # Cc flags, composed of: # variable (V*) (set on the command line), # local (L*) (defined in the makefile), # global (defined in this file), # parts, in that order. This ordering has been used so that the variable or # locally specified include directories are searched before the globally # specified ones. # CFLAGS = $(CVERSION) $(VCFLAGS) $(LCFLAGS) $(GCFLAGS) # # Each of these three components is divided into defines (-D's and -U's), # includes (-I's), and other options. By segregating the different # classes of flag to cc, the defines (CDEFS) and includes (CINCS) can be # easily given to other programs, e.g., lint. # # Notes: # - The local assignments should be to LCOPTS, LCDEFS, and LCINCS, not to # LCFLAGS, although CFLAGS will be correctly set if this is done. # - If a program cannot be optimized, it should override the setting of # OPTIMIZER with a line such as "OPTIMIZER=" in its make file. # - If a program cannot be compiled with ANSI C, its makefile # should set CVERSION=-cckr # VCFLAGS = $(VCDEFS) $(VCINCS) $(VCOPTS) LCFLAGS = $(LCDEFS) $(LCINCS) $(LCOPTS) GCFLAGS = $(GCDEFS) $(GCINCS) $(GCOPTS) COPTS = $(VCOPTS) $(LCOPTS) $(GCOPTS) CDEFS = $(VCDEFS) $(LCDEFS) $(GCDEFS) CINCS = $(VCINCS) $(LCINCS) $(GCINCS) # # CXX flags are decomposed using the same hierarchy as C flags. # C++FLAGS = $(CVERSION) $(VCXXFLAGS) $(LCXXFLAGS) $(GCXXFLAGS) CXXFLAGS = $(C++FLAGS) VCXXFLAGS = $(VCXXDEFS) $(VCXXINCS) $(VCXXOPTS) $(VC++FLAGS) LCXXFLAGS = $(LCXXDEFS) $(LCXXINCS) $(LCXXOPTS) $(LC++FLAGS) GCXXFLAGS = $(GC++FLAGS) CXXOPTS = $(VCXXOPTS) $(LCXXOPTS) $(GCXXOPTS) $(C++OPTS) CXXDEFS = $(VCXXDEFS) $(LCXXDEFS) $(GCXXDEFS) $(C++DEFS) CXXINCS = $(VCXXINCS) $(LCXXINCS) $(GCXXINCS) $(C++INCS) VC++FLAGS = $(VC++DEFS) $(VC++INCS) $(VC++OPTS) LC++FLAGS = $(LC++DEFS) $(LC++INCS) $(LC++OPTS) GC++FLAGS = $(GC++DEFS) $(GC++INCS) $(GC++OPTS) C++OPTS = $(VC++OPTS) $(LC++OPTS) $(GC++OPTS) C++DEFS = $(VC++DEFS) $(LC++DEFS) $(GC++DEFS) C++INCS = $(VC++INCS) $(LC++INCS) $(GC++INCS) GC++OPTS = $(CSTYLE) $(OPTIMIZER) $(ENDIAN) $(MKDEPOPT) GC++INCS = -nostdinc -I$(INCLDIR)/CC -I$(INCLDIR) GC++DEFS = # # Loader flags, composed of library (-l's) and option parts, with # the libraries appearing last. Both of these are divided into variable, # local, and global parts. The composition of LDFLAGS is done in the # other "direction" from CFLAGS so that all the -L's, which are part of # LDOPTS, appear before any of the -l's, which are part of LDLIBS. # Another benefit of segregating the libraries from the remaining of the # loader options is that the libraries alone can easily be given to # another program, e.g., lint. # # Notes: # - -s belongs in GCOPTS or in the IDB program that does the actual # installation. # # Note: To turn off -quickstart_info for specific Makefile add: # LD_QUICKSTART_INFO= LD_QUICKSTART_INFO=-quickstart_info # # locations to search for libs. We search the 'generic' locations such # as usr/lib64 even though those are installed in a machine specific manner. # This permits library writers that only want to have one 'least-common- # denominator' version per ABI to install it directly in the generic location # without having to create links. This should be OK in the build environment # since we always search the specific directories first. # # Some user's may not want all this searching help - they can specify # NO_LSRCH # #if !defined(NO_LSRCH) LSRCH_32_M2 = -L$(ROOT)/lib -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/internal LSRCH_N32_M3 = -L$(ROOT)/usr/lib32/mips3 -L$(ROOT)/usr/lib32 -L$(ROOT)/usr/lib32/internal LSRCH_N32_M4 = -L$(ROOT)/usr/lib32/mips4 -L$(ROOT)/usr/lib32 -L$(ROOT)/usr/lib32/internal LSRCH_32_ABI = -L$(ROOT)/usr/lib/abi LSRCH_R32 = -L$(ROOT)/libr32 -L$(ROOT)/usr/libr32 LSRCH_64_M3 = -L$(ROOT)/usr/lib64/mips3 -L$(ROOT)/usr/lib64 -L$(ROOT)/usr/lib64/internal LSRCH_64_M4 = -L$(ROOT)/usr/lib64/mips4 -L$(ROOT)/usr/lib64 -L$(ROOT)/usr/lib64/internal LSRCH_64_ABI = -L$(ROOT)/usr/lib64/abi #endif # # each 'popular' combination of ABI and ISA gets its own set of # GLDOPTS_* # It is assumed that a command that needs to be built with more than # one ABI uses cmdcommon* - thus the appropriate versiondefs file will # contain any needed VERSION_LDOPTS. # # DSO's don't follow this rule - they typically create all versions at the # top - thus, they need access to all possible LDOPTS_* values, and need # a way to add additional options per object style. So, we add a set of LDOPTS_* # this can also be used for makefiles that would rather not use cmdcommon*. # GLDOPTS_32_M2 = -mips2 -o32 $(LD_QUICKSTART_INFO) -nostdlib $(LSRCH_32_M2) GLDOPTS_32_ABI= -o32 -abi -nostdlib $(LSRCH_32_ABI) GLDOPTS_N32_M3= -mips3 -n32 $(LD_QUICKSTART_INFO) -nostdlib $(LSRCH_N32_M3) GLDOPTS_N32_M4= -mips4 -n32 $(LD_QUICKSTART_INFO) -nostdlib $(LSRCH_N32_M4) GLDOPTS_R32 = -r32 $(LD_QUICKSTART_INFO) -nostdlib $(LSRCH_R32) GLDOPTS_64_M3 = -mips3 -64 $(LD_QUICKSTART_INFO) -nostdlib $(LSRCH_64_M3) GLDOPTS_64_M4 = -mips4 -64 $(LD_QUICKSTART_INFO) -nostdlib $(LSRCH_64_M4) GLDOPTS_64_ABI= -mips3 -64 -abi -nostdlib $(LSRCH_64_ABI) # until new ld GLDOPTS_64_ABI= -mips3 -64 -nostdlib $(LSRCH_64_ABI) # # Most objects don't have absolute requirements for ISA - use these # to get the default for each ABI as set by the release gods. # GLDOPTS_32 =$(DEF_GLDOPTS_32) GLDOPTS_N32 =$(DEF_GLDOPTS_N32) GLDOPTS_64 =$(DEF_GLDOPTS_64) GLDLIBS= # # LDFLAG layout # # Incompatibility from previous commondefs: # a) setting of LDOPTS in a makefile is probably wrong # LDFLAGS = $(LDOPTS) $(LDLIBS) $(ENDIAN) LDOPTS = $(VLDOPTS) $(LLDOPTS) $(GLDOPTS) LDLIBS = $(VLDLIBS) $(LLDLIBS) $(GLDLIBS) # # Pick appropriate GLDOPTS - releasedefs defines the default # Note that binaries that don't have absolute ISA requirements should use # the generic OBJECT_STYLE={64, 32, N32}. This permits the default to be # set by releasedefs # #if $(OBJECT_STYLE) == "64" GLDOPTS=$(GLDOPTS_64) #elif $(OBJECT_STYLE) == "64_M3" GLDOPTS=$(GLDOPTS_64_M3) #elif $(OBJECT_STYLE) == "64_M4" GLDOPTS=$(GLDOPTS_64_M4) #elif $(OBJECT_STYLE) == "64_ABI" GLDOPTS=$(GLDOPTS_64_ABI) #elif $(OBJECT_STYLE) == "32_ABI" GLDOPTS=$(GLDOPTS_32_ABI) #elif $(OBJECT_STYLE) == "N32" GLDOPTS=$(GLDOPTS_N32) #elif $(OBJECT_STYLE) == "N32_M3" GLDOPTS=$(GLDOPTS_N32_M3) #elif $(OBJECT_STYLE) == "N32_M4" GLDOPTS=$(GLDOPTS_N32_M4) #elif $(OBJECT_STYLE) == "R32" GLDOPTS=$(GLDOPTS_R32) #elif $(OBJECT_STYLE) == "32" GLDOPTS=$(GLDOPTS_32) #elif $(OBJECT_STYLE) == "32_M2" GLDOPTS=$(GLDOPTS_32_M2) #elif $(OBJECT_STYLE) == "NONE" GLDOPTS= #else # set in releasedefs # This is one that 'make' sees GLDOPTS=$(DEF_GLDOPTS) #endif LDOPTS_32 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_32_M2) $(GLDOPTS_32_M2) LDOPTS_32_M2 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_32_M2) $(GLDOPTS_32_M2) LDOPTS_32_ABI=$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_32_ABI) $(GLDOPTS_32_ABI) LDOPTS_N32 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_N32_M3) $(GLDOPTS_N32) LDOPTS_N32_M3=$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_N32_M3) $(GLDOPTS_N32_M3) LDOPTS_N32_M4=$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_N32_M4) $(GLDOPTS_N32_M4) LDOPTS_R32 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_R32) $(GLDOPTS_R32) LDOPTS_64 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_64_M3) $(GLDOPTS_64) LDOPTS_64_M3 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_64_M3) $(GLDOPTS_64_M3) LDOPTS_64_M4 =$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_64_M4) $(GLDOPTS_64_M4) LDOPTS_64_ABI=$(VLDOPTS) $(LLDOPTS) $(LLDOPTS_64_ABI) $(GLDOPTS_64_ABI) # # Loader options for making shared objects. By default, shared objects # are all registered in a global location file. # Redefine $(DSOSTARTOPT) to not update the registry file # # By default the DT_SONAME section is set to the name of the target shared # object. Redefine $(DSONAMEOPT) to allow the DT_SONAME section to be # something other than the targeted shared object name. # # DSOs are typically all made in one top level makefile, in place, rather # than in subdirectories - therefore all the various flags must be # present with no conditionals # # # To build a DSO that doesn't use lib*rules: # # $(LD) $(LDDSOOPTS) $(LDOPTS) $(OBJECTS) $(LDLIBS) -o $@ # # Note that LDOPTS must be before the OBJECTS and LDLIBS must be after. # For local .so's make it easy to not update any registry files # #if !defined(NO_STARTOPT) DSOREGFILE_32 = $(ROOT)/usr/lib/so_locations DSOREGFILE = $(DSOREGFILE_32) DSOREGFILE_R32 = $(ROOT)/usr/libr32/so_locations DSOREGFILE_64 = $(ROOT)/usr/lib64/so_locations DSOREGFILE_N32 = $(ROOT)/usr/lib32/so_locations DSOSTARTOPT_32 = -update_registry $(DSOREGFILE_32) DSOSTARTOPT = $(DSOSTARTOPT_32) DSOSTARTOPT_R32 = -update_registry $(DSOREGFILE_R32) DSOSTARTOPT_64 = -update_registry $(DSOREGFILE_64) DSOSTARTOPT_N32 = -update_registry $(DSOREGFILE_N32) #endif DSONAMEOPT = -soname $@ # # Note: To turn off -no_unresolved for a specific library Makefile, add: # LD_NO_UNRESOLVED= LD_NO_UNRESOLVED=-no_unresolved # # SGI specific versioning. Redefine $(DSOVERSION) to change version number. # Redefine $(DSOVERSIONOPT) to skip versioning. # DSOVERSION = sgi1.0 DSOVERSIONOPT = -set_version $(DSOVERSION) # # Export files - each build can have up to 2 exports file - a common # one (DSOEXPORTS) and a per-ABI version (DSOEXPORTS_XXX) # Note that _ABI (MIPS ABI) ONLY uses the DSOEXPORTS_XX_ABI) exports file # This feature not available for make ... # Note that these macros must be set BEFORE including commondefs/librootdefs # #if defined(DSOEXPORTS) DSOEXPORTSOPT=-exports_file $(DSOEXPORTS) #else # this is what make sees DSOEXPORTSOPT= #endif # Permit per ABI exports file #if defined(DSOEXPORTS_32) DSOEXPORTSOPT_32=-exports_file $(DSOEXPORTS_32) #else # this is what make sees DSOEXPORTSOPT_32= #endif #if defined(DSOEXPORTS_32_ABI) DSOEXPORTSOPT_32_ABI=-exports_file $(DSOEXPORTS_32_ABI) #else # this is what make sees DSOEXPORTSOPT_32_ABI= #endif #if defined(DSOEXPORTS_N32) DSOEXPORTSOPT_N32=-exports_file $(DSOEXPORTS_N32) #else # this is what make sees DSOEXPORTSOPT_N32= #endif #if defined(DSOEXPORTS_64) DSOEXPORTSOPT_64=-exports_file $(DSOEXPORTS_64) #else # this is what make sees DSOEXPORTSOPT_64= #endif #if defined(DSOEXPORTS_64_ABI) DSOEXPORTSOPT_64_ABI=-exports_file $(DSOEXPORTS_64_ABI) #else # this is what make sees DSOEXPORTSOPT_64_ABI= #endif # # Each ABI gets the generic *LDDSOOPTS as well as a set of ABI specific ones # LDDSOOPTS_32 = $(VLDDSOOPTS) $(VLDDSOOPTS_32) \ $(LLDDSOOPTS) $(LLDDSOOPTS_32) \ $(GLDDSOOPTS) $(GLDDSOOPTS_32) LDDSOOPTS_32_ABI= $(VLDDSOOPTS) $(VLDDSOOPTS_32_ABI) \ $(LLDDSOOPTS) $(LLDDSOOPTS_32_ABI) \ $(GLDDSOOPTS) $(GLDDSOOPTS_32_ABI) LDDSOOPTS_R32 = $(VLDDSOOPTS) $(VLDDSOOPTS_R32) \ $(LLDDSOOPTS) $(LLDDSOOPTS_R32) \ $(GLDDSOOPTS) $(GLDDSOOPTS_R32) LDDSOOPTS_N32 = $(VLDDSOOPTS) $(VLDDSOOPTS_N32) \ $(LLDDSOOPTS) $(LLDDSOOPTS_N32) \ $(GLDDSOOPTS) $(GLDDSOOPTS_N32) LDDSOOPTS_64 = $(VLDDSOOPTS) $(VLDDSOOPTS_64) \ $(LLDDSOOPTS) $(LLDDSOOPTS_64) \ $(GLDDSOOPTS) $(GLDDSOOPTS_64) LDDSOOPTS_64_ABI= $(VLDDSOOPTS) $(VLDDSOOPTS_64_ABI) \ $(LLDDSOOPTS) $(LLDDSOOPTS_64_ABI) \ $(GLDDSOOPTS) $(GLDDSOOPTS_64_ABI) # Totally generic - common options for all ABIs GLDDSOOPTS = -elf -shared -all $(MKDEPOPT) $(DSONAMEOPT) GLDDSOOPTS_32 = $(LD_NO_UNRESOLVED) $(LD_QUICKSTART_INFO) \ $(DSOEXPORTSOPT) $(DSOEXPORTSOPT_32) \ $(DSOSTARTOPT_32) $(DSOVERSIONOPT) GLDDSOOPTS_32_ABI = $(DSOEXPORTSOPT_32_ABI) GLDDSOOPTS_R32 = $(LD_NO_UNRESOLVED) $(LD_QUICKSTART_INFO) \ $(DSOSTARTOPT_R32) $(DSOVERSIONOPT) GLDDSOOPTS_N32 = $(LD_NO_UNRESOLVED) $(LD_QUICKSTART_INFO) \ $(DSOEXPORTSOPT) $(DSOEXPORTSOPT_N32) \ $(DSOSTARTOPT_N32) $(DSOVERSIONOPT) GLDDSOOPTS_64 = $(LD_NO_UNRESOLVED) $(LD_QUICKSTART_INFO) \ $(DSOEXPORTSOPT) $(DSOEXPORTSOPT_64) \ $(DSOSTARTOPT_64) $(DSOVERSIONOPT) GLDDSOOPTS_64_ABI = $(DSOEXPORTSOPT_64_ABI) # # set LDDSOOPTS based on OBJECT_STYLE - makes it easier to make .so's # when one doesn't use lib*defs # #if $(OBJECT_STYLE) == "32_ABI" LDDSOOPTS=$(LDDSOOPTS_32_ABI) #elif $(OBJECT_STYLE) == "64_ABI" LDDSOOPTS=$(LDDSOOPTS_64_ABI) #elif $(OBJECT_STYLE:M64*) != "" LDDSOOPTS=$(LDDSOOPTS_64) #elif $(OBJECT_STYLE:MN32*) != "" LDDSOOPTS=$(LDDSOOPTS_N32) #elif $(OBJECT_STYLE:M32*) != "" LDDSOOPTS=$(LDDSOOPTS_32) #elif $(OBJECT_STYLE) == "NONE" LDDSOOPTS= #else # this is what 'make' sees LDDSOOPTS=$(LDDSOOPTS_32) #endif # # F77 flags are just like cc flags. # FFLAGS= $(VFFLAGS) $(LFFLAGS) $(GFFLAGS) VFFLAGS = $(VF77DEFS) $(VF77INCS) $(VF77OPTS) LFFLAGS = $(LF77DEFS) $(LF77INCS) $(LF77OPTS) GFFLAGS = $(GF77DEFS) $(GF77INCS) $(GF77OPTS) F77OPTS = $(VF77OPTS) $(LF77OPTS) $(GF77OPTS) F77DEFS = $(VF77DEFS) $(LF77DEFS) $(GF77DEFS) F77INCS = $(VF77INCS) $(LF77INCS) $(GF77INCS) GF77OPTS= $(CSTYLE) $(OPTIMIZER) $(ENDIAN) $(MKDEPOPT) GF77DEFS= $(GCDEFS) GF77INCS= $(GCINCS) # # Pc flags are just like cc flags. # PFLAGS = $(VPFLAGS) $(LPFLAGS) $(GPFLAGS) VPFLAGS = $(VPDEFS) $(VPINCS) $(VPOPTS) LPFLAGS = $(LPDEFS) $(LPINCS) $(LPOPTS) GPFLAGS = $(GPDEFS) $(GPINCS) $(GPOPTS) POPTS = $(VPOPTS) $(LPOPTS) $(GPOPTS) PDEFS = $(VPDEFS) $(LPDEFS) $(GPDEFS) PINCS = $(VPINCS) $(LPINCS) $(GPINCS) GPOPTS = $(CSTYLE) $(OPTIMIZER) $(ENDIAN) $(MKDEPOPT) GPDEFS = $(GCDEFS) GPINCS = $(GCINCS) # # as flags are just like cc flags. # By default, ASTYLE is the same as CSTYLE, but some may need to make # the asm more aggressive than 'C' and can set ASTYLE. Users of 'make' # always get ASTYLE == CSTYLE # #if !defined(ASTYLE) ASTYLE=$(CSTYLE) #endif ASFLAGS = $(VASFLAGS) $(LASFLAGS) $(GASFLAGS) VASFLAGS = $(VASDEFS) $(VASINCS) $(VASOPTS) LASFLAGS = $(LASDEFS) $(LASINCS) $(LASOPTS) GASFLAGS = $(GASDEFS) $(GASINCS) $(GASOPTS) ASOPTS = $(VASOPTS) $(LASOPTS) $(GASOPTS) ASDEFS = $(VASDEFS) $(LASDEFS) $(GASDEFS) ASINCS = $(VASINCS) $(LASINCS) $(GASINCS) GASOPTS = $(ASTYLE) $(OPTIMIZER) $(ENDIAN) $(MKDEPOPT) GASDEFS = $(GCDEFS) GASINCS = $(GCINCS) # # The install command to use. # INSTALL = $(TOOLROOT)/etc/install # # A not-so-common definition for graphics makefiles that want to install # something on all machines. # XXX can't we define "all" as a wildcard mach tag? # ALLGFXMACH = mach(GFXBOARD=LIGHT SUBGR=LIGHT \ GFXBOARD=LIGHT SUBGR=LG1MC \ GFXBOARD=EXPRESS SUBGR=EXPRESS \ GFXBOARD=EXPRESS SUBGR=IP19 \ GFXBOARD=EXPRESS SUBGR=IP21 \ GFXBOARD=EXPRESS SUBGR=IP25 \ GFXBOARD=EXPRESS SUBGR=I2_64 \ GFXBOARD=MGRAS SUBGR=MGRAS \ GFXBOARD=MGRAS SUBGR=IP27 \ GFXBOARD=MGRAS SUBGR=RACER \ GFXBOARD=VENICE SUBGR=IP19 \ GFXBOARD=VENICE SUBGR=IP21 \ GFXBOARD=VENICE SUBGR=IP25 \ GFXBOARD=KONA SUBGR=IP19 \ GFXBOARD=KONA SUBGR=IP25 \ GFXBOARD=KONA SUBGR=IP27 \ GFXBOARD=NEWPORT SUBGR=NG1 \ GFXBOARD=NEWPORT SUBGR=NEWTON \ GFXBOARD=NEWPRESS SUBGR=NEWPRESS \ GFXBOARD=CRIME SUBGR=CRM) # # For people who want to run etags on other types of files # CTAGFILES = \( -name '*.[cfhlpy]' -o -name '*.c++' \) # # MKDEPFILE is the name of the dependency database, included by commonrules. # MKDEPFILE = Makedepend # # Name of the location of various libs $(ROOT)/usr/$(LIB_LOCATION)/libfoo.[a,so] # This is set in the releasedefs file. # LIB_LOCATION_O32=lib LIB_LOCATION_N32=lib32 # # Name of the runtime linker in / # # Note: this is used to set the PR_INTERP_NAME, but the DT_RPATH elf var must # be set to the root of the $ROOTRLDNAME as well. # # To allow the changing of the default object style ... we now have # two different ROOTRLDNAME's which then can be mapped to ROOTRLDNAME. # The variable ROOTRLDNAME is set in the releasedefs file. # ROOTRLDNAME_O32=/lib/libc.so.1,-rpath,/lib ROOTRLDNAME_N32=/lib32/libc.so.1,-rpath,/lib32 # libtoolroot.so allows executables which were linked against the # current ROOT to be run on earlier versions of IRIX. TOOLROOTSAFE is # defined in releasedefs. TOOLROOTSAFE_O32 = _RLD_LIST=DEFAULT:$(TOOLROOT)/usr/lib/libtoolroot.so TOOLROOTSAFE_64 = _RLD64_LIST=DEFAULT:$(TOOLROOT)/usr/lib64/libtoolroot.so TOOLROOTSAFE_N32 = _RLDN32_LIST=DEFAULT:$(TOOLROOT)/usr/lib32/libtoolroot.so # # Flags to handle yacc and lex automatic dependency generation # We also use this to place woff's that are specific to yacc and lex. # These are all V4.X compiler warnings # 1167 - pointer points outside of underlying object # 1110 - statement is unreachable # 1174 - label "XXX" was declared but never referenced # 803,1685,1499 - ignore invalid woffs # YACCMKDEPFLAGS=-MDtarget $*.o -woff 1685,803,1499,1167,1110,1174 LEXMKDEPFLAGS=-MDtarget $*.o -woff 1685,803,1499,1167,1110,1174 # # Include directory shorthands, used in CFLAGS and LDFLAGS components. # INCLDIR = $(ROOT)/usr/include # # Convenient command macros that include the flags macros. # # You should always invoke make in makefiles via $(MAKE), as make passes # all command-line variables through the environment to sub-makes. # # Never use just $(CCF), etc. in rules that link executables; LDFLAGS # needs to be included after your objects in the command line. # ASF = $(AS) $(ASFLAGS) C++F = $(CXX) $(CXXFLAGS) CXXF = $(C++F) CCF = $(CC) $(CFLAGS) F77F = $(F77) $(FFLAGS) LDF = $(LD) $(LDFLAGS) LEXF = $(LEX) $(LFLAGS) PCF = $(PC) $(PFLAGS) YACCF = $(YACC) $(YFLAGS) # # Releasedefs defines compiler tool versions on an ABI basis. # We use that combined with OBJECT_STYLE to set some macros that can # be used in multi-version makefiles # #if $(OBJECT_STYLE:M32*) != "" VCC=$(VCC32) VCXX=$(VCXX32) VLD=$(VLD32) #elif $(OBJECT_STYLE:M64*) != "" VCC=$(VCC64) VCXX=$(VCXX64) VLD=$(VLD64) #elif $(OBJECT_STYLE:MN32*) != "" VCC=$(VCCN32) VCXX=$(VCXXN32) VLD=$(VLDN32) #else # This is of course what 'make' sets VCC= VCXX= VLD= #endif # # Rule macros for nonterminal makefiles that iterate over subdirectories, # making the current target. Set *SUBDIRS to the relevant list of kids. # # Set NOSUBMESG to any value to suppress a warning that subdirectories # are not present. This is useful with mandefs/rules # SUBDIR_MAKERULE= \ if test ! -d $$d; then \ if test "$(NOSUBMESG)" = "" ; then \ echo "SKIPPING $$d: No such directory."; \ fi \ else \ echo "\t(cd $$d; $(MAKE) $${RULE:=$@})"; \ (cd $$d; ${MAKE} $${RULE:=$@}); \ fi SUBDIRS_MAKERULE= \ @for d in $(SUBDIRS); do $(SUBDIR_MAKERULE); done HEADERS_SUBDIRS_MAKERULE= \ @for d in $(HEADERS_SUBDIRS); do $(SUBDIR_MAKERULE); done EXPORTS_SUBDIRS_MAKERULE= \ @for d in $(EXPORTS_SUBDIRS); do $(SUBDIR_MAKERULE); done # # One problem with the above rules is that if a make fails, and -k is # set, the entire for loop might stop. This is because make still can # (and XPG requires it) exit with an error status if the -k option is set. # This is an alternate rule for SUBDIRS when it is desired that -k keep # working on the next SUBDIR if the previous one failed. Its not quite # as compact a rule as the previous ones. # A standard usage would be: # default install $(COMMONTARGS): $(_FORCE) # $(MAKE) __DORULE=$@ $(SUBDIRS) # $(SUBDIRS): $(_FORCE) # @$(NSUBDIR_MAKERULE) NSUBDIR_MAKERULE= \ if test ! -d $@; then \ if test "$(NOSUBMESG)" = "" ; then \ echo "SKIPPING $@: No such directory."; \ fi \ else \ echo "\t(cd $@; $(MAKE) $(__DORULE))"; \ (cd $@; ${MAKE} $(__DORULE)); \ fi # # When CHECK_API is defined, have 7.2 compilers emit compressed # function prototypes into the .MIPS.interfaces section of .o files # destined for inclusion in libraries # #if defined(CHECK_API) && !defined(NO_CHECK_API) LIBRARY_API_CHECK=-DEBUG:full_interface_check #else LIBRARY_API_CHECK= #endif # # Library .c.o rule macros -- someday, cc -r will do the right thing and # the G-number will be happily forgotten. # LIBRARY_AS_MAKERULE= \ $(ASF) $(LIBRARY_API_CHECK) -o $*.o $< LIBRARY_CC_MAKERULE= \ $(CCF) $(LIBRARY_API_CHECK) -c $< LIBRARY_CXX_MAKERULE= \ $(CXXF) $(LIBRARY_API_CHECK) -c $< LIBRARY_C++_MAKERULE= \ $(C++F) $(LIBRARY_API_CHECK) -c $< # # The macro naming commonrules' always-unsatisfied target, which is useful # in directory dependencies to guarantee that even directories having future # mtimes due to timewarps will be "made". # _FORCE=$(COMMONPREF)_force # # Permit dependencies for Null-suffix targets # .MAKEOPTS: -N # # Convenience file list macros: # - Commondefs defines the following lists: SOURCES, enumerating all # source files; OBJECTS, the .o files derived from compilable source; # and DIRT, which lists intermediates and temporary files to be # removed by clean. # - The including (parent) makefile may define source file lists for # the standard suffixes: CFILES for .c, ASFILES for .s, YFILES for # .y, etc. We combine all such lists into SOURCES. The including # makefile need not define CFILES &c before including commondefs. # SOURCES=$(HFILES) $(ASFILES) $(C++FILES) $(CXXFILES) $(CFILES) $(EFILES) \ $(FFILES) $(LFILES) $(PFILES) $(RFILES) $(SHFILES) $(YFILES) CXXO1=$(CXXFILES:.c++=.o) $(C++FILES:.c++=.o) CXXO2=$(CXXO1:.cxx=.o) CXXO3=$(CXXO2:.C=.o) CXXOALL=$(CXXO3) YO1=$(YFILES:.y=.o) YO2=$(YO1:.yxx=.o) YO3=$(YO2:.Y=.o) YOALL=$(YO3) LO1=$(LFILES:.l=.o) LO2=$(LO1:.lxx=.o) LO3=$(LO2:.L=.o) LOALL=$(LO3) OBJECTS=$(ASFILES:.s=.o) $(CXXOALL) $(CFILES:.c=.o) $(EFILES:.e=.o) \ $(FFILES:.f=.o) $(LOALL) $(PFILES:.p=.o) $(RFILES:.r=.o) \ $(YOALL) # # Makefiles should set LDIRT only # # Make include files that extend commondefs should set XDIRT for dirt # generated by the extension. It should also provide an XfooDIRT macro for # the benefit of any extensions to itself. The intent is that the user's # Makefile will just worry about its own dirt. # DIRT=$(GDIRT) $(VDIRT) $(LDIRT) $(XDIRT) GDIRT=*.[oue] a.out core lex.yy.[co] y.tab.[cho] $(_FORCE) ar.tmp.* # # This exitop should be used by those who are building the FTR database. # The reason for this is that inst will sort a 'sort -u' on the exitops, # so if all of them are identical, we only do the work once. # A typical install line that uses the FTR_EXITOP_IDB should look similar # to this: # # $(INSTALL) $(FTR_EXITOP_IDB) -idb $(IDB_TAG) -m 444 -F $(FTRDIR) sgidemos.ftr# # IDB_TAG - is defined in the spec file for a given subsystem. # FTRDIR - is the directory usr/lib/filetype/{install,system,default} # sgidemos.ftr - is the ftr file that goes into FTRDIR. # FTR_EXITOP_IDB= -idb 'exitop( " \ if [ -r \$$rbase/usr/lib/filetype/Makefile ]; then \ chroot $$rbase /bin/sh -c \"cd /usr/lib/filetype; make > /dev/null\"; \ fi" )' # # Local definitions. These are used for debugging purposes. Make sure that # the product builds properly without the local definitions, unless you check # in the local definitions! # # To access a localdefs file outside the current directory, set LOCALDEFS on # the command line, and likewise for localrules. Or you can have localdefs # just sinclude the appropriate other include file. # LOCALDEFS = ./localdefs LOCALRULES = ./localrules sinclude $(LOCALDEFS)