summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/Makefile.mak
blob: f4dbea90de28ecff57e918c28118bcbb5f5df1ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# **********************************************************************
#
# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

top_srcdir	= ..\..

LIBNAME		= $(top_srcdir)\lib\icestormservice$(LIBSUFFIX).lib
DLLNAME		= $(top_srcdir)\bin\icestormservice$(SOVERSION)$(LIBSUFFIX)$(COMPSUFFIX).dll

ADMIN		= $(top_srcdir)\bin\icestormadmin.exe
DB		= $(top_srcdir)\bin\icestormdb.exe
MIGRATE		= $(top_srcdir)\bin\icestormmigrate.exe

TARGETS		= $(LIBNAME) $(DLLNAME) $(ADMIN) $(MIGRATE) $(DB)

CSLICE_OBJS     = .\Election.obj \
		  .\IceStormInternal.obj \
		  .\Instrumentation.obj \
		  .\LinkRecord.obj \
		  .\LLURecord.obj \
		  .\SubscriberRecord.obj \
		  .\V31Format.obj \
		  .\V32Format.obj

DSLICE_OBJS     = .\DBTypes.obj

BISON_FLEX_OBJS = .\Grammar.obj \
                  .\Scanner.obj

LIB_OBJS	= .\Instance.obj \
		  .\InstrumentationI.obj \
		  .\LLUMap.obj \
		  .\NodeI.obj \
		  .\Observers.obj \
		  .\Service.obj \
		  .\Subscriber.obj \
		  .\SubscriberMap.obj \
		  .\TopicI.obj \
		  .\TopicManagerI.obj \
		  .\TraceLevels.obj \
		  .\TransientTopicI.obj \
		  .\TransientTopicManagerI.obj \
		  .\Util.obj \
		  .\V31FormatDB.obj \
		  .\V32FormatDB.obj \
                  $(CSLICE_OBJS)

AOBJS		= .\Admin.obj \
		  .\Parser.obj \
                  $(CSLICE_OBJS) \
                  $(BISON_FLEX_OBJS)

MOBJS		= .\LLUMap.obj \
                  .\Migrate.obj \
                  .\SubscriberMap.obj \
                  .\V31FormatDB.obj \
		  .\V32FormatDB.obj \
                  $(CSLICE_OBJS)

DOBJS		= .\IceStormDB.obj \
                  .\LLUMap.obj \
                  .\SubscriberMap.obj \
                  $(DSLICE_OBJS)

OBJS		= $(LIB_OBJS) \
		  $(AOBJS) \
		  $(MOBJS) \
		  $(DOBJS)

SLICE_OBJS	= $(CSLICE_OBJS) \
		  $(DSLICE_OBJS)

HDIR		= $(headerdir)\IceStorm
SDIR		= $(slicedir)\IceStorm

SLICE2FREEZECMD = $(SLICE2FREEZE) -I.. --ice --include-dir IceStorm $(ICECPPFLAGS)

!include $(top_srcdir)\config\Make.rules.mak

CPPFLAGS	= -I. -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
ICECPPFLAGS	= $(ICECPPFLAGS) -I..
SLICE2CPPFLAGS	= --ice --include-dir IceStorm -I. $(SLICE2CPPFLAGS)
LINKWITH 	= $(LIBS)
ALINKWITH 	= $(LIBS) 
MLINKWITH 	= $(LIBS)

!if "$(GENERATE_PDB)" == "yes"
PDBFLAGS        = /pdb:$(DLLNAME:.dll=.pdb)
APDBFLAGS       = /pdb:$(ADMIN:.exe=.pdb)
DPDBFLAGS       = /pdb:$(DB:.exe=.pdb)
MPDBFLAGS       = /pdb:$(MIGRATE:.exe=.pdb)
!endif

RES_FILE        = IceStormService.res
ARES_FILE       = IceStormAdmin.res
DRES_FILE       = IceStormDB.res
MRES_FILE       = IceStormMigrate.res

$(LIBNAME): $(DLLNAME)

$(DLLNAME): $(LIB_OBJS) $(RES_FILE)
	$(LINK) $(BASE):0x2C000000 $(LD_DLLFLAGS) $(PDBFLAGS) $(LIB_OBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) $(RES_FILE)
	move $(DLLNAME:.dll=.lib) $(LIBNAME)
	@if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
	    $(MT) -nologo -manifest $@.manifest -outputresource:$@;#2 && del /q $@.manifest
	@if exist $(DLLNAME:.dll=.exp) del /q $(DLLNAME:.dll=.exp)
	@if defined SIGN_CERTIFICATE echo ^ ^ ^ Signing $@ && \
		signtool sign /f "$(SIGN_CERTIFICATE)" /p $(SIGN_PASSWORD) /t $(SIGN_TIMESTAMPSERVER) $@

$(ADMIN): $(AOBJS) $(ARES_FILE)
	$(LINK) $(LD_EXEFLAGS) $(APDBFLAGS) $(AOBJS) $(SETARGV) $(PREOUT)$@ $(PRELIBS)$(ALINKWITH) $(ARES_FILE)
	@if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
	    $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
	@if defined SIGN_CERTIFICATE echo ^ ^ ^ Signing $@ && \
		signtool sign /f "$(SIGN_CERTIFICATE)" /p $(SIGN_PASSWORD) /t $(SIGN_TIMESTAMPSERVER) $@

$(DB): $(DOBJS) $(DRES_FILE)
	$(LINK) $(LD_EXEFLAGS) $(DPDBFLAGS) $(DOBJS) $(SETARGV) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) $(DRES_FILE)
	@if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
	    $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
	@if defined SIGN_CERTIFICATE echo ^ ^ ^ Signing $@ && \
		signtool sign /f "$(SIGN_CERTIFICATE)" /p $(SIGN_PASSWORD) /t $(SIGN_TIMESTAMPSERVER) $@

$(MIGRATE): $(MOBJS) $(MRES_FILE)
	$(LINK) $(LD_EXEFLAGS) $(MPDBFLAGS) $(MOBJS) $(SETARGV) $(PREOUT)$@ $(PRELIBS)$(MLINKWITH) $(MRES_FILE)
	@if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
	    $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
	@if defined SIGN_CERTIFICATE echo ^ ^ ^ Signing $@ && \
		signtool sign /f "$(SIGN_CERTIFICATE)" /p $(SIGN_PASSWORD) /t $(SIGN_TIMESTAMPSERVER) $@

# Implicit rule to build the private IceStorm .ice files.
{..\IceStorm\}.ice{..\IceStorm\}.h:
	del /q $(*F).h $(*F).cpp
	"$(SLICE2CPP)" $(SLICE2CPPFLAGS) $(*F).ice

LLUMap.h LLUMap.cpp: ..\IceStorm\LLURecord.ice $(SLICE2FREEZE) $(SLICEPARSERLIB)
	del /q LLUMap.h LLUMap.cpp
	$(SLICE2FREEZECMD) --dict IceStorm::LLUMap,string,IceStormElection::LogUpdate LLUMap ..\IceStorm\LLURecord.ice

SubscriberMap.h SubscriberMap.cpp: ..\IceStorm\SubscriberRecord.ice $(slicedir)\Ice\Identity.ice $(SLICE2FREEZE) $(SLICEPARSERLIB)
	del /q SubscriberMap.h SubscriberMap.cpp
	$(SLICE2FREEZECMD) \
	--dict IceStorm::SubscriberMap,IceStorm::SubscriberRecordKey,IceStorm::SubscriberRecord,sort \
	SubscriberMap ..\IceStorm\SubscriberRecord.ice

# Needed for migration.
V32FormatDB.h V32FormatDB.cpp: V32Format.ice $(SLICE2FREEZE) $(SLICEPARSERLIB)
	del /q V32FormatDB.h V32FormatDB.cpp
	$(SLICE2FREEZECMD) --dict IceStorm::V32Format,Ice::Identity,IceStorm::LinkRecordSeq \
	V32FormatDB V32Format.ice

V31FormatDB.h V31FormatDB.cpp: V31Format.ice $(SLICE2FREEZE) $(SLICEPARSERLIB)
	del /q V31FormatDB.h V31FormatDB.cpp
	$(SLICE2FREEZECMD) --dict IceStorm::V31Format,string,IceStorm::LinkRecordDict \
	V31FormatDB V31Format.ice

clean::
	-del /q DBTypes.cpp DBTypes.h
	-del /q LLUMap.h LLUMap.cpp
	-del /q IceStormInternal.cpp IceStormInternal.h
	-del /q Instrumentation.cpp Instrumentation.h
	-del /q LinkRecord.cpp LinkRecord.h
	-del /q LLUMap.h LLUMap.cpp
	-del /q LLURecord.cpp LLURecord.h
	-del /q SubscriberMap.h SubscriberMap.cpp
	-del /q SubscriberRecord.cpp SubscriberRecord.h
	-del /q V31Format.cpp V31Format.h
	-del /q V32Format.cpp V32Format.h
	-del /q V32FormatDB.cpp V31FormatDB.cpp V32FormatDB.h V31FormatDB.h
	-del /q $(ADMIN:.exe=.*)
	-del /q $(MIGRATE:.exe=.*)
	-del /q $(DB:.exe=.*)
	-del /q IceStormAdmin.res IceStormMigrate.res IceStormService.res

install:: all
	copy $(LIBNAME) "$(install_libdir)"
	copy $(DLLNAME) "$(install_bindir)"
	copy $(ADMIN) "$(install_bindir)"
	copy $(DB) "$(install_bindir)"
	copy $(MIGRATE) "$(install_bindir)"

!if "$(GENERATE_PDB)" == "yes"

install:: all
        copy $(ADMIN:.exe=.pdb) "$(install_bindir)"
        copy $(DB:.exe=.pdb) "$(install_bindir)"
        copy $(MIGRATE:.exe=.pdb) "$(install_bindir)"
        copy $(DLLNAME:.dll=.pdb) "$(install_bindir)"

!endif