📄 makefile
字号:
# Macros# The option (if any) to the compiler specifies ANSI compilation. Please note compiler# versions (sun_svr4) may be different.################################################################################ Makefile for Open Server sample programs##############################################################################SYBPLATFORM=nthread_rs6000MAKE = make CC="$(CC)" AS="$(AS)" LD="$(LD)" AR="$(AR)" CPP="$(CPP)" \ NETLIBS="$(NETLIBS)" SYBPLATFORM="$(SYBPLATFORM)"# These variables refer to the common build tools# You should check to be sure that they point to the appropriate# location for your installation.# CC especially may need to be changed if your site has an enhanced# 'C' compiler# Note that the macro GETCC below will attempt to properly set# your CC variable. However, you may want to hardcode the value# and bypass the macro (which is called for each compile)# CPP C pre-processor# AR Object archiver / librarian# CC Compiler# SHELLCPP=/lib/cppAR=/bin/ar# CC=/opt/SUNWspro/bin/cc# CC=gccSHELL=/bin/sh#xlc_r4 -I$SYBASE/include -L$SYBASE/lib -g -D_THREAD_SAFE \# APP_FILES OCS_LIBS -lcs_r -ltcl_dce -lcomn_dce -lintl_r \# -lxdsxom -ldce -lm -o program## What target name is, and where it is located#TARGET1 = rsa_t ## Where to get includes and libraries#INCPATH = .RELDIR = $(SYBASE)/$(SYBASE_OCS)PINCPATH = $(RELDIR)/includeLIBPATH = $(RELDIR)/lib#SYSLIBS = -lm## source and include files#SRC1 = openssl.c rsautl.c app_rand.c apps.cOBJ1 = $(SRC1:.c=.o)HDR1 = # Use -DDEBUG only if linking with devlib/*#DEFS = -DDEBUG -D$(SYBPLATFORM)=1DEFS = -D$(SYBPLATFORM)=1INC = -I$(INCPATH) -I$(PINCPATH) -I./zlibGCCFLAGS = -ansi -pedantic -Wall -Wtraditional -Wshadow -Wpointer-arith \ -pipeCFLAGS = -g $(INC) $(DEFS)#CFLAGS = -g -static $(INC) $(DEFS)# CFLAGS = -g $(GCCFLAGS) $(INC) $(DEFS)# LDFLAGS = -Bstatic -g## LINK = $(CC) $(LDFLAGS)SET_SYBPLATFORM_MSG="Unknown machine type. Please set SYBPLATFORM variable"#GETCC=\# case $(SYBPLATFORM) in \# axposf) CC=cc ;; \# nthread_axposf) CC="cc -threads " ;; \# linux) CC=cc ;; \# nthread_linux) CC="cc -D_REENTRANT " ;; \# rs6000) CC=xlc -qalign=packed ;; \# rs600064) CC="xlc -q64 -qarch=ppc64 -qtune=620 -qalign=packed" ;; \# nthread_rs6000) CC="xlc_r -qalign=packed -D_THREAD_SAFE -D_LARGE_THREADS " ;; \# nthread_rs600064) CC="xlc_r -q64 -qarch=ppc64 -qtune=620 -qalign=packed -D_THREAD_SAFE " ;; \# sun_svr4) CC="cc -Xc" ;; \# nthread_sun_svr4) CC="cc -Xc -D_REENTRANT" ;; \# sun_svr464) CC="cc -Xc -DSYB_LP64 -xarch=v9" ;; \# nthread_sun_svr464) CC="cc -Xc -DSYB_LP64 -D_REENTRANT -xarch=v9" ;; \# hpux) CC="cc -Ae +Z +DA1.1 +DS2.0" ;; \# nthread_hpux) CC="cc -D_POSIX_C_SOURCE=199506L -Ae +Z +DA1.1 +DS2.0" ;; \# hpux64) CC="cc -DSYB_LP64 -Ae -DANSI_VARARGS +Z +DA2.0W +DS2.0 -Wp,-H256000" ;; \# nthread_hpux64) CC="cc -DSYB_LP64 -Ae -DANSI_VARARGS +Z +DA2.0W +DS2.0 -Wp,-H256000" ;; \# sgi|nthread_sgi) CC="cc -n32 -mips4";; \# sgi64|nthread_sgi64) CC="cc -64 -mips4";; \# *) echo "$(SET_SYBPLATFORM_MSG)"; exit 1;; \# esac ; \# LINK="$$CC $(LDFLAGS)" GETCC=\ case $(SYBPLATFORM) in \ axposf) CC=cc ;; \ nthread_axposf) CC="cc -threads " ;; \ linux) CC=cc ;; \ nthread_linux) CC="cc -D_REENTRANT " ;; \ rs6000) CC=xlc -D_LARGE_THREADS;; \ rs600064) CC="xlc -q64 -qarch=ppc64 -qtune=620 " ;; \ nthread_rs6000) CC="xlc_r -D_THREAD_SAFE -DMONOLITH " ;; \ nthread_rs600064) CC="xlc_r -q64 -qarch=ppc64 -qtune=620 -D_THREAD_SAFE " ;; \ sun_svr4) CC="cc -Xc" ;; \ nthread_sun_svr4) CC="cc -Xc -D_REENTRANT" ;; \ sun_svr464) CC="cc -Xc -DSYB_LP64 -xarch=v9" ;; \ nthread_sun_svr464) CC="cc -Xc -DSYB_LP64 -D_REENTRANT -xarch=v9" ;; \ hpux) CC="cc -Ae +Z +DA1.1 +DS2.0" ;; \ nthread_hpux) CC="cc -D_POSIX_C_SOURCE=199506L -Ae +Z +DA1.1 +DS2.0" ;; \ hpux64) CC="cc -DSYB_LP64 -Ae -DANSI_VARARGS +Z +DA2.0W +DS2.0 -Wp,-H256000" ;; \ nthread_hpux64) CC="cc -DSYB_LP64 -Ae -DANSI_VARARGS +Z +DA2.0W +DS2.0 -Wp,-H256000" ;; \ sgi|nthread_sgi) CC="cc -n32 -mips4";; \ sgi64|nthread_sgi64) CC="cc -64 -mips4";; \ *) echo "$(SET_SYBPLATFORM_MSG)"; exit 1;; \ esac ; \ LINK="$$CC $(LDFLAGS)" GETNETLIBS=\ case $(SYBPLATFORM) in \ *axposf) NETLIBS=" $$NETSCKLIBS $(SDNALIB)" ;; \ sgi|sgi64|rs600064) NETLIBS="" ;; \ nthread_sgi) NETLIBS="" ;; \ nthread_sgi64|nthread_rs600064) NETLIBS="" ;; \ rs6000) NETLIBS="" ;; \ hpux|nthread_hpux) NETLIBS="" ;; \ hpux64|nthread_hpux64) NETLIBS="" ;; \ nthread_rs6000) NETLIBS="" ;; \ sun_svr4) NETLIBS="" ;; \ nthread_sun_svr4) NETLIBS="" ;; \ sun_svr464) NETLIBS="" ;; \ nthread_sun_svr464) NETLIBS="" ;; \ linux|nthread_linux) NETLIBS=" $$NETSCKLIBS" ;; \ *) echo "$(SET_SYBPLATFORM_MSG)"; exit 1;; \ esac## SYSLIBS:# The list of system libraries that are required in order # to build a Sybase Open Client/Server application, in the order in # which they must be linked.GETSYSLIBS=\ case "${SYBPLATFORM}" in \ sun_svr4|sun_svr464) SYSLIBS=" -B dynamic -lnsl -ldl -lm" ;; \ nthread_sun_svr4) SYSLIBS=" -B dynamic -lnsl -ldl -lpthread -lm" ;; \ nthread_sun_svr464) SYSLIBS=" -B dynamic -lnsl -ldl -lpthread -lm" ;; \ sgi|sgi64) SYSLIBS=" -B dynamic " ;; \ nthread_sgi) SYSLIBS=" -B dynamic -lpthread -lm" ;; \ nthread_sgi64) SYSLIBS=" -B dynamic -lpthread -lm" ;; \ hpux) SYSLIBS=" -Wl -lcl -lm -lBSD -ldld -Wl,-E,+s " ;; \ hpux64) SYSLIBS=" -Wl -lcl -lm -ldld -Wl,-E,+s " ;; \ nthread_hpux) SYSLIBS=" -lpthread -lrt -lcl -lm -lBSD -ldld -Wl,-E,+s " ;; \ nthread_hpux64) SYSLIBS=" -lpthread -lrt -lcl -lm -ldld -Wl,-E,+s " ;; \ rs6000) SYSLIBS=" -lm" ;; \ nthread_rs6000) SYSLIBS=" -lm" ;; \ rs600064) SYSLIBS=" -lm" ;; \ nthread_rs600064) SYSLIBS=" -lm" ;; \ axposf) SYSLIBS=" -oldstyle_liblookup -lm" ;; \ nthread_axposf) SYSLIBS=" -threads -oldstyle_liblookup " ;; \ linux) SYSLIBS=" -rdynamic -ldl -lnsl -lm" ;; \ nthread_linux) SYSLIBS=" -rdynamic -ldl -lpthread -lnsl -lm" ;; \ *) echo " $SET_SYBPLATFORM_MSG "; exit 1;; \ esac#GETOSLIBS=\# case $(SYBPLATFORM) in \# axposf) OSLIBS=" -lm" ;; \# nthread_axposf) OSLIBS=" -lm -threads " ;; \# rs6000|rs600064) OSLIBS=" -lm" ;; \# sgi|sgi64) OSLIBS=" -lm" ;; \# nthread_sgi) OSLIBS=" -B dynamic -lpthread -lm" ;;\# nthread_sgi64) OSLIBS=" -B dynamic -lpthread -lm" ;;\# nthread_rs6000|nthread_rs600064) OSLIBS=" -lm -lpthread" ;; \# sun_svr4|sun_svr464) OSLIBS=" -lm -B dynamic -lnsl -ldl" ;; \# nthread_sun_svr4) OSLIBS=" -lm -lnsl -lpthread -lsocket -B dynamic -ldl" ;; \# nthread_sun_svr464) OSLIBS=" -lm -lnsl -lpthread -lsocket -B dynamic -ldl" ;; \# hpux) OSLIBS=" -Wl -lcl -lm -lBSD -ldld -Wl,-E,+s" ;; \# hpux64) OSLIBS=" -Wl -lcl -lm -ldld -Wl,-E,+s" ;; \# nthread_hpux) OSLIBS=" -lpthread -lrt -lcl -lm -lBSD -ldld -Wl,-E,+s " ;; \# nthread_hpux64) OSLIBS=" -lpthread -lrt -lcl -lm -ldld -Wl,-E,+s " ;; \# linux) OSLIBS=" -rdynamic -ldl -lnsl -lm" ;; \# nthread_linux) OSLIBS=" -rdynamic -ldl -lpthread -lnsl -lm" ;; \# *) echo "$(SET_SYBPLATFORM_MSG)"; exit 1;; \# esac GETOSLIBS=\ case $(SYBPLATFORM) in \ axposf) OSLIBS=" -lm" ;; \ nthread_axposf) OSLIBS=" -lm -threads " ;; \ rs6000|rs600064) OSLIBS=" -lm" ;; \ sgi|sgi64) OSLIBS=" -lm" ;; \ nthread_sgi) OSLIBS=" -B dynamic -lpthread -lm" ;;\ nthread_sgi64) OSLIBS=" -B dynamic -lpthread -lm" ;;\ nthread_rs6000|nthread_rs600064) OSLIBS=" -lm" ;; \ sun_svr4|sun_svr464) OSLIBS=" -lm -B dynamic -lnsl -ldl" ;; \ nthread_sun_svr4) OSLIBS=" -lm -lnsl -lpthread -lsocket -B dynamic -ldl" ;; \ nthread_sun_svr464) OSLIBS=" -lm -lnsl -lpthread -lsocket -B dynamic -ldl" ;; \ hpux) OSLIBS=" -Wl -lcl -lm -lBSD -ldld -Wl,-E,+s" ;; \ hpux64) OSLIBS=" -Wl -lcl -lm -ldld -Wl,-E,+s" ;; \ nthread_hpux) OSLIBS=" -lpthread -lrt -lcl -lm -lBSD -ldld -Wl,-E,+s " ;; \ nthread_hpux64) OSLIBS=" -lpthread -lrt -lcl -lm -ldld -Wl,-E,+s " ;; \ linux) OSLIBS=" -rdynamic -ldl -lnsl -lm" ;; \ nthread_linux) OSLIBS=" -rdynamic -ldl -lpthread -lnsl -lm" ;; \ *) echo "$(SET_SYBPLATFORM_MSG)"; exit 1;; \ esac## $KRBLIBS contains additional link options required to run# with the CyberSAFE Kerberos security driver#GETKRBLIBS=\ case $(SYBPLATFORM) in \ sun_svr4|nthread_sun_svr4) \ KRBLIBS=" -u csfgss_pPtr -Bdynamic -L/krb5/lib -lgss -lcsfk5 -lsocket " ;; \ hpux|nthread_hpux) \ KRBLIBS=" -Wl,-u,csfgss_pPtr -L/krb5/lib -lgss " ;; \ nthread_rs6000) \ KRBLIBS=;; \ *) \ echo "CyberSAFE security driver not available on this platform"; \ exit 1;; \ esac# DCE libraries have been re-namedGETSYBLIBS=\ case "$(SYBPLATFORM)" in \ nthread_axposf|nthread_sun_svr4|nthread_hpux) \ SRVLIB="$(LIBPATH)/libsrv_r.a"; \ BLKLIB="$(LIBPATH)/libblk_r.a"; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libtcl_r.a; \ COMNLIB=$(LIBPATH)/libcomn_r.a; \ CTLIB=$(LIBPATH)/libct_r.a; \ CSLIB=$(LIBPATH)/libcs_r.a; \ INTLIB=$(LIBPATH)/libintl_r.a; \ SDNALIB=$(LIBPATH)/libsdna.a; \ DCEDRVS="$(LIBPATH)/libsdce.a $(LIBPATH)/libddce.a"; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ sun_svr464|hpux64) \ SRVLIB="$(LIBPATH)/libsrv64.a"; \ BLKLIB="$(LIBPATH)/libblk64.a"; \ DBLIB=$(LIBPATH)/libsybdb64.a; \ NETLIB=$(LIBPATH)/libtcl64.a; \ COMNLIB=$(LIBPATH)/libcomn64.a; \ CTLIB=$(LIBPATH)/libct64.a; \ CSLIB=$(LIBPATH)/libcs64.a; \ INTLIB=$(LIBPATH)/libintl64.a; \ SDNALIB=; \ DCEDRVS="$(LIBPATH)/libsdce64.a $(LIBPATH)/libddce64.a"; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ nthread_sun_svr464|nthread_hpux64) \ SRVLIB="$(LIBPATH)/libsrv_r64.a"; \ BLKLIB="$(LIBPATH)/libblk_r64.a"; \ DBLIB=$(LIBPATH)/libsybdb64.a; \ NETLIB=$(LIBPATH)/libtcl_r64.a; \ COMNLIB=$(LIBPATH)/libcomn_r64.a; \ CTLIB=$(LIBPATH)/libct_r64.a; \ CSLIB=$(LIBPATH)/libcs_r64.a; \ INTLIB=$(LIBPATH)/libintl_r64.a; \ SDNALIB=; \ DCEDRVS="$(LIBPATH)/libsdce64.a $(LIBPATH)/libddce64.a"; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ nthread_rs6000|nthread_sgi) \ SRVLIB="$(LIBPATH)/libsrv_r.a"; \ BLKLIB="$(LIBPATH)/libblk_r.a"; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libtcl_r.a; \ COMNLIB=$(LIBPATH)/libcomn_r.a; \ CTLIB=$(LIBPATH)/libct_r.a; \ CSLIB=$(LIBPATH)/libcs_r.a; \ INTLIB=$(LIBPATH)/libintl_r.a; \ SDNALIB=; \ DCEDRVS="$(LIBPATH)/libsdce $(LIBPATH)/libddce"; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ nthread_linux) \ SRVLIB="$(LIBPATH)/libsrv_r.a"; \ BLKLIB="$(LIBPATH)/libblk_r.a"; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libsybtcl_r.a; \ COMNLIB=$(LIBPATH)/libcomn_r.a; \ CTLIB=$(LIBPATH)/libct_r.a; \ CSLIB=$(LIBPATH)/libcs_r.a; \ INTLIB=$(LIBPATH)/libintl_r.a; \ SDNALIB=; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ nthread_sgi64|nthread_rs600064) \ SRVLIB="$(LIBPATH)/libsrv_r64.a"; \ BLKLIB="$(LIBPATH)/libblk_r64.a"; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libtcl_r64.a; \ COMNLIB=$(LIBPATH)/libcomn_r64.a; \ CTLIB=$(LIBPATH)/libct_r64.a; \ CSLIB=$(LIBPATH)/libcs_r64.a; \ INTLIB=$(LIBPATH)/libintl_r64.a; \ SDNALIB=; \ DCEDRVS="$(LIBPATH)/libsdce64 $(LIBPATH)/libddce64"; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ sgi64|rs600064) \ BLKLIB=$(LIBPATH)/libblk64.a; \ SRVLIB=$(LIBPATH)/libsrv64.a; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libtcl64.a; \ COMNLIB=$(LIBPATH)/libcomn64.a; \ CTLIB=$(LIBPATH)/libct64.a; \ CSLIB=$(LIBPATH)/libcs64.a; \ INTLIB=$(LIBPATH)/libintl64.a; \ SDNALIB=; \ NETSCKLIBS=; \ NETTLILIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ axposf|sgi|rs6000|hpux|sun_svr4) \ BLKLIB=$(LIBPATH)/libblk.a; \ SRVLIB=$(LIBPATH)/libsrv.a; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libtcl.a; \ COMNLIB=$(LIBPATH)/libcomn.a; \ CTLIB=$(LIBPATH)/libct.a; \ CSLIB=$(LIBPATH)/libcs.a; \ INTLIB=$(LIBPATH)/libintl.a; \ SDNALIB=; \ NETSCKLIBS=; \ NETTLILIBS=$(LIBPATH)/libtli.a; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ linux) \ BLKLIB=$(LIBPATH)/libblk.a; \ SRVLIB=$(LIBPATH)/libsrv.a; \ DBLIB=$(LIBPATH)/libsybdb.a; \ NETLIB=$(LIBPATH)/libsybtcl.a; \ COMNLIB=$(LIBPATH)/libcomn.a; \ CTLIB=$(LIBPATH)/libct.a; \ CSLIB=$(LIBPATH)/libcs.a; \ INTLIB=$(LIBPATH)/libintl.a; \ SDNALIB=; \ NETSCKLIBS=; \ LOCLIBS="$$CSLIB $$COMNLIB $$INTLIB";; \ *) echo "$(SET_SYBPLATFORM_MSG)"; exit 1;; \ esac############################################################################## ## Default Build Rules############################################################################### .SUFFIXES: .c .o.c.o: $(GETCC); \ $$CC $(CFLAGS) -c $<# The secsrv_dce and secsrv_krb targets are not built by 'make all' because# they are platform specific.all: $(TARGET1) $(TARGET1): $(OBJ1) echo linking $@ ; \ $(GETCC); \ $(GETSYBLIBS); \ $(GETNETLIBS); \ $(GETOSLIBS); \ echo "$$CC $(OBJ1) $$CTLIB $$NETLIB $$NETLIBS $$LOCLIBS $$OSLIBS -o $@"; \ $$CC $(OBJ1) $$BLKLIB $$CTLIB $$SRVLIB $$CRYPTLIB ./openssl/libcrypto.a ./openssl/libssl.a \ $$NETLIB $$NETLIBS $$LOCLIBS $$OSLIBS -o $@$(OBJ1): $(HDR1)clean: rm -f *.o *.ln *.out clean1: rm -f *.o $(TARGET1) clobber: clean rm -f $(TARGET1) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -