| 1 |
# |
| 2 |
# Chapter 11 - Makefile |
| 3 |
# |
| 4 |
TARGETS = Server.dll |
| 5 |
DIR_SERVER = InProc |
| 6 |
|
| 7 |
# |
| 8 |
# Flags - Always compiles debug |
| 9 |
# |
| 10 |
CPP_FLAGS=/c /MT /Zi /Od /D_DEBUG |
| 11 |
EXE_LINK_FLAGS= /NOD /DEBUG |
| 12 |
DLL_LINK_FLAGS=/NOD /DLL /DEBUG |
| 13 |
|
| 14 |
LIBS = kernel32.lib uuid.lib advapi32.lib ole32.lib oleaut32.lib |
| 15 |
|
| 16 |
# NOTE: Added oleaut32.lib |
| 17 |
|
| 18 |
################################################# |
| 19 |
# |
| 20 |
# Targets |
| 21 |
# |
| 22 |
|
| 23 |
all : Client.exe DClient.exe $(TARGETS) camlclient camlcomponent |
| 24 |
|
| 25 |
################################################# |
| 26 |
# |
| 27 |
# Proxy source files |
| 28 |
# |
| 29 |
Iface.h Server.tlb Proxy.c Guids.c DllData.c : Server.idl |
| 30 |
midl /h Iface.h /iid Guids.c /proxy Proxy.c Server.idl |
| 31 |
|
| 32 |
################################################# |
| 33 |
# |
| 34 |
# Shared source files |
| 35 |
# |
| 36 |
|
| 37 |
Guids.obj : Guids.c |
| 38 |
cl $(CPP_FLAGS) Guids.c |
| 39 |
|
| 40 |
################################################# |
| 41 |
# |
| 42 |
# Component/server source files |
| 43 |
# |
| 44 |
|
| 45 |
Server.obj : Server.cpp cunknown.h cfactory.h Iface.h |
| 46 |
cl $(CPP_FLAGS) Server.cpp |
| 47 |
|
| 48 |
Cmpnt.obj : Cmpnt.cpp Cmpnt.h Iface.h Registry.h \ |
| 49 |
CUnknown.h |
| 50 |
cl $(CPP_FLAGS) Cmpnt.cpp |
| 51 |
|
| 52 |
# |
| 53 |
# Helper classes |
| 54 |
# |
| 55 |
|
| 56 |
CUnknown.obj : CUnknown.cpp CUnknown.h |
| 57 |
cl $(CPP_FLAGS) $(SERVER) CUnknown.cpp |
| 58 |
|
| 59 |
CFactory.obj : CFactory.cpp CFactory.h |
| 60 |
cl $(CPP_FLAGS) $(SERVER) CFactory.cpp |
| 61 |
|
| 62 |
Registry.obj : Registry.cpp Registry.h |
| 63 |
cl $(CPP_FLAGS) $(SERVER) Registry.cpp |
| 64 |
|
| 65 |
################################################# |
| 66 |
# |
| 67 |
# Client source files |
| 68 |
# |
| 69 |
|
| 70 |
Client.obj : Client.cpp Iface.h Util.h |
| 71 |
cl $(CPP_FLAGS) Client.cpp |
| 72 |
|
| 73 |
DClient.obj : DClient.cpp Util.h |
| 74 |
cl $(CPP_FLAGS) DClient.cpp |
| 75 |
|
| 76 |
# Util.cpp compiled for the client |
| 77 |
Util.obj : Util.cpp Util.h |
| 78 |
cl $(CPP_FLAGS) Util.cpp |
| 79 |
|
| 80 |
################################################# |
| 81 |
# |
| 82 |
# Link component - Automatically register component. |
| 83 |
# |
| 84 |
|
| 85 |
SERVER_OBJS = Server.obj \ |
| 86 |
Cmpnt.obj \ |
| 87 |
Registry.obj \ |
| 88 |
CFactory.obj \ |
| 89 |
CUnknown.obj \ |
| 90 |
Util.obj \ |
| 91 |
Guids.obj |
| 92 |
|
| 93 |
Server.dll: $(SERVER_OBJS) Server.def |
| 94 |
link $(DLL_LINK_FLAGS) $(SERVER_OBJS) libcmtd.lib \ |
| 95 |
libcimtd.lib $(LIBS) /DEF:Server.def |
| 96 |
regsvr32 -s Server.dll |
| 97 |
|
| 98 |
################################################# |
| 99 |
# |
| 100 |
# Link clients |
| 101 |
# |
| 102 |
|
| 103 |
Client.exe : Client.obj Guids.obj Util.obj |
| 104 |
link $(EXE_LINK_FLAGS) Client.obj Guids.obj Util.obj \ |
| 105 |
libcmtd.lib libcimtd.lib $(LIBS) |
| 106 |
|
| 107 |
DClient.exe : DClient.obj Util.obj |
| 108 |
link $(EXE_LINK_FLAGS) DClient.obj Guids.obj Util.obj \ |
| 109 |
libcmtd.lib libcimtd.lib $(LIBS) |
| 110 |
|
| 111 |
############# |
| 112 |
# |
| 113 |
# Caml side |
| 114 |
# |
| 115 |
camlclient : camlclient.exe |
| 116 |
|
| 117 |
camlclient.exe: component.obj GUIDs.obj component.cmo camlclient.cmo |
| 118 |
ocamlc -verbose -ccopt /Zi -o camlclient.exe -custom \ |
| 119 |
com.cma component.cmo camlclient.cmo \ |
| 120 |
component.obj GUIDs.obj \ |
| 121 |
-cclib -lcamlidl oleaut32.lib ole32.lib |
| 122 |
|
| 123 |
component.ml component.mli component.c: component.idl ../../compiler/camlidl |
| 124 |
../../compiler/camlidl -header component.idl |
| 125 |
|
| 126 |
component.cmo: component.ml component.cmi |
| 127 |
component.cmi: component.mli |
| 128 |
camlclient.cmo: component.cmi |
| 129 |
|
| 130 |
camlcomponent: camlcomp.dll |
| 131 |
|
| 132 |
COMPONENTFILES=\ |
| 133 |
component.obj GUIDs.obj \ |
| 134 |
component.cmo camlcomp.cmo camlcomp.cmo \ |
| 135 |
component.tlb |
| 136 |
|
| 137 |
camlcomp.dll: $(COMPONENTFILES) |
| 138 |
camlidldll -o camlcomp.dll $(COMPONENTFILES) |
| 139 |
regsvr32 -s camlcomp.dll |
| 140 |
|
| 141 |
component.tlb: component.idl |
| 142 |
midl /client none /server none /header component.h2 /newtlb component.idl |
| 143 |
|
| 144 |
camlcomp.cmo: component.cmi |
| 145 |
|
| 146 |
.SUFFIXES: .ml .mli .cmo .cmi .c .obj |
| 147 |
|
| 148 |
.ml.cmo: |
| 149 |
ocamlc -I ../.. -c $< |
| 150 |
|
| 151 |
.mli.cmi: |
| 152 |
ocamlc -I ../.. -c $< |
| 153 |
|
| 154 |
.c.obj: |
| 155 |
ocamlc -ccopt /Zi -c $< |
| 156 |
|