Makefile.osarch
上传用户:sy_wanhua
上传日期:2013-07-25
资源大小:3048k
文件大小:5k
- # $Id: Makefile.osarch,v 1.9 2001/07/03 18:09:56 bko Exp $
- ######################################################################
- # these options are NECESSARY options for a give operating system or
- # architecture. If they could or should be turned off, they shouldn't
- # be here (or they should be wrapped in if code that is controllable
- # by Makefile.opt).
- ############################## FreeBSD ##############################
- # recent FreeBSDs (as of 6/1999) should have a sufficiently modern
- # version of ecgs to build this code cleanly with the default c++
- # compiler, but the releases generally don't. install the ecgs
- # port/package for older versions.
- ifeq ($(OSTYPE),FreeBSD)
- USE_LIBGETOPT = 1
- USE_R_WRAPPER = 1
- endif
- ############################## Linux ##############################
- ifeq ($(OSTYPE),Linux)
- CXXFLAGS += -D_REENTRANT
- CFLAGS += -D_REENTRANT
- LDLIBS_LAST += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
- endif
- ############################## Solaris ##############################
- ifeq ($(OSTYPE),SunOS)
- USE_LIBGETOPT = 1
- CFLAGS += -DSUNXIL_WARNING_DISABLE
- CXXFLAGS += -DSUNXIL_WARNING_DISABLE
- ifeq ($(VOCAL_TOOLCHAIN_TYPE),gnu)
- CXXFLAGS += -D_REENTRANT
- CFLAGS += -D_REENTRANT
- LDLIBS_LAST_PURE += -lnsl -lsocket -nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lc -lgcc -lm
- LDLIBS_LAST += -R/usr/local/lib -lnsl -lsocket
- # you may also need to override the version of AR to use GNU ar
- ifneq ($(VOCAL_AR_PATH),)
- AR = $(VOCAL_AR_PATH)
- endif
- else
- CXXFLAGS += -D_REENTRANT -mt -D_RWSTD_MULTI_THREAD -dalign -xarch=v8plus
- CFLAGS += -D_REENTRANT -xarch=v8plus
- LDFLAGS += -DTHREAD=MULTI -mt -dalign -xarch=v8plus -L/opt/SUNWspro/WS6/lib/rw7 -L/opt/SUNWspro/WS6/lib/
- LDLIBS_LAST_PURE += -lnsl -lsocket -lm
- LDLIBS_LAST += -lrwtool -liostream -lnsl -lsocket -lCstd
- ifeq ($(USE_VARARG_HACK),1)
- CFLAGS+= -DVARARG_HACK
- CXXFLAGS+= -DVARARG_HACK
- FILEPP = $(HOME)/filepp-1.2.0/filepp
- endif
- endif
- endif
- ifeq ($(OSTYPE),cygwin)
- USE_LIBGETOPT = 1
- CFLAGS += -I$(ROOT)/contrib/win32/mingw/include -I$(ROOT)/contrib/win32/pthreads
- CXXFLAGS += -I$(ROOT)/contrib/win32/mingw/include -I$(ROOT)/contrib/win32/pthreads
- endif
- ifeq ($(VOCAL_PROCESSOR_OPTS),1)
- ifeq ($(ARCH),i686)
- CXXFLAGS += -march=i686
- CFLAGS += -march=i686
- LDFLAGS +=
- LDLIBS +=
- endif
- endif
- # set up general compilation options
- LDFLAGS +=
- CXXFLAGS += -DUSE_PTHREADS
- CFLAGS += -DUSE_PTHREADS
- LDLIBS +=
- INCDIRS += $(BUILD)
- ######################################################################
- # this section lets you override the default compile type
- ######################################################################
- ifdef CODE_OPTIMIZE
- VOCAL_COMPILE_TYPE := opt
- endif
- ifdef CODE_PROFILE
- VOCAL_COMPILE_TYPE := prof
- endif
- ifdef CODE_NODEBUG
- VOCAL_COMPILE_TYPE := nodebug
- endif
- TARGET_TYPE := $(VOCAL_COMPILE_TYPE)
- ifeq ($(VOCAL_COMPILE_TYPE),nodebug)
- endif
- ifeq ($(VOCAL_COMPILE_TYPE),debug)
- CXXFLAGS += $(DEBUG_FLAG)
- CFLAGS += $(DEBUG_FLAG)
- endif
- ifeq ($(VOCAL_COMPILE_TYPE),opt)
- ifneq ($(CODE_OPTIMIZE), 1)
- CXXFLAGS += -O$(CODE_OPTIMIZE) -DCODE_OPTIMIZE
- CFLAGS += -O$(CODE_OPTIMIZE) -DCODE_OPTIMIZE
- else
- CXXFLAGS += -O -DCODE_OPTIMIZE
- CFLAGS += -O -DCODE_OPTIMIZE
- endif
- endif
- # profiling
- ifeq ($(VOCAL_COMPILE_TYPE),prof)
- # we know how to profile using GCC
- ifdef USE_GCC
- LDFLAGS += -pg
- CXXFLAGS += -pg
- CFLAGS += -pg
- endif
- endif
- ifeq ($(USE_YARROW),1)
- DEFINES += USE_CRYPTO_RANDOM
- endif
- ifeq ($(VOCAL_USE_DEPRECATED),1)
- DEFINES += VOCAL_USE_DEPRECATED
- endif
- ifeq ($(VOCAL_WARN_DEPRECATED),1)
- DEFINES += VOCAL_WARN_DEPRECATED
- endif
- ifeq ($(ARCH),i586)
- DEFINES += VOCAL_USING_PENTIUM
- endif
- ifeq ($(ARCH),i686)
- DEFINES += VOCAL_USING_PENTIUM
- endif
- ######################################################################
- # More Toolchain defaults
- ######################################################################
- ifeq ($(OSCLASS),VXWORKS)
- # these are VxWorks defaults
- # by default, we will use a real linker as the linker
- ifndef LINKER
- LINKER = $(LD)
- endif
- LDFLAGS += -Ur
- endif
- # SH hardware -- this code should actually be separated as this is
- # toolchain stuff, by and large.
- ifeq ($(ARCH),sh)
- CXX=sh-wrs-vxworks-g++
- DEP=sh-wrs-vxworks-gcc
- CC=sh-wrs-vxworks-gcc
- AR=sh-wrs-vxworks-ar
- LD=sh-wrs-vxworks-ld
- CROSS_COMPILE=1
- DEFINES += BSD43_COMPATIBLE
- CXXFLAGS +=
- CFLAGS +=
- LDFLAGS += -L/usr/local/lib/gcc-lib/sh-wrs-vxworks/2.95.1/m2
- LDLIBS_LAST += -lstdc++ -lgcc
- OSCLASS = VXWORKS
- USE_LEAKTRACE=
- endif
- OS_ARCH := $(OSTYPE).$(ARCH)
- TARGET_NAME := $(TARGET_TYPE).$(OS_ARCH)