[go: up one dir, main page]

Menu

[r10]: / src / Makefile.in  Maximize  Restore  History

Download this file

301 lines (252 with data), 11.7 kB

  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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
### This Makefile assumes that you have initialized your OOo SDK environment #############
# Windows:
# Uncomment the OS = WIN in the first line
# Adjust the MINGW path
#
# Wine:
# Source the config.wine
#
# Linux:
# Run /usr/lib/openoffice/basis3.2/sdk/setsdkenv_unix
# or <home>/openoffice.org3.2_sdk/<host-name>/setsdkenv_unix.csh or .sh
#
###########################################################################################
#OS = WIN
#MINGW = C:\MinGW\msys\1.0
VERSION = @VERSION@
SHELL = @SHELL@
install_sh = @install_sh@
mkinstalldirs = $(install_sh) -d
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
# The following is copied and adapted from the Makefile of the complextoolbarcontrol example of the SDK
ifeq "$(OS)" "WINE"
PRJ=$(BASE)/Program\ Files/OpenOffice.org\ 3/Basis/sdk
else
PRJ=$(OO_SDK_HOME)
endif
SETTINGS=$(PRJ)/settings
include $(SETTINGS)/settings.mk
include $(SETTINGS)/std.mk
include $(SETTINGS)/dk.mk
# Define non-platform/compiler specific settings
COMP_NAME=iMath-$(VERSION)-beta-$(OS)
COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
COMP_PACKAGE_DIR=iMathout
COMP_PACKAGE = $(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)
COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE)")
COMP_UNOPKG_MANIFEST = META-INF$(PS)manifest.xml
COMP_MAPFILE = $(COMP_PACKAGE_DIR)/$(COMP_NAME).uno.map
# override output directory settings
OUT_MISC = .
OUT_INC = ./inc
OUT = .
COMP_CONFIG=iMathMenu.xcu iMathProtocolHandler.xcu iMathJob.xcu iMathOptionsDialog.xcu iMathWriterWindowState.xcu iMathOptionData.xcs iMathOptionData.xcu iMathJob.xcu
REGISTERFLAG = cpp_$(COMP_NAME)_register_component.flag
COMP_TYPEFLAG = cpp_$(COMP_NAME)_types.flag
CXXFILES = smathparser.yxx smathlexer.lxx imathprint.cpp smathdriver.cxx imathutils.cxx \
iMath.cxx iMath-XDispatch.cxx iMath-XContainerWindowEventHandler.cxx iMath-XDialogEventHandler.cxx \
iMath-XAsyncJob.cxx iMath-XOther.cxx component.cxx
PREFIX=libiMath
SLOFILES1 = $(patsubst %.cxx,$(PREFIX)-%.$(OBJ_EXT),$(CXXFILES))
SLOFILES2 = $(patsubst %.yxx,$(PREFIX)-%.$(OBJ_EXT),$(SLOFILES1))
SLOFILES3 = $(patsubst %.lxx,$(PREFIX)-%.$(OBJ_EXT),$(SLOFILES2))
SLOFILES = $(patsubst %.cpp,$(PREFIX)-%.$(OBJ_EXT),$(SLOFILES3))
# Targets
.PHONY: all
all: iMath
include $(SETTINGS)/stdtarget.mk
ifeq "$(OS)" "WIN"
TOUCH = $(MINGW)/bin/touch.exe
BISON = $(MINGW)/bin/bison.exe
FLEX = $(MINGW)/bin/flex.exe
CC_INCLUDES_WIN = -I$(MINGW)/local/include
else
TOUCH = touch
BISON = bison
FLEX = flex
endif
###### Dependencies - any way of automating this? OOo doesn't seem to use automake
smathdriver.cxx: smathdriver.hxx imathutils.hxx imathprint.h
$(TOUCH) $@
iMath.cxx: iMath.hxx imathutils.hxx
$(TOUCH) $@
iMath-XDialogEventHandler.cxx : iMath.hxx imathutils.hxx imathprint.h
$(TOUCH) $@
iMath-XContainerWindowEventHandler.cxx : iMath.hxx imathutils.hxx
$(TOUCH) $@
iMath-XDispatch.cxx: iMath.hxx imathutils.hxx
$(TOUCH) $@
iMath-XOther.cxx: iMath.hxx imathutils.hxx imathprint.h
$(TOUCH) $@
iMath-XAsyncJob.cxx: iMath.hxx imathutils.hxx
$(TOUCH) $@
imathutils.cxx smathlexer.lxx smathparser.yxx: imathutils.hxx
$(TOUCH) $@
###### How do we make this generic for different platforms???
smathparser.cxx smathparser.hxx: smathparser.yxx
$(BISON) -y -d -osmathparser.cxx $<
smathlexer.cxx: smathlexer.lxx smathparser.hxx imathprint.h
$(FLEX) -o smathlexer.cxx $<
##### add $(STL_INCLUDES) here if necessary
$(PREFIX)-%.$(OBJ_EXT) : %.cxx smathparser.hxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) $(CC_INCLUDES_WIN) -I. $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
#### Remove this once imathprint is moved to libeqc
$(PREFIX)-%.$(OBJ_EXT) : %.cpp smathparser.hxx $(SDKTYPEFLAG)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(CC) $(CC_FLAGS) $(CC_INCLUDES) $(CC_INCLUDES_WIN) -I. $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
$(COMP_MAPFILE) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
cat $(PRJ)/settings/component.uno.map > $(COMP_MAPFILE)
ifeq "$(OS)" "MACOSX"
nm -gx $(SLOFILES) | $(ADDSYMBOLS) >> $(COMP_MAPFILE)
endif
ifeq "$(OS)" "WINE"
$(COMP_IMPL_NAME) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \
/MAP:$(subst $(SHAREDLIB_EXT),map,$(@F)) $(SLOFILES) \
/LIBPATH:$(CPP_WINDOWS_VC) msvcrt.lib msvcprt.lib \
/LIBPATH:$(CPP_WINDOWS_SDK) Kernel32.Lib \
/LIBPATH:$(BASE)/cl/lib/ libginac.lib libcln.lib libeqc.lib \
/LIBPATH:"$(OO_SDK_HOME)/lib" $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB)
$(LINK_MANIFEST)
else
ifeq "$(OS)" "WIN"
$(COMP_IMPL_NAME) : $(SLOFILES)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \
/MAP:$(subst $(SHAREDLIB_EXT),map,$(@F)) $(SLOFILES) \
msvcrt.lib msvcprt.lib Kernel32.Lib $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) \
/LIBPATH:$(BASE)/local/lib/ libginac.lib libcln.lib libeqc.li
$(LINK_MANIFEST)
else
$(COMP_IMPL_NAME) : $(SLOFILES) $(COMP_MAPFILE)
-$(MKDIR) $(subst /,$(PS),$(@D))
$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
-L/usr/lib -leqc -lginac -lcln
ifeq "$(OS)" "MACOSX"
$(INSTALL_NAME_URELIBS) $@
endif
endif
endif
# rule for component package manifest
$(COMP_UNOPKG_MANIFEST) : Makefile
-$(MKDIR) $(subst /,$(PS),$(@D))
@echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
@echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathMenu.xcu$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.basic-library$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathDialogs$(PS)$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathWriterWindowState.xcu$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathProtocolHandler.xcu$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathJob.xcu$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathOptionsDialog.xcu$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-schema$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathOptionData.xcs$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
@echo manifest:full-path="$(QM)iMathOptionData.xcu$(QM)"/$(CSEP) >> $@
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=$(UNOPKG_PLATFORM)$(QM)" >> $@
@echo manifest:full-path="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"/$(CSEP) >> $@
#uncomment to include Windows build in Linux package
@echo $(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-component;type=native;platform=Windows$(QM)" >> $@
@echo manifest:full-path="$(QM)$(UNOPKG_PLATFORM)/$(COMP_NAME).uno.dll$(QM)"/$(CSEP) >> $@
@echo $(OSEP)/manifest:manifest$(CSEP) >> $@
ifneq "$(OS)" "WIN"
# flip in is Debian package flip
flip -m $@
endif
# rule for component package file
$(COMP_PACKAGE) : $(COMP_IMPL_NAME) $(COMP_CONFIG) $(COMP_UNOPKG_MANIFEST)
-$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
-$(MKDIR) $(subst /,$(PS),$(UNOPKG_PLATFORM))
$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(UNOPKG_PLATFORM))
$(SDK_ZIP) $@ $(UNOPKG_PLATFORM)/*
$(SDK_ZIP) -u $@ $(COMP_CONFIG) logo_small.png logo_big.png
$(SDK_ZIP) -ur $@ description.xml registration/license*
$(SDK_ZIP) -ur $@ iMathDialogs/*.x??
$(SDK_ZIP) -u $@ $(COMP_UNOPKG_MANIFEST)
$(SDK_ZIP) -u $@ init.imath units.imath
$(REGISTERFLAG) : $(COMP_PACKAGE)
ifeq ($(SDK_AUTO_DEPLOYMENT),YES)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
ifeq "$(OS)" "WINE"
"$(OO_SDK_OFFICE_BIN_DIR)$(PS)"unopkg.exe add -f -v $(COMP_PACKAGE_URL)
else
ifeq "$(OS)" "WIN"
$(DEPLOYTOOL) -v $(COMP_PACKAGE_URL)
else
/usr/lib/openoffice/program/unopkg add -f -v $(COMP_PACKAGE_URL)
endif
endif
@echo flagged > $(subst /,$(PS),$@)
else
@echo --------------------------------------------------------------------------------
@echo If you want to install your component automatically, please set the environment
@echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
@echo possible if no office instance is running.
@echo --------------------------------------------------------------------------------
endif
iMath : $(REGISTERFLAG)
@echo --------------------------------------------------------------------------------
@echo The "$(QM)iMath$(QM)" addon component was installed if SDK_AUTO_DEPLOYMENT = YES.
@echo You can use this component inside your office installation, see the example
@echo description.
@echo --------------------------------------------------------------------------------
deploy: $(COMP_PACKAGE)
-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
ifeq "$(OS)" "WINE"
"$(OO_SDK_OFFICE_BIN_DIR)$(PS)"unopkg.exe add -f -v $(COMP_PACKAGE_URL)
else
ifeq "$(OS)" "WIN"
$(DEPLOYTOOL) -v $(COMP_PACKAGE_URL)
else
/usr/lib/openoffice/program/unopkg add -f -v $(COMP_PACKAGE_URL)
endif
endif
@echo flagged > $(subst /,$(PS),$@)
editbin:
wine "/c-ro/Programme/Microsoft Visual Studio 9.0/VC/bin/editbin.exe" /subsystem:console $(BASE)/Program\ Files/OpenOffice.org\ 3/program/soffice.exe
run: $(REGISTERFLAG)
"$(OFFICE_PROGRAM_PATH)$(PS)soffice$(EXE_EXT)" -writer
runt: $(REGISTERFLAG)
"$(OFFICE_PROGRAM_PATH)$(PS)soffice$(EXE_EXT)" -writer ../doc/iMath-tour.odt
rund: $(REGISTERFLAG)
"$(OFFICE_PROGRAM_PATH)$(PS)soffice$(EXE_EXT)" -writer ../doc/Standard-Engineering-Calculations4.odt
rune: $(REGISTERFLAG)
"$(OFFICE_PROGRAM_PATH)$(PS)soffice$(EXE_EXT)" -writer ../doc/Evaluation.odt
.PHONY: clean
clean :
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
-$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_TYPEFLAG)))
-$(DEL) $(SLOFILES) libiMath.la *.o *.lo
-$(DEL) $(COMP_IMPL_NAME)
-$(DEL) $(COMP_NAME)*
-$(DEL) smathparser.cxx smathparser.hxx smathlexer.cxx
-$(DELRECURSIVE) $(UNOPKG_PLATFORM)
-$(DELRECURSIVE) $(OUT_INC) META-INF $(COMP_PACKAGE_DIR)
-$(DEL) $(SDKTYPEFLAG)
distclean: clean
install: install-exec-local install-data-local
uninstall: uninstall-local
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install-exec-local: $(COMP_PACKAGE)
$(mkinstalldirs) $(DESTDIR)/usr/lib/openoffice/share/extension/install
$(INSTALL_DATA) $(COMP_PACKAGE) $(DESTDIR)/usr/lib/openoffice/share/extension/install/$(COMP_NAME).$(UNOOXT_EXT)
install-data-local: init.imath units.imath
$(mkinstalldirs) $(DESTDIR)/usr/lib/openoffice/share/extension/imath
$(INSTALL_DATA) init.imath $(DESTDIR)/usr/lib/openoffice/share/extension/imath
$(INSTALL_DATA) units.imath $(DESTDIR)/usr/lib/openoffice/share/extension/imath
uninstall-local:
-rm -f $(DESTDIR)/usr/lib/openoffice/share/extension/install/$(COMP_PACKAGE)
-rm -f $(DESTDIR)/usr/lib/openoffice/share/extension/imath/init.imath
-rm -f $(DESTDIR)/usr/lib/openoffice/share/extension/imath/units.imath