xref: /trunk/main/sal/util/makefile.mk (revision dcc6e752)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28PRJ=..
29
30PRJNAME=sal
31TARGET=sal
32
33NO_BSYMBOLIC=TRUE
34NO_DEFAULT_STL=TRUE
35
36USE_LDUMP2=TRUE
37USE_DEFFILE=TRUE
38
39.IF "$(GUI)"=="UNX"
40TARGETTYPE=CUI
41.ENDIF # UNX
42
43UNIXVERSIONNAMES=UDK
44
45# --- Settings -----------------------------------------------------
46
47.INCLUDE :  settings.mk
48
49CFLAGS+= $(LFS_CFLAGS)
50CXXFLAGS+= $(LFS_CFLAGS)
51
52.IF "$(depend)" == ""
53
54# --- Files --------------------------------------------------------
55
56# disable check for PIC code as it would complain about
57# hand coded assembler
58CHECKFORPIC=
59
60.IF "$(header)" == ""
61
62LIB1TARGET=$(SLB)$/$(TARGET).lib
63LIB1FILES=	\
64	$(SLB)$/oslall.lib	\
65	$(SLB)$/cpposl.lib	\
66	$(SLB)$/cpprtl.lib	\
67	$(SLB)$/textenc.lib
68
69#.IF "$(GUI)"=="UNX"
70#LIB1FILES+=$(SLB)$/systoolsunx.lib
71#.ENDIF # UNX
72
73
74LIB3TARGET=$(LB)$/a$(TARGET).lib
75LIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
76LIB3FILES=	\
77	$(LB)$/oslall.lib	\
78	$(LB)$/cpposl.lib	\
79	$(LB)$/cpprtl.lib	\
80	$(LB)$/textenc.lib
81
82#.IF "$(GUI)"=="UNX"
83#LIB3FILES+=$(LB)$/systoolsunx.lib
84#.ENDIF # UNX
85
86.IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
87SHL1TARGET= $(TARGET)
88.ELSE
89SHL1TARGET= uno_$(TARGET)
90.ENDIF
91SHL1IMPLIB= i$(TARGET)
92SHL1VERSIONMAP=	$(TARGET).map
93SHL1RPATH=URELIB
94
95.IF "$(GUI)"=="WNT"
96
97.IF "$(COM)"=="GCC"
98UWINAPILIB=     -luwinapi
99.ELSE
100UWINAPILIB=     $(LB)$/uwinapi.lib
101.ENDIF
102
103SHL1STDLIBS=	\
104				$(UWINAPILIB)\
105				$(ADVAPI32LIB)\
106				$(WSOCK32LIB)\
107				$(MPRLIB)\
108				$(SHELL32LIB)\
109				$(COMDLG32LIB)\
110				$(USER32LIB)\
111				$(OLE32LIB)
112.IF "$(COM)"=="GCC"
113MINGWSSTDOBJ=
114MINGWSSTDENDOBJ=
115.ENDIF
116.ENDIF # WNT
117
118.IF "$(GUI)"=="UNX"
119.IF "$(OS)"=="SOLARIS"
120# libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
121SHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
122.IF "$(COM)" == "C50"
123SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
124.ENDIF # C50
125.ENDIF # SOLARIS
126.ENDIF # UNX
127
128.IF "$(GUI)"=="OS2"
129SHL1STDLIBS=mmap pthread
130.ENDIF # OS2
131
132# If we compile sal with STLport checking iterators
133# we need to link against the STLport
134.IF "$(USE_STLP_DEBUG)" != ""
135SHL1STDLIBS+=$(LIBSTLPORT)
136.ENDIF
137
138#The irony that using the system STL instead of
139#stlport requires that we link libsal with the
140#LIBSTLPORT alias which is not required when using
141#stlport is not lost on me
142.IF "$(USE_SYSTEM_STL)"=="YES"
143SHL1STDLIBS+=$(LIBSTLPORT)
144.ENDIF
145
146.IF "$(OS)"=="MACOSX"
147SHL1STDLIBS+=-framework CoreFoundation -framework Carbon
148.ENDIF
149
150.IF "$(OS)" == "LINUX"
151.IF "$(PAM_LINK)" == "YES"
152SHL1STDLIBS+=-lpam
153.ENDIF
154.IF "$(CRYPT_LINK)" == "YES"
155SHL1STDLIBS+=-lcrypt
156.ENDIF
157.ENDIF
158
159# #i105898# required for LD_PRELOAD libsalalloc_malloc.so
160#           if sal is linked with -Bsymbolic-functions
161.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
162SHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list
163.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
164
165SHL1LIBS+=$(SLB)$/$(TARGET).lib
166
167.IF "$(linkinc)" != ""
168SHL11FILE=$(MISC)$/sal.slo
169.ELSE
170.IF "$(GUI)"=="UNX"
171SHL1OBJS=
172.ELSE
173.IF "$(GUI)$(COM)"!="WNTGCC"
174SHL1OBJS= \
175    $(SLO)$/dllentry.obj
176.ENDIF # WNTGCC
177.ENDIF # UNX
178.ENDIF # lincinc
179
180SHL1DEPN=
181SHL1DEF=    $(MISC)$/$(SHL1TARGET).def
182
183DEF1NAME= $(SHL1TARGET)
184
185#
186# This part builds a tiny extra lib,
187# containing an alloc.c which uses system
188# heap instead of our own mem management.
189# This is e.g. useful for proper valgrinding
190# the office.
191#
192.IF "$(OS)"=="LINUX"
193
194TARGET2 = salalloc_malloc
195SHL2TARGET= $(TARGET2)
196SHL2IMPLIB= i$(TARGET2)
197SHL2VERSIONMAP=	salalloc.map
198
199SHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
200
201.ENDIF # .IF "$(OS)"=="LINUX"
202
203# --- Coverage -----------------------------------------------------
204# LLA: 20040304 The follows lines are an additional which is only need if we run
205#               coverage tests. For normal test runs this feature is not used.
206#               For more information about coverage tests see:
207#               http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
208#
209#               Why this additional?
210#               Anybody has decide to link sal with g++ instead of gcc.
211#
212.IF "$(TESTCOVERAGE)"!=""
213.IF "$(GUI)"=="UNX"
214.IF "$(COM)"=="GCC"
215.IF "$(OS)"=="LINUX"
216SHL1STDLIBS+=-lgcc
217.ENDIF
218.ENDIF
219.ENDIF
220.ENDIF
221
222# --- Targets ------------------------------------------------------
223
224.ENDIF # $(header) != ""
225.ENDIF # $(depend) != ""
226
227.INCLUDE :  target.mk
228
229.IF "$(SHL1TARGETN)" != ""
230$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
231.ENDIF # "$(SHL1TARGETN)" != ""
232
233$(OUT)$/inc$/udkversion.h:
234	echo '#ifndef _SAL_UDKVERSION_H_'           >  $@
235	echo '#define _SAL_UDKVERSION_H_'           >> $@
236	echo ''                                     >> $@
237	echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
238	echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
239	echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
240	echo ''                                     >> $@
241	echo '#endif'                               >> $@
242