merge the formfield patch from ooo-build
[ooovba.git] / pyuno / source / module / makefile.mk
blob2357d0062ed0f8710303d18f872c0ff03f0f64c4
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.17 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
31 PRJ=..$/..
33 PRJNAME=pyuno
34 TARGET=pyuno
35 ENABLE_EXCEPTIONS=TRUE
37 LINKFLAGSDEFS = # do not fail with missing symbols
39 # --- Settings -----------------------------------------------------
41 .INCLUDE : settings.mk
42 .IF "$(L10N_framework)"==""
43 #-------------------------------------------------------------------
45 .IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4"
46 # no -Bdirect for SunWS CC
47 DIRECT = $(LINKFLAGSDEFS)
48 .ENDIF
50 # special setting from environment
51 .IF "$(EXTRA_CFLAGS)"!=""
52 EXTRA_FRAMEWORK_FLAG=-framework Python
53 .ENDIF # .IF "$(EXTRA_CFLAGS)"!=""
55 .IF "$(GUI)" == "UNX"
56 # python expects modules without the lib prefix
57 # pyuno.so even on Mac OS X, because it is a python module
58 PYUNO_MODULE=$(DLLDEST)$/pyuno.so
59 PYUNORC=pyunorc
60 .ELIF "$(GUI)" == "OS2"
61 .INCLUDE : pyversion.mk
62 PYUNORC=pyuno.ini
63 .ELSE
64 .INCLUDE : pyversion.mk
65 PYUNORC=pyuno.ini
66 DLLPOST=.pyd
67 .ENDIF
69 .IF "$(SYSTEM_PYTHON)" == "YES"
70 PYTHONLIB=$(PYTHON_LIBS)
71 CFLAGS+=$(PYTHON_CFLAGS)
72 .ELSE # "$(SYSTEM_PYTHON)" == "YES"
73 .INCLUDE : pyversion.mk
74 CFLAGS+=-I$(SOLARINCDIR)$/python
75 .ENDIF # "$(SYSTEM_PYTHON)" == "YES"
77 SHL1TARGET=$(TARGET)
78 SLOFILES= \
79 $(SLO)$/pyuno_runtime.obj \
80 $(SLO)$/pyuno.obj \
81 $(SLO)$/pyuno_callable.obj \
82 $(SLO)$/pyuno_module.obj \
83 $(SLO)$/pyuno_type.obj \
84 $(SLO)$/pyuno_util.obj \
85 $(SLO)$/pyuno_except.obj \
86 $(SLO)$/pyuno_adapter.obj \
87 $(SLO)$/pyuno_gc.obj
89 # remove this, when issue i35064 is integrated
90 .IF "$(COM)"=="GCC"
91 NOOPTFILES= \
92 $(SLO)$/pyuno_module.obj
93 .ENDIF # "$(COM)"=="GCC"
96 SHL1STDLIBS= \
97 $(CPPULIB) \
98 $(CPPUHELPERLIB) \
99 $(SALLIB) \
100 $(PYTHONLIB) \
101 $(EXTRA_FRAMEWORK_FLAG)
103 SHL1DEPN=
104 SHL1LIBS=$(SLB)$/$(TARGET).lib
105 SHL1IMPLIB=i$(TARGET)
107 SHL1DEF= $(MISC)$/$(SHL1TARGET).def
109 DEF1NAME= $(SHL1TARGET)
110 DEF1DEPN= $(MISC)$/pyuno.flt
112 DEFLIB1NAME=$(TARGET)
114 # --- Targets ------------------------------------------------------
116 .IF "$(GUI)$(COM)"=="WNTGCC"
117 ALLTAR : \
118 $(DLLDEST)$/uno.py \
119 $(DLLDEST)$/unohelper.py \
120 $(PYUNO_MODULE) \
121 $(MISC)$/$(PYUNORC) \
122 $(LB)$/lib$(TARGET).a
124 $(LB)$/lib$(TARGET).a: $(MISC)$/$(TARGET).def
125 dlltool --dllname $(TARGET)$(DLLPOST) --input-def=$(MISC)$/$(TARGET).def --kill-at --output-lib=$(LB)$/lib$(TARGET).a
126 .ELSE
127 ALLTAR : \
128 $(DLLDEST)$/uno.py \
129 $(DLLDEST)$/unohelper.py \
130 $(PYUNO_MODULE) \
131 $(MISC)$/$(PYUNORC)
132 .ENDIF
133 .ENDIF
135 .INCLUDE : target.mk
136 .IF "$(L10N_framework)"==""
137 $(DLLDEST)$/%.py: %.py
138 cp $? $@
141 .IF "$(GUI)" == "UNX"
142 $(PYUNO_MODULE) : $(SLO)$/pyuno_dlopenwrapper.obj
143 .IF "$(OS)" == "LINUX"
144 @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSRUNPATH_OOO) $(LINKFLAGSSHLCUI) -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
145 .ELIF "$(OS)" == "SOLARIS"
146 @echo ld -G -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
147 .ELIF "$(OS)" == "FREEBSD"
148 @echo ld -shared -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
149 .ELIF "$(OS)" == "NETBSD"
150 @echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
151 .ELIF "$(OS)" == "MACOSX"
152 @echo $(CC) -bundle -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o $(EXTRA_LINKFLAGS) $(EXTRA_FRAMEWORK_FLAG) > $(MISC)$/$(@:b).cmd
153 .ELSE
154 @echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
155 .ENDIF
156 cat $(MISC)$/$(@:b).cmd
157 @+source $(MISC)$/$(@:b).cmd
158 .ENDIF
161 $(MISC)$/$(PYUNORC) : pyuno
162 -rm -f $@
163 cat pyuno > $@
165 $(MISC)$/pyuno.flt : pyuno.flt
166 -rm -f $@
167 cat $? > $@
168 .ENDIF # L10N_framework