Subject Re: gpre and VisualC++
Author fabrice.aeschbacher@khe.siemens.de
Paul,

> Now if only I can get VisualC++ to realise that it needs to build
the
> .c from the .e and then compile it.

Please find below a makefile example that worked for me (VC++6). It
will pre-process cs.e, build cs.c, compile to cs.obj, and link.
Invoke it with NMAKE.

HTH,
Fabrice

----------------------------------------------------------------------

# --------------------------------------------------------------------
-
# InterBase Installation Directory
#
# CHANGE this definition to point to your InterBase installation
directory
# --------------------------------------------------------------------
-
IBASE= D:\Program Files\Interbase


# --------------------------------------------------------------------
-
# Microsoft C/C++ Installation Directory
#
# CHANGE this definition to point to your compiler's installation
directory
# --------------------------------------------------------------------
-
MSCDIR= D:\Program Files\Microsoft Visual Studio\VC98


# --------------------------------------------------------------------
-
# General InterBase Defines for Microsoft Windows 95/NT
# --------------------------------------------------------------------
-
GPRE= "$(IBASE)\bin\gpre" -c -n -z -s 3
GPRE_M= "$(IBASE)\bin\gpre" -c -n -z -s 3 -m
ISQL= "$(IBASE)\bin\isql"
DB= Controller.gdb


# --------------------------------------------------------------------
-
# General Compiler and linker Defines for Microsoft C/C++
# --------------------------------------------------------------------
-
CFLAGS= -c -Zi -w -MD -DWIN32 $(INCLUDE)
LIB_CFLAGS= $(CFLAGS) -LD
INCLUDE= -I"$(IBASE)\include" -I"$(MSCDIR)\include"
LIBS= "$(MSCDIR)\lib\msvcrt.lib" "$(IBASE)\lib\gds32_ms.lib"
CC= "$(MSCDIR)\bin\cl"
LINK= "$(MSCDIR)\bin\link"
LIBRARIAN= "$(MSCDIR)\bin\lib"
COPY= copy

# --------------------------------------------------------------------
-
# Generic Compilation Rules
#
# Do NOT change anything below this point.
# --------------------------------------------------------------------
-
.SUFFIXES: .e .c .obj .exe

.e.c:
$(GPRE) $< -d $(DB)

.c.obj:
$(CC) $(CFLAGS) $<

.obj.exe:
$(LINK) /LINK50COMPAT /NODEFAULTLIB -out:$@ $< $(LIBS)


all: cs.exe

clean:
del *.bak
del *.obj
del *.exe

cs.c: cs.e cs.h

cs.obj: cs.c cs.h