# (C) Copyright Christopher Currie, Gennadiy Rozental 2002. # Permission to copy, use, modify, sell and distribute this software # is granted provided this copyright notice appears in all copies. # This software is provided "as is" without express or implied warranty, # and with no claim as to its suitability for any purpose. # Sun Workshop 6 C++ compiler # singleton variables... set-as-singleton SUNPRO_ROOT SUNPRO_BIN_PATH ; # compute sunpro bin path # You can either put the sunpro bin directory in your PATH, or you can set # SUNPRO_ROOT to point at the sunpro installation directory, or you can set # SUNPRO_BIN_PATH to point at sunpro bin directory SUNPRO_BIN_PATH = $(SUNPRO_ROOT)$(SLASH)bin$(SLASH) ; SUNPRO_BIN_PATH ?= "" ; # Don't clobber adjoining text if SUNPRO_ROOT isn't set flags sunpro LINKFLAGS static : -staticlib=Crun ; flags sunpro LINKFLAGS $(SHARED_TYPES) : -G ; flags sunpro CFLAGS on : -g ; flags sunpro LINKFLAGS on : -g ; flags sunpro CFLAGS speed : -fast -O4 ; flags sunpro CFLAGS space : -O2 -xspace ; flags sunpro C++FLAGS off : +d ; flags sunpro CFLAGS multi : -mt ; flags sunpro LINKFLAGS multi : -lrt ; flags sunpro C++FLAGS on : -features=rtti ; flags sunpro C++FLAGS off : -features=no%rtti ; flags sunpro C++FLAGS on : -features=except ; flags sunpro C++FLAGS off : -features=no%except ; # architecture/instruction-set options, a la gcc .ARCH = sparc native ; flags sunpro CFLAGS native/default : -xtarget=generic ; flags sunpro CFLAGS $(.ARCH)/v7 : -xarch=v7 ; flags sunpro CFLAGS $(.ARCH)/v8 : -xarch=v8 ; flags sunpro CFLAGS $(.ARCH)/v9 : -xarch=v9 ; flags sunpro CFLAGS $(.ARCH)/supersparc : -xarch=v8 -xchip=super ; flags sunpro CFLAGS $(.ARCH)/hypersparc : -xarch=v8 -xchip=hyper ; flags sunpro CFLAGS $(.ARCH)/ultrasparc : -xarch=v8plus -xchip=ultra ; flags sunpro CFLAGS ; flags sunpro C++FLAGS ; flags sunpro DEFINES ; flags sunpro UNDEFS ; flags sunpro HDRS ; flags sunpro STDHDRS ; flags sunpro LINKFLAGS ; flags sunpro LINKFLAGS off : -s ; flags sunpro ARFLAGS ; flags sunpro LIBPATH ; flags sunpro NEEDLIBS ; flags sunpro FINDLIBS ; flags sunpro TARGET_TYPE ; #### Link #### rule Link-action { sunpro-Link-action $(<) : $(>) ; } actions together sunpro-Link-action bind NEEDLIBS { $(SUNPRO_BIN_PATH)CC -o "$(<:T)" -xildoff -L$(LIBPATH) $(LINKFLAGS) "$(>:T)" "$(NEEDLIBS)" "-l$(FINDLIBS)" } #### Archive #### rule Archive-action { sunpro-Archive-action $(<) : $(>) ; } actions together sunpro-Archive-action { $(SUNPRO_BIN_PATH)CC -xar $(ARFLAGS) -o "$(<:T)" "$(>:T)" } #### Cc ##### rule Cc-action { SPACE on $(<) = " " ; sunpro-Cc-action $(<) : $(>) ; } actions sunpro-Cc-action { $(SUNPRO_BIN_PATH)cc -c -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" } #### C++ #### rule C++-action { SPACE on $(<) = " " ; sunpro-C++-action $(<) : $(>) ; } actions sunpro-C++-action { $(SUNPRO_BIN_PATH)CC -c -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" }