update dev300-m57
[ooovba.git] / sal / util / makefile.mk
blob0cecb1575bb7d8c3df7e72b994b19fada5afeb1c
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.51 $
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 #*************************************************************************
32 PRJ=..
34 PRJNAME=sal
35 TARGET=sal
37 NO_BSYMBOLIC=TRUE
38 NO_DEFAULT_STL=TRUE
40 USE_LDUMP2=TRUE
41 USE_DEFFILE=TRUE
43 .IF "$(GUI)"=="UNX"
44 TARGETTYPE=CUI
45 .ENDIF # UNX
47 UNIXVERSIONNAMES=UDK
49 # --- Settings -----------------------------------------------------
51 .INCLUDE : settings.mk
53 CFLAGS+= $(LFS_CFLAGS)
54 CXXFLAGS+= $(LFS_CFLAGS)
56 .IF "$(depend)" == ""
58 # --- Files --------------------------------------------------------
60 # disable check for PIC code as it would complain about
61 # hand coded assembler
62 CHECKFORPIC=
64 .IF "$(header)" == ""
66 LIB1TARGET=$(SLB)$/$(TARGET).lib
67 LIB1FILES= \
68 $(SLB)$/oslall.lib \
69 $(SLB)$/cpposl.lib \
70 $(SLB)$/cpprtl.lib \
71 $(SLB)$/textenc.lib
73 #.IF "$(GUI)"=="UNX"
74 #LIB1FILES+=$(SLB)$/systoolsunx.lib
75 #.ENDIF # UNX
78 LIB3TARGET=$(LB)$/a$(TARGET).lib
79 LIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
80 LIB3FILES= \
81 $(LB)$/oslall.lib \
82 $(LB)$/cpposl.lib \
83 $(LB)$/cpprtl.lib \
84 $(LB)$/textenc.lib
86 #.IF "$(GUI)"=="UNX"
87 #LIB3FILES+=$(LB)$/systoolsunx.lib
88 #.ENDIF # UNX
90 .IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
91 SHL1TARGET= $(TARGET)
92 .ELSE
93 SHL1TARGET= uno_$(TARGET)
94 .ENDIF
95 SHL1IMPLIB= i$(TARGET)
96 SHL1VERSIONMAP= $(TARGET).map
97 SHL1RPATH=URELIB
99 .IF "$(GUI)"=="WNT"
101 .IF "$(COM)"=="GCC"
102 UWINAPILIB= -luwinapi
103 .ELSE
104 UWINAPILIB= $(LB)$/uwinapi.lib
105 .ENDIF
107 SHL1STDLIBS= \
108 $(UWINAPILIB)\
109 $(ADVAPI32LIB)\
110 $(WSOCK32LIB)\
111 $(MPRLIB)\
112 $(SHELL32LIB)\
113 $(COMDLG32LIB)\
114 $(USER32LIB)\
115 $(OLE32LIB)
116 .IF "$(COM)"=="GCC"
117 MINGWSSTDOBJ=
118 MINGWSSTDENDOBJ=
119 .ENDIF
120 .ENDIF # WNT
122 .IF "$(GUI)"=="UNX"
123 .IF "$(OS)"=="SOLARIS"
124 # libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
125 SHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
126 .IF "$(COM)" == "C50"
127 SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
128 .ENDIF # C50
129 .ENDIF # SOLARIS
130 .IF "$(OS)"=="IRIX"
131 SHL1STDLIBS= -lexc
132 .ENDIF
133 .ENDIF # UNX
135 .IF "$(GUI)"=="OS2"
136 SHL1STDLIBS=pthread.lib
137 .ENDIF # OS2
139 # If we compile sal with STLport checking iterators
140 # we need to link against the STLport
141 .IF "$(USE_STLP_DEBUG)" != ""
142 SHL1STDLIBS+=$(LIBSTLPORT)
143 .ENDIF
145 #The irony that using the system STL instead of
146 #stlport requires that we link libsal with the
147 #LIBSTLPORT alias which is not required when using
148 #stlport is not lost on me
149 .IF "$(USE_SYSTEM_STL)"=="YES"
150 SHL1STDLIBS+=$(LIBSTLPORT)
151 .ENDIF
153 .IF "$(OS)"=="MACOSX"
154 SHL1STDLIBS+=-framework CoreFoundation -framework Carbon
155 .ENDIF
157 .IF "$(OS)" == "LINUX"
158 .IF "$(PAM_LINK)" == "YES"
159 SHL1STDLIBS+=-lpam
160 .ENDIF
161 .IF "$(CRYPT_LINK)" == "YES"
162 SHL1STDLIBS+=-lcrypt
163 .ENDIF
164 .ENDIF
166 SHL1LIBS+=$(SLB)$/$(TARGET).lib
168 .IF "$(linkinc)" != ""
169 SHL11FILE=$(MISC)$/sal.slo
170 .ELSE
171 .IF "$(GUI)"=="UNX"
172 SHL1OBJS=
173 .ELSE
174 .IF "$(GUI)$(COM)"!="WNTGCC"
175 SHL1OBJS= \
176 $(SLO)$/dllentry.obj
177 .ENDIF # WNTGCC
178 .ENDIF # UNX
179 .ENDIF # lincinc
181 SHL1DEPN=
182 SHL1DEF= $(MISC)$/$(SHL1TARGET).def
184 DEF1NAME= $(SHL1TARGET)
187 # This part builds a tiny extra lib,
188 # containing an alloc.c which uses system
189 # heap instead of our own mem management.
190 # This is e.g. useful for proper valgrinding
191 # the office.
193 .IF "$(OS)"=="LINUX"
195 TARGET2 = salalloc_malloc
196 SHL2TARGET= $(TARGET2)
197 SHL2IMPLIB= i$(TARGET2)
198 SHL2VERSIONMAP= salalloc.map
200 SHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
202 .ENDIF # .IF "$(OS)"=="LINUX"
204 # --- Coverage -----------------------------------------------------
205 # LLA: 20040304 The follows lines are an additional which is only need if we run
206 # coverage tests. For normal test runs this feature is not used.
207 # For more information about coverage tests see:
208 # http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
210 # Why this additional?
211 # Anybody has decide to link sal with g++ instead of gcc.
213 .IF "$(TESTCOVERAGE)"!=""
214 .IF "$(GUI)"=="UNX"
215 .IF "$(COM)"=="GCC"
216 .IF "$(OS)"=="LINUX"
217 SHL1STDLIBS+=-lgcc
218 .ENDIF
219 .ENDIF
220 .ENDIF
221 .ENDIF
223 SHL4DEPN+=$(SHL1TARGETN)
224 SHL4LIBS=$(SLB)$/textenc_tables.lib
225 SHL4TARGET=uno_sal_textenc
226 SHL4STDLIBS=$(SALLIB)
227 SHL4VERSIONMAP=saltextenc.map
229 SHL4DEF=$(MISC)$/$(SHL4TARGET).def
230 DEF4NAME=$(SHL4TARGET)
232 # --- Targets ------------------------------------------------------
234 .ENDIF # $(header) != ""
235 .ENDIF # $(depend) != ""
237 .INCLUDE : target.mk
239 .IF "$(SHL1TARGETN)" != ""
240 $(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
241 .ENDIF # "$(SHL1TARGETN)" != ""
243 .IF "$(GUI)"=="UNX" || "$(USE_SHELL)"!="4nt"
245 $(OUT)$/inc$/udkversion.h:
246 echo '#ifndef _SAL_UDKVERSION_H_' > $@
247 echo '#define _SAL_UDKVERSION_H_' >> $@
248 echo '' >> $@
249 echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
250 echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
251 echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
252 echo '' >> $@
253 echo '#endif' >> $@
255 .ELSE
257 $(OUT)$/inc$/udkversion.h:
258 echo #ifndef _SAL_UDKVERSION_H_ > $@
259 echo #define _SAL_UDKVERSION_H_ >> $@
260 echo. >> $@
261 echo #define SAL_UDK_MAJOR "$(UDK_MAJOR)" >> $@
262 echo #define SAL_UDK_MINOR "$(UDK_MINOR)" >> $@
263 echo #define SAL_UDK_MICRO "$(UDK_MICRO)" >> $@
264 echo. >> $@
265 echo #endif >> $@
267 .ENDIF