| 1 |
|
| 2 |
all: updateCloopInterfaces |
| 3 |
|
| 4 |
CLOOP=$(FB_GEN_DIR)\cloop.exe |
| 5 |
CLOOP_DIR=$(FB_ROOT_PATH)\extern\cloop\src\cloop |
| 6 |
CLOOP_SRC=$(CLOOP_DIR)\*.cpp |
| 7 |
|
| 8 |
IDL_ROOT=$(FB_ROOT_PATH)\src\include\firebird |
| 9 |
IDL_FILE=$(IDL_ROOT)\FirebirdInterface.idl |
| 10 |
API_H_FILE=$(IDL_ROOT)\IdlFbInterfaces.h |
| 11 |
API_PAS_FILE=$(FB_ROOT_PATH)\src\include\gen\Firebird.pas |
| 12 |
MISC=$(FB_ROOT_PATH)\src\misc |
| 13 |
PAS_ROOT=$(MISC)\pascal |
| 14 |
PASCAL_SOURCES=$(PAS_ROOT)\Pascal.interface.pas $(PAS_ROOT)\Pascal.implementation.pas |
| 15 |
TMP_FUNCS=$(FB_GEN_DIR)\misc\func.pas |
| 16 |
XPB_CONSTS=$(FB_ROOT_PATH)\src\include\firebird\impl\consts_pub.h |
| 17 |
INF_CONSTS=$(FB_ROOT_PATH)\src\include\firebird\impl\inf_pub.h |
| 18 |
ERR_CONSTS=$(FB_ROOT_PATH)\lang_helpers\gds_codes.pas |
| 19 |
RPL_AWK=$(FB_GEN_DIR)\def_awk.exe |
| 20 |
RPL_AWK_SRC=$(MISC)\def_awk.c |
| 21 |
RPL_GREP=$(FB_GEN_DIR)\isc_grep.exe |
| 22 |
RPL_GREP_SRC=$(MISC)\isc_grep.c |
| 23 |
# These utils are platform and build independent, use fixed temporary dir. |
| 24 |
UTL_TMP_DIR=$(FB_TEMP_DIR)\Release\misc |
| 25 |
|
| 26 |
CPPFLAGS = /MD /EHsc /O2 /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" |
| 27 |
|
| 28 |
updateCloopInterfaces: $(API_H_FILE) $(API_PAS_FILE) |
| 29 |
|
| 30 |
|
| 31 |
$(CLOOP) $(RPL_AWK) $(RPL_GREP): $(UTL_TMP_DIR) |
| 32 |
|
| 33 |
$(UTL_TMP_DIR): |
| 34 |
-mkdir $@ 2>nul |
| 35 |
|
| 36 |
$(CLOOP): $(CLOOP_SRC) |
| 37 |
$(CPP) $(CPPFLAGS) /Fe$@ /Fo$(UTL_TMP_DIR)\ $(CLOOP_SRC) |
| 38 |
|
| 39 |
$(API_H_FILE) $(API_PAS_FILE): $(CLOOP) |
| 40 |
|
| 41 |
$(API_H_FILE): $(IDL_FILE) |
| 42 |
$(CLOOP) $(IDL_FILE) c++ $@ IDL_FB_INTERFACES_H Firebird I |
| 43 |
|
| 44 |
$(RPL_AWK): $(RPL_AWK_SRC) |
| 45 |
# NMAKE strips trailing backslash during macro substitution that's why it is here and not in definition. |
| 46 |
$(CPP) /Fe$@ /Fo$(UTL_TMP_DIR)\ $(RPL_AWK_SRC) |
| 47 |
|
| 48 |
$(RPL_GREP): $(RPL_GREP_SRC) |
| 49 |
$(CPP) /Fe$@ /Fo$(UTL_TMP_DIR)\ $(RPL_GREP_SRC) |
| 50 |
|
| 51 |
$(TMP_FUNCS): $(PAS_ROOT)\fb_get_master_interface.pas $(XPB_CONSTS) $(ERR_CONSTS) $(RPL_AWK) $(RPL_GREP) |
| 52 |
copy $(PAS_ROOT)\fb_get_master_interface.pas $(TMP_FUNCS) |
| 53 |
$(RPL_AWK) <$(XPB_CONSTS) >>$(TMP_FUNCS) |
| 54 |
$(RPL_AWK) <$(INF_CONSTS) >>$(TMP_FUNCS) |
| 55 |
$(RPL_GREP) <$(ERR_CONSTS) >>$(TMP_FUNCS) |
| 56 |
|
| 57 |
$(API_PAS_FILE): $(IDL_FILE) $(PASCAL_SOURCES) $(TMP_FUNCS) |
| 58 |
$(CLOOP) $(IDL_FILE) pascal $@ Firebird --uses SysUtils \ |
| 59 |
--interfaceFile $(PAS_ROOT)\Pascal.interface.pas \ |
| 60 |
--implementationFile $(PAS_ROOT)\Pascal.implementation.pas \ |
| 61 |
--exceptionClass FbException \ |
| 62 |
--functionsFile $(TMP_FUNCS) \ |
| 63 |
--prefix I |