xref: /aoo41x/main/pyuno/source/module/makefile.mk (revision 7871dc3e)
1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweirPRJ=..$/..
24cdf0e10cSrcweir
25cdf0e10cSrcweirPRJNAME=pyuno
26cdf0e10cSrcweirTARGET=pyuno
27cdf0e10cSrcweirENABLE_EXCEPTIONS=TRUE
28cdf0e10cSrcweir
29cdf0e10cSrcweirLINKFLAGSDEFS = # do not fail with missing symbols
30cdf0e10cSrcweir
31cdf0e10cSrcweir# --- Settings -----------------------------------------------------
32cdf0e10cSrcweir
33cdf0e10cSrcweir.INCLUDE :  settings.mk
34cdf0e10cSrcweir.IF "$(L10N_framework)"==""
35cdf0e10cSrcweir#-------------------------------------------------------------------
36cdf0e10cSrcweir
37cdf0e10cSrcweir.IF "$(OS)$(COMEX)" == "SOLARIS4"
38cdf0e10cSrcweir# no -Bdirect for SunWS CC
39cdf0e10cSrcweirDIRECT = $(LINKFLAGSDEFS)
40cdf0e10cSrcweir.ENDIF
41cdf0e10cSrcweir
42cdf0e10cSrcweir# special setting from environment
43cdf0e10cSrcweir.IF "$(EXTRA_CFLAGS)"!=""
44cdf0e10cSrcweirEXTRA_FRAMEWORK_FLAG=-framework Python
45cdf0e10cSrcweir.ENDIF # .IF "$(EXTRA_CFLAGS)"!=""
46cdf0e10cSrcweir
47cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
48cdf0e10cSrcweir# python expects modules without the lib prefix
49cdf0e10cSrcweir# pyuno.so even on Mac OS X, because it is a python module
50cdf0e10cSrcweirPYUNO_MODULE=$(DLLDEST)$/pyuno.so
51cdf0e10cSrcweirPYUNORC=pyunorc
52cdf0e10cSrcweir.ELIF "$(GUI)" == "OS2"
53bca6f9a9SPedro Giffuni#.INCLUDE :  pyversion.mk
54cdf0e10cSrcweirPYUNORC=pyuno.ini
55cdf0e10cSrcweir.ELSE
56cdf0e10cSrcweir.INCLUDE :  pyversion.mk
57cdf0e10cSrcweirPYUNORC=pyuno.ini
58cdf0e10cSrcweirDLLPOST=.pyd
59cdf0e10cSrcweir.ENDIF
60cdf0e10cSrcweir
61cdf0e10cSrcweir.IF "$(SYSTEM_PYTHON)" == "YES"
62cdf0e10cSrcweirPYTHONLIB=$(PYTHON_LIBS)
63cdf0e10cSrcweirCFLAGS+=$(PYTHON_CFLAGS)
64cdf0e10cSrcweir.ELSE # "$(SYSTEM_PYTHON)" == "YES"
65cdf0e10cSrcweir.INCLUDE :  pyversion.mk
66cdf0e10cSrcweirCFLAGS+=-I$(SOLARINCDIR)$/python
67cdf0e10cSrcweir.ENDIF # "$(SYSTEM_PYTHON)" == "YES"
68cdf0e10cSrcweir
69cdf0e10cSrcweirSHL1TARGET=$(TARGET)
70cdf0e10cSrcweirSLOFILES= \
71cdf0e10cSrcweir		$(SLO)$/pyuno_runtime.obj 	\
72cdf0e10cSrcweir		$(SLO)$/pyuno.obj 		\
73cdf0e10cSrcweir		$(SLO)$/pyuno_callable.obj 	\
74cdf0e10cSrcweir		$(SLO)$/pyuno_module.obj 	\
75cdf0e10cSrcweir		$(SLO)$/pyuno_type.obj 		\
76cdf0e10cSrcweir		$(SLO)$/pyuno_util.obj		\
77cdf0e10cSrcweir		$(SLO)$/pyuno_except.obj	\
78cdf0e10cSrcweir		$(SLO)$/pyuno_adapter.obj	\
79cdf0e10cSrcweir		$(SLO)$/pyuno_gc.obj
80cdf0e10cSrcweir
81cdf0e10cSrcweir# remove this, when issue i35064 is integrated
82cdf0e10cSrcweir.IF "$(COM)"=="GCC"
83cdf0e10cSrcweirNOOPTFILES= \
84cdf0e10cSrcweir	$(SLO)$/pyuno_module.obj
85cdf0e10cSrcweir.ENDIF			# "$(COM)"=="GCC"
86cdf0e10cSrcweir
87cdf0e10cSrcweir
88cdf0e10cSrcweirSHL1STDLIBS= \
89cdf0e10cSrcweir		$(CPPULIB)		\
90cdf0e10cSrcweir		$(CPPUHELPERLIB)	\
91cdf0e10cSrcweir		$(SALLIB)		\
92cdf0e10cSrcweir		$(PYTHONLIB) 		\
93cdf0e10cSrcweir		$(EXTRA_FRAMEWORK_FLAG)
94cdf0e10cSrcweir
95cdf0e10cSrcweirSHL1DEPN=
96cdf0e10cSrcweirSHL1LIBS=$(SLB)$/$(TARGET).lib
97cdf0e10cSrcweirSHL1IMPLIB=i$(TARGET)
98cdf0e10cSrcweir
99cdf0e10cSrcweirSHL1DEF=	$(MISC)$/$(SHL1TARGET).def
100cdf0e10cSrcweir
101cdf0e10cSrcweirDEF1NAME=	$(SHL1TARGET)
102cdf0e10cSrcweirDEF1DEPN=	$(MISC)$/pyuno.flt
103cdf0e10cSrcweir
104cdf0e10cSrcweirDEFLIB1NAME=$(TARGET)
105cdf0e10cSrcweir
106cdf0e10cSrcweir# --- Targets ------------------------------------------------------
107cdf0e10cSrcweir
108cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC"
109cdf0e10cSrcweirALLTAR : \
110cdf0e10cSrcweir	$(DLLDEST)$/uno.py 		\
111cdf0e10cSrcweir	$(DLLDEST)$/unohelper.py	\
112cdf0e10cSrcweir	$(PYUNO_MODULE)			\
113cdf0e10cSrcweir	$(MISC)$/$(PYUNORC)		\
114cdf0e10cSrcweir	$(LB)$/lib$(TARGET).a
115cdf0e10cSrcweir
116cdf0e10cSrcweir$(LB)$/lib$(TARGET).a: $(MISC)$/$(TARGET).def
117cdf0e10cSrcweir	dlltool --dllname $(TARGET)$(DLLPOST) --input-def=$(MISC)$/$(TARGET).def --kill-at --output-lib=$(LB)$/lib$(TARGET).a
118cdf0e10cSrcweir.ELSE
119cdf0e10cSrcweirALLTAR : \
120cdf0e10cSrcweir	$(DLLDEST)$/uno.py 		\
121cdf0e10cSrcweir	$(DLLDEST)$/unohelper.py	\
122cdf0e10cSrcweir	$(PYUNO_MODULE)			\
123cdf0e10cSrcweir	$(MISC)$/$(PYUNORC)
124cdf0e10cSrcweir.ENDIF
125cdf0e10cSrcweir.ENDIF
126cdf0e10cSrcweir
127cdf0e10cSrcweir.INCLUDE :  target.mk
128cdf0e10cSrcweir.IF "$(L10N_framework)"==""
129cdf0e10cSrcweir$(DLLDEST)$/%.py: %.py
130cdf0e10cSrcweir	cp $? $@
131cdf0e10cSrcweir
132cdf0e10cSrcweir
133cdf0e10cSrcweir.IF "$(GUI)" == "UNX"
134cdf0e10cSrcweir$(PYUNO_MODULE) : $(SLO)$/pyuno_dlopenwrapper.obj
135cdf0e10cSrcweir.IF "$(OS)" == "LINUX"
136cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGS) $(LINKFLAGSRUNPATH_OOO) $(LINKFLAGSSHLCUI) -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
137cdf0e10cSrcweir.ELIF "$(OS)" == "SOLARIS"
138cdf0e10cSrcweir	@echo ld -G -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
139cdf0e10cSrcweir.ELIF "$(OS)" == "FREEBSD"
140cdf0e10cSrcweir	@echo ld -shared -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
141cdf0e10cSrcweir.ELIF "$(OS)" == "NETBSD"
142cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
143cdf0e10cSrcweir.ELIF "$(OS)" == "MACOSX"
144cdf0e10cSrcweir	@echo $(CC) -bundle -ldl -o $@ $(SLO)$/pyuno_dlopenwrapper.o $(EXTRA_LINKFLAGS) $(EXTRA_FRAMEWORK_FLAG) > $(MISC)$/$(@:b).cmd
145cdf0e10cSrcweir.ELSE
146cdf0e10cSrcweir	@echo $(LINK) $(LINKFLAGSSHLCUI) -o $@ $(SLO)$/pyuno_dlopenwrapper.o > $(MISC)$/$(@:b).cmd
147cdf0e10cSrcweir.ENDIF
148cdf0e10cSrcweir	cat $(MISC)$/$(@:b).cmd
149cdf0e10cSrcweir	@+source $(MISC)$/$(@:b).cmd
150cdf0e10cSrcweir.ENDIF
151cdf0e10cSrcweir
152cdf0e10cSrcweir
153cdf0e10cSrcweir$(MISC)$/$(PYUNORC) : pyuno
154cdf0e10cSrcweir	-rm -f $@
155cdf0e10cSrcweir	cat pyuno > $@
156cdf0e10cSrcweir
157cdf0e10cSrcweir$(MISC)$/pyuno.flt : pyuno.flt
158cdf0e10cSrcweir	-rm -f $@
159cdf0e10cSrcweir	cat $? > $@
160cdf0e10cSrcweir.ENDIF # L10N_framework
161cdf0e10cSrcweir
162