xref: /AOO41X/main/pyuno/source/module/makefile.mk (revision bca6f9a9253268c74d26eac2b2cf50298fc0f7ca)
1cdf0e10cSrcweir#*************************************************************************
2cdf0e10cSrcweir#
3cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4cdf0e10cSrcweir#
5cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6cdf0e10cSrcweir#
7cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8cdf0e10cSrcweir#
9cdf0e10cSrcweir# This file is part of OpenOffice.org.
10cdf0e10cSrcweir#
11cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14cdf0e10cSrcweir#
15cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20cdf0e10cSrcweir#
21cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25cdf0e10cSrcweir#
26cdf0e10cSrcweir#*************************************************************************
27cdf0e10cSrcweirPRJ=..$/..
28cdf0e10cSrcweir
29cdf0e10cSrcweirPRJNAME=pyuno
30cdf0e10cSrcweirTARGET=pyuno
31cdf0e10cSrcweirENABLE_EXCEPTIONS=TRUE
32cdf0e10cSrcweir
33cdf0e10cSrcweirLINKFLAGSDEFS = # do not fail with missing symbols
34cdf0e10cSrcweir
35cdf0e10cSrcweir# --- Settings -----------------------------------------------------
36cdf0e10cSrcweir
37cdf0e10cSrcweir.INCLUDE :  settings.mk
38cdf0e10cSrcweir.IF "$(L10N_framework)"==""
39cdf0e10cSrcweir#-------------------------------------------------------------------
40cdf0e10cSrcweir
41cdf0e10cSrcweir.IF "$(OS)$(COMEX)" == "SOLARIS4"
42cdf0e10cSrcweir# no -Bdirect for SunWS CC
43cdf0e10cSrcweirDIRECT = $(LINKFLAGSDEFS)
44cdf0e10cSrcweir.ENDIF
45cdf0e10cSrcweir
46cdf0e10cSrcweir# special setting from environment
47cdf0e10cSrcweir.IF "$(EXTRA_CFLAGS)"!=""
48cdf0e10cSrcweirEXTRA_FRAMEWORK_FLAG=-framework Python
49cdf0e10cSrcweir.ENDIF # .IF "$(EXTRA_CFLAGS)"!=""
50cdf0e10cSrcweir
51cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
52cdf0e10cSrcweir# python expects modules without the lib prefix
53cdf0e10cSrcweir# pyuno.so even on Mac OS X, because it is a python module
54cdf0e10cSrcweirPYUNO_MODULE=$(DLLDEST)$/pyuno.so
55cdf0e10cSrcweirPYUNORC=pyunorc
56cdf0e10cSrcweir.ELIF "$(GUI)" == "OS2"
57*bca6f9a9SPedro Giffuni#.INCLUDE :  pyversion.mk
58cdf0e10cSrcweirPYUNORC=pyuno.ini
59cdf0e10cSrcweir.ELSE
60cdf0e10cSrcweir.INCLUDE :  pyversion.mk
61cdf0e10cSrcweirPYUNORC=pyuno.ini
62cdf0e10cSrcweirDLLPOST=.pyd
63cdf0e10cSrcweir.ENDIF
64cdf0e10cSrcweir
65cdf0e10cSrcweir.IF "$(SYSTEM_PYTHON)" == "YES"
66cdf0e10cSrcweirPYTHONLIB=$(PYTHON_LIBS)
67cdf0e10cSrcweirCFLAGS+=$(PYTHON_CFLAGS)
68cdf0e10cSrcweir.ELSE # "$(SYSTEM_PYTHON)" == "YES"
69cdf0e10cSrcweir.INCLUDE :  pyversion.mk
70cdf0e10cSrcweirCFLAGS+=-I$(SOLARINCDIR)$/python
71cdf0e10cSrcweir.ENDIF # "$(SYSTEM_PYTHON)" == "YES"
72cdf0e10cSrcweir
73cdf0e10cSrcweirSHL1TARGET=$(TARGET)
74cdf0e10cSrcweirSLOFILES= \
75cdf0e10cSrcweir		$(SLO)$/pyuno_runtime.obj 	\
76cdf0e10cSrcweir		$(SLO)$/pyuno.obj 		\
77cdf0e10cSrcweir		$(SLO)$/pyuno_callable.obj 	\
78cdf0e10cSrcweir		$(SLO)$/pyuno_module.obj 	\
79cdf0e10cSrcweir		$(SLO)$/pyuno_type.obj 		\
80cdf0e10cSrcweir		$(SLO)$/pyuno_util.obj		\
81cdf0e10cSrcweir		$(SLO)$/pyuno_except.obj	\
82cdf0e10cSrcweir		$(SLO)$/pyuno_adapter.obj	\
83cdf0e10cSrcweir		$(SLO)$/pyuno_gc.obj
84cdf0e10cSrcweir
85cdf0e10cSrcweir# remove this, when issue i35064 is integrated
86cdf0e10cSrcweir.IF "$(COM)"=="GCC"
87cdf0e10cSrcweirNOOPTFILES= \
88cdf0e10cSrcweir	$(SLO)$/pyuno_module.obj
89cdf0e10cSrcweir.ENDIF			# "$(COM)"=="GCC"
90cdf0e10cSrcweir
91cdf0e10cSrcweir
92cdf0e10cSrcweirSHL1STDLIBS= \
93cdf0e10cSrcweir		$(CPPULIB)		\
94cdf0e10cSrcweir		$(CPPUHELPERLIB)	\
95cdf0e10cSrcweir		$(SALLIB)		\
96cdf0e10cSrcweir		$(PYTHONLIB) 		\
97cdf0e10cSrcweir		$(EXTRA_FRAMEWORK_FLAG)
98cdf0e10cSrcweir
99cdf0e10cSrcweirSHL1DEPN=
100cdf0e10cSrcweirSHL1LIBS=$(SLB)$/$(TARGET).lib
101cdf0e10cSrcweirSHL1IMPLIB=i$(TARGET)
102cdf0e10cSrcweir
103cdf0e10cSrcweirSHL1DEF=	$(MISC)$/$(SHL1TARGET).def
104cdf0e10cSrcweir
105cdf0e10cSrcweirDEF1NAME=	$(SHL1TARGET)
106cdf0e10cSrcweirDEF1DEPN=	$(MISC)$/pyuno.flt
107cdf0e10cSrcweir
108cdf0e10cSrcweirDEFLIB1NAME=$(TARGET)
109cdf0e10cSrcweir
110cdf0e10cSrcweir# --- Targets ------------------------------------------------------
111cdf0e10cSrcweir
112cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC"
113cdf0e10cSrcweirALLTAR : \
114cdf0e10cSrcweir	$(DLLDEST)$/uno.py 		\
115cdf0e10cSrcweir	$(DLLDEST)$/unohelper.py	\
116cdf0e10cSrcweir	$(PYUNO_MODULE)			\
117cdf0e10cSrcweir	$(MISC)$/$(PYUNORC)		\
118cdf0e10cSrcweir	$(LB)$/lib$(TARGET).a
119cdf0e10cSrcweir
120cdf0e10cSrcweir$(LB)$/lib$(TARGET).a: $(MISC)$/$(TARGET).def
121cdf0e10cSrcweir	dlltool --dllname $(TARGET)$(DLLPOST) --input-def=$(MISC)$/$(TARGET).def --kill-at --output-lib=$(LB)$/lib$(TARGET).a
122cdf0e10cSrcweir.ELSE
123cdf0e10cSrcweirALLTAR : \
124cdf0e10cSrcweir	$(DLLDEST)$/uno.py 		\
125cdf0e10cSrcweir	$(DLLDEST)$/unohelper.py	\
126cdf0e10cSrcweir	$(PYUNO_MODULE)			\
127cdf0e10cSrcweir	$(MISC)$/$(PYUNORC)
128cdf0e10cSrcweir.ENDIF
129cdf0e10cSrcweir.ENDIF
130cdf0e10cSrcweir
131cdf0e10cSrcweir.INCLUDE :  target.mk
132cdf0e10cSrcweir.IF "$(L10N_framework)"==""
133cdf0e10cSrcweir$(DLLDEST)$/%.py: %.py
134cdf0e10cSrcweir	cp $? $@
135cdf0e10cSrcweir
136cdf0e10cSrcweir
137cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
138cdf0e10cSrcweir$(PYUNO_MODULE) : $(SLO)$/pyuno_dlopenwrapper.obj
139cdf0e10cSrcweir.IF "$(OS)" == "LINUX"
140cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSRUNPATH_OOO) $(LINKFLAGSSHLCUI) -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
141cdf0e10cSrcweir.ELIF "$(OS)" == "SOLARIS"
142cdf0e10cSrcweir	@echo ld -G -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
143cdf0e10cSrcweir.ELIF "$(OS)" == "FREEBSD"
144cdf0e10cSrcweir	@echo ld -shared -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
145cdf0e10cSrcweir.ELIF "$(OS)" == "NETBSD"
146cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
147cdf0e10cSrcweir.ELIF "$(OS)" == "MACOSX"
148cdf0e10cSrcweir	@echo $(CC) -bundle -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o $(EXTRA_LINKFLAGS) $(EXTRA_FRAMEWORK_FLAG) > $(MISC)$/$(@:b).cmd
149cdf0e10cSrcweir.ELSE
150cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
151cdf0e10cSrcweir.ENDIF
152cdf0e10cSrcweir	cat $(MISC)$/$(@:b).cmd
153cdf0e10cSrcweir	@+source $(MISC)$/$(@:b).cmd
154cdf0e10cSrcweir.ENDIF
155cdf0e10cSrcweir
156cdf0e10cSrcweir
157cdf0e10cSrcweir$(MISC)$/$(PYUNORC) : pyuno
158cdf0e10cSrcweir	-rm -f $@
159cdf0e10cSrcweir	cat pyuno > $@
160cdf0e10cSrcweir
161cdf0e10cSrcweir$(MISC)$/pyuno.flt : pyuno.flt
162cdf0e10cSrcweir	-rm -f $@
163cdf0e10cSrcweir	cat $? > $@
164cdf0e10cSrcweir.ENDIF # L10N_framework
165cdf0e10cSrcweir
166