Annotation of embedaddon/php/ext/openssl/openssl.mak, revision 1.1

1.1     ! misho       1: # Temporarily here -- later may go into some batch file
        !             2: # which will set this as an environment variable
        !             3: PROJECT_ROOT = ..\..
        !             4: 
        !             5: # Module details
        !             6: MODULE_NAME = php_ossl
        !             7: MODULE_DESC = "PHP 5 - OpenSSL Extension"
        !             8: VMAJ = 1
        !             9: VMIN = 0
        !            10: VREV = 0
        !            11: 
        !            12: #include the common settings
        !            13: include $(PROJECT_ROOT)/netware/common.mif
        !            14: 
        !            15: # OpenSSL directory
        !            16: OSSL_DIR = P:/APPS/script/sw/OpenSSL
        !            17: 
        !            18: # Build type defaults to 'release'
        !            19: ifndef BUILD
        !            20: BUILD = release
        !            21: endif
        !            22: 
        !            23: # Extensions of all input and output files
        !            24: .SUFFIXES:
        !            25: .SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d
        !            26: 
        !            27: # Source files
        !            28: C_SRC = openssl.c \
        !            29:         xp_ssl.c \
        !            30:         start.c \
        !            31: 
        !            32: CPP_SRC_NODIR = $(notdir $(CPP_SRC))
        !            33: C_SRC_NODIR = $(notdir $(C_SRC))
        !            34: SRC_DIR = $(dir $(CPP_SRC) $(C_SRC))
        !            35: 
        !            36: # Library files
        !            37: LIBRARY = $(OSSL_DIR)/lib/RSAglue.lib  \
        !            38:           $(OSSL_DIR)/lib/crypto.lib   \
        !            39:           $(OSSL_DIR)/lib/ssl.lib      
        !            40:               
        !            41: # Destination directories and files
        !            42: OBJ_DIR = $(BUILD)
        !            43: FINAL_DIR = $(BUILD)
        !            44: MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map
        !            45: OBJECTS  = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj))
        !            46: DEPDS  = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d))
        !            47: 
        !            48: # Binary file
        !            49: ifndef BINARY
        !            50:        BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
        !            51: endif
        !            52: 
        !            53: # Compile flags
        !            54: C_FLAGS += -c -maxerrors 25 -msgstyle gcc
        !            55: C_FLAGS += -wchar_t on -bool on -processor Pentium
        !            56: C_FLAGS += -nostdinc -nosyspath  
        !            57: C_FLAGS += -relax_pointers             # To remove type-casting errors
        !            58: C_FLAGS += -DNETWARE -DZTS
        !            59: C_FLAGS += -DUSE_OLD_FUNCTIONS -DCOMPILE_DL_OPENSSL=1
        !            60: 
        !            61: C_FLAGS += -I. -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main
        !            62: C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware
        !            63: C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm
        !            64: C_FLAGS += -I- -I$(SDK_DIR)/include -I$(MWCIncludes)
        !            65: C_FLAGS += -I$(OSSL_DIR)/include
        !            66: 
        !            67: ifndef STACK_SIZE
        !            68: STACK_SIZE=8192
        !            69: endif
        !            70: 
        !            71: # Extra stuff based on debug / release builds
        !            72: ifeq '$(BUILD)' 'debug'
        !            73:        SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
        !            74:        C_FLAGS  += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON
        !            75:        C_FLAGS += -exc cw -DZEND_DEBUG=1
        !            76:        LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE)
        !            77:        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
        !            78: else
        !            79:        C_FLAGS  += -opt all -inline on -inline smart -inline auto -sym off 
        !            80:        C_FLAGS += -opt intrinsics -opt level=4 -DZEND_DEBUG=0
        !            81:        LD_FLAGS += -sym off
        !            82:        export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
        !            83: endif
        !            84: 
        !            85: 
        !            86: # Dependencies
        !            87: MODULE = LibC   \
        !            88:          phplib
        !            89: IMPORT = @$(SDK_DIR)/imports/libc.imp        \
        !            90:          @$(SDK_DIR)/imports/ws2nlm.imp      \
        !            91:          @$(SDK_DIR)/imports/netware.imp     \
        !            92:          @$(MPK_DIR)/import/mpkOrg.imp       \
        !            93:          @$(PROJECT_ROOT)/netware/phplib.imp
        !            94: EXPORT = ($(MODULE_NAME)) get_module
        !            95: API = OutputToScreen
        !            96: 
        !            97: # Virtual paths
        !            98: vpath %.cpp .
        !            99: vpath %.c . ..\..\netware
        !           100: vpath %.obj $(OBJ_DIR)
        !           101: 
        !           102: 
        !           103: all: prebuild project
        !           104: 
        !           105: .PHONY: all
        !           106: 
        !           107: prebuild:
        !           108:        @if not exist $(OBJ_DIR) md $(OBJ_DIR)
        !           109: 
        !           110: project: $(BINARY)
        !           111:        @echo Build complete.
        !           112: 
        !           113: $(OBJ_DIR)/%.d: %.cpp
        !           114:        @echo Building Dependencies for $(<F)
        !           115:        @$(CC) -M $< $(C_FLAGS) -o $@
        !           116: 
        !           117: $(OBJ_DIR)/%.d: %.c
        !           118:        @echo Building Dependencies for $(<F)
        !           119:        @$(CC) -M $< $(C_FLAGS) -o $@
        !           120: 
        !           121: $(OBJ_DIR)/%.obj: %.cpp
        !           122:        @echo Compiling $?...
        !           123:        @$(CC) $< $(C_FLAGS) -o $@
        !           124:        
        !           125: $(OBJ_DIR)/%.obj: %.c
        !           126:        @echo Compiling $?...
        !           127:        @$(CC) $< $(C_FLAGS) -o $@
        !           128: 
        !           129: 
        !           130: $(BINARY): $(OBJECTS)
        !           131:        @echo Import $(IMPORT) > $(basename $@).def
        !           132: ifdef API
        !           133:        @echo Import $(API) >> $(basename $@).def
        !           134: endif
        !           135:        @echo Module $(MODULE) >> $(basename $@).def
        !           136: ifdef EXPORT
        !           137:        @echo Export $(EXPORT) >> $(basename $@).def
        !           138: endif
        !           139:        @echo AutoUnload >> $(basename $@).def
        !           140: ifeq '$(BUILD)' 'debug'
        !           141:        @echo Debug >> $(basename $@).def
        !           142: endif
        !           143:        @echo Flag_On 0x00000008 >> $(basename $@).def
        !           144:        @echo Start _LibCPrelude >> $(basename $@).def
        !           145:        @echo Exit _LibCPostlude >> $(basename $@).def
        !           146: 
        !           147: # Two functions imported to build the openssl extension
        !           148:        @echo Import GetProcessSwitchCount   >> $(basename $@).def
        !           149:        @echo Import RunningProcess   >> $(basename $@).def
        !           150: 
        !           151:        $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc
        !           152:        @echo xdcdata $(basename $@).xdc >> $(basename $@).def
        !           153: 
        !           154:        @echo Linking $@...
        !           155:        @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
        !           156: 
        !           157:        @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link
        !           158: 
        !           159:        @$(LINK) @$(basename $@).link
        !           160: 
        !           161: 
        !           162: .PHONY: clean
        !           163: clean: cleanobj cleanbin
        !           164: 
        !           165: .PHONY: cleand
        !           166: cleand:
        !           167:        @echo Deleting all dependency files...
        !           168:        -@del "$(OBJ_DIR)\*.d"
        !           169: 
        !           170: .PHONY: cleanobj
        !           171: cleanobj:
        !           172:        @echo Deleting all object files...
        !           173:        -@del "$(OBJ_DIR)\*.obj"
        !           174: 
        !           175: .PHONY: cleanbin
        !           176: cleanbin:
        !           177:        @echo Deleting binary files...
        !           178:        -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
        !           179:        @echo Deleting MAP, DEF files, etc....
        !           180:        -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
        !           181:        -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
        !           182:        -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
        !           183: ifeq '$(BUILD)' 'debug'
        !           184:        -@del $(FINAL_DIR)\$(MODULE_NAME).sym
        !           185: endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>