xref: /aoo42x/main/sal/util/makefile.mk (revision a4523a2b)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ=..
25
26PRJNAME=sal
27TARGET=sal
28
29NO_BSYMBOLIC=TRUE
30NO_DEFAULT_STL=TRUE
31
32USE_LDUMP2=TRUE
33USE_DEFFILE=TRUE
34
35.IF "$(GUI)"=="UNX"
36TARGETTYPE=CUI
37.ENDIF # UNX
38
39.IF "$(OS)" != "MACOSX"
40UNIXVERSIONNAMES=UDK
41.ENDIF
42
43# --- Settings -----------------------------------------------------
44
45.INCLUDE :  settings.mk
46
47CFLAGS+= $(LFS_CFLAGS)
48CXXFLAGS+= $(LFS_CFLAGS)
49
50.IF "$(depend)" == ""
51
52# --- Files --------------------------------------------------------
53
54# disable check for PIC code as it would complain about
55# hand coded assembler
56CHECKFORPIC=
57
58.IF "$(header)" == ""
59
60LIB1TARGET=$(SLB)$/$(TARGET).lib
61LIB1FILES=	\
62	$(SLB)$/oslall.lib	\
63	$(SLB)$/cpposl.lib	\
64	$(SLB)$/cpprtl.lib	\
65	$(SLB)$/textenc.lib
66
67#.IF "$(GUI)"=="UNX"
68#LIB1FILES+=$(SLB)$/systoolsunx.lib
69#.ENDIF # UNX
70
71
72LIB3TARGET=$(LB)$/a$(TARGET).lib
73LIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
74LIB3FILES=	\
75	$(LB)$/oslall.lib	\
76	$(LB)$/cpposl.lib	\
77	$(LB)$/cpprtl.lib	\
78	$(LB)$/textenc.lib
79
80#.IF "$(GUI)"=="UNX"
81#LIB3FILES+=$(LB)$/systoolsunx.lib
82#.ENDIF # UNX
83
84.IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
85SHL1TARGET= $(TARGET)
86.ELSE
87SHL1TARGET= uno_$(TARGET)
88.ENDIF
89SHL1IMPLIB= i$(TARGET)
90SHL1VERSIONMAP=	$(TARGET).map
91SHL1RPATH=URELIB
92
93.IF "$(GUI)"=="WNT"
94
95.IF "$(COM)"=="GCC"
96UWINAPILIB=     -luwinapi
97.ELSE
98UWINAPILIB=     $(LB)$/uwinapi.lib
99.ENDIF
100
101SHL1STDLIBS=	\
102				$(UWINAPILIB)\
103				$(ADVAPI32LIB)\
104				$(WSOCK32LIB)\
105				$(MPRLIB)\
106				$(SHELL32LIB)\
107				$(COMDLG32LIB)\
108				$(USER32LIB)\
109				$(OLE32LIB)
110.IF "$(COM)"=="GCC"
111MINGWSSTDOBJ=
112MINGWSSTDENDOBJ=
113.ENDIF
114.ENDIF # WNT
115
116.IF "$(GUI)"=="UNX"
117.IF "$(OS)"=="SOLARIS"
118# libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
119SHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
120.IF "$(COM)" == "C50"
121SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
122.ENDIF # C50
123.ENDIF # SOLARIS
124.ENDIF # UNX
125
126.IF "$(GUI)"=="OS2"
127SHL1STDLIBS=-lmmap -lpthread
128.ENDIF # OS2
129
130.IF "$(OS)"=="MACOSX"
131SHL1STDLIBS+=-framework CoreFoundation -framework Carbon
132.ENDIF
133
134.IF "$(OS)" == "LINUX"
135.IF "$(PAM_LINK)" == "YES"
136SHL1STDLIBS+=-lpam
137.ENDIF
138.IF "$(CRYPT_LINK)" == "YES"
139SHL1STDLIBS+=-lcrypt
140.ENDIF
141.ENDIF
142
143# #i105898# required for LD_PRELOAD libsalalloc_malloc.so
144#           if sal is linked with -Bsymbolic-functions
145.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
146SHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list
147.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
148
149SHL1LIBS+=$(SLB)$/$(TARGET).lib
150
151.IF "$(linkinc)" != ""
152SHL11FILE=$(MISC)$/sal.slo
153.ELSE
154.IF "$(GUI)"=="UNX"
155SHL1OBJS=
156.ELSE
157.IF "$(GUI)$(COM)"!="WNTGCC"
158SHL1OBJS= \
159    $(SLO)$/dllentry.obj
160.ENDIF # WNTGCC
161.ENDIF # UNX
162.ENDIF # lincinc
163
164SHL1DEPN=
165SHL1DEF=    $(MISC)$/$(SHL1TARGET).def
166
167DEF1NAME= $(SHL1TARGET)
168
169#
170# This part builds a tiny extra lib,
171# containing an alloc.c which uses system
172# heap instead of our own mem management.
173# This is e.g. useful for proper valgrinding
174# the office.
175#
176.IF "$(OS)"=="LINUX"
177
178TARGET2 = salalloc_malloc
179SHL2TARGET= $(TARGET2)
180SHL2IMPLIB= i$(TARGET2)
181SHL2VERSIONMAP=	salalloc.map
182
183SHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
184
185.ENDIF # .IF "$(OS)"=="LINUX"
186
187# --- Coverage -----------------------------------------------------
188# LLA: 20040304 The follows lines are an additional which is only need if we run
189#               coverage tests. For normal test runs this feature is not used.
190#               For more information about coverage tests see:
191#               http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
192#
193#               Why this additional?
194#               Anybody has decide to link sal with g++ instead of gcc.
195#
196.IF "$(TESTCOVERAGE)"!=""
197.IF "$(GUI)"=="UNX"
198.IF "$(COM)"=="GCC"
199.IF "$(OS)"=="LINUX"
200SHL1STDLIBS+=-lgcc
201.ENDIF
202.ENDIF
203.ENDIF
204.ENDIF
205
206# --- Targets ------------------------------------------------------
207
208.ENDIF # $(header) != ""
209.ENDIF # $(depend) != ""
210
211.INCLUDE :  target.mk
212
213.IF "$(SHL1TARGETN)" != ""
214$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
215.ENDIF # "$(SHL1TARGETN)" != ""
216
217$(OUT)$/inc$/udkversion.h:
218	echo '#ifndef _SAL_UDKVERSION_H_'           >  $@
219	echo '#define _SAL_UDKVERSION_H_'           >> $@
220	echo ''                                     >> $@
221	echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
222	echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
223	echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
224	echo ''                                     >> $@
225	echo '#endif'                               >> $@
226