File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / pgsql / pgsql.mak
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:59 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

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

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