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

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