xref: /aoo4110/main/sal/util/makefile.mk (revision b1cdbd2c)
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
39UNIXVERSIONNAMES=UDK
40
41# --- Settings -----------------------------------------------------
42
43.INCLUDE :  settings.mk
44
45CFLAGS+= $(LFS_CFLAGS)
46CXXFLAGS+= $(LFS_CFLAGS)
47
48.IF "$(depend)" == ""
49
50# --- Files --------------------------------------------------------
51
52# disable check for PIC code as it would complain about
53# hand coded assembler
54CHECKFORPIC=
55
56.IF "$(header)" == ""
57
58LIB1TARGET=$(SLB)$/$(TARGET).lib
59LIB1FILES=	\
60	$(SLB)$/oslall.lib	\
61	$(SLB)$/cpposl.lib	\
62	$(SLB)$/cpprtl.lib	\
63	$(SLB)$/textenc.lib
64
65#.IF "$(GUI)"=="UNX"
66#LIB1FILES+=$(SLB)$/systoolsunx.lib
67#.ENDIF # UNX
68
69
70LIB3TARGET=$(LB)$/a$(TARGET).lib
71LIB3ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
72LIB3FILES=	\
73	$(LB)$/oslall.lib	\
74	$(LB)$/cpposl.lib	\
75	$(LB)$/cpprtl.lib	\
76	$(LB)$/textenc.lib
77
78#.IF "$(GUI)"=="UNX"
79#LIB3FILES+=$(LB)$/systoolsunx.lib
80#.ENDIF # UNX
81
82.IF "$(GUI)" == "WNT" || "$(GUI)"=="OS2"
83SHL1TARGET= $(TARGET)
84.ELSE
85SHL1TARGET= uno_$(TARGET)
86.ENDIF
87SHL1IMPLIB= i$(TARGET)
88SHL1VERSIONMAP=	$(TARGET).map
89SHL1RPATH=URELIB
90
91.IF "$(GUI)"=="WNT"
92
93.IF "$(COM)"=="GCC"
94UWINAPILIB=     -luwinapi
95.ELSE
96UWINAPILIB=     $(LB)$/uwinapi.lib
97.ENDIF
98
99SHL1STDLIBS=	\
100				$(UWINAPILIB)\
101				$(ADVAPI32LIB)\
102				$(WSOCK32LIB)\
103				$(MPRLIB)\
104				$(SHELL32LIB)\
105				$(COMDLG32LIB)\
106				$(USER32LIB)\
107				$(OLE32LIB)
108.IF "$(COM)"=="GCC"
109MINGWSSTDOBJ=
110MINGWSSTDENDOBJ=
111.ENDIF
112.ENDIF # WNT
113
114.IF "$(GUI)"=="UNX"
115.IF "$(OS)"=="SOLARIS"
116# libposix4.so (SunOS 5.6) <-> librt.so (SunOS >= 5.7)
117SHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl
118.IF "$(COM)" == "C50"
119SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract
120.ENDIF # C50
121.ENDIF # SOLARIS
122.ENDIF # UNX
123
124.IF "$(GUI)"=="OS2"
125SHL1STDLIBS=-lmmap -lpthread
126.ENDIF # OS2
127
128.IF "$(OS)"=="MACOSX"
129SHL1STDLIBS+=-framework CoreFoundation -framework Carbon
130.ENDIF
131
132.IF "$(OS)" == "LINUX"
133.IF "$(PAM_LINK)" == "YES"
134SHL1STDLIBS+=-lpam
135.ENDIF
136.IF "$(CRYPT_LINK)" == "YES"
137SHL1STDLIBS+=-lcrypt
138.ENDIF
139.ENDIF
140
141# #i105898# required for LD_PRELOAD libsalalloc_malloc.so
142#           if sal is linked with -Bsymbolic-functions
143.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
144SHL1LINKFLAGS+=-Wl,--dynamic-list=salalloc.list
145.ENDIF # .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
146
147SHL1LIBS+=$(SLB)$/$(TARGET).lib
148
149.IF "$(linkinc)" != ""
150SHL11FILE=$(MISC)$/sal.slo
151.ELSE
152.IF "$(GUI)"=="UNX"
153SHL1OBJS=
154.ELSE
155.IF "$(GUI)$(COM)"!="WNTGCC"
156SHL1OBJS= \
157    $(SLO)$/dllentry.obj
158.ENDIF # WNTGCC
159.ENDIF # UNX
160.ENDIF # lincinc
161
162SHL1DEPN=
163SHL1DEF=    $(MISC)$/$(SHL1TARGET).def
164
165DEF1NAME= $(SHL1TARGET)
166
167#
168# This part builds a tiny extra lib,
169# containing an alloc.c which uses system
170# heap instead of our own mem management.
171# This is e.g. useful for proper valgrinding
172# the office.
173#
174.IF "$(OS)"=="LINUX"
175
176TARGET2 = salalloc_malloc
177SHL2TARGET= $(TARGET2)
178SHL2IMPLIB= i$(TARGET2)
179SHL2VERSIONMAP=	salalloc.map
180
181SHL2LIBS+=$(SLB)$/SYSALLOC_cpprtl.lib
182
183.ENDIF # .IF "$(OS)"=="LINUX"
184
185# --- Coverage -----------------------------------------------------
186# LLA: 20040304 The follows lines are an additional which is only need if we run
187#               coverage tests. For normal test runs this feature is not used.
188#               For more information about coverage tests see:
189#               http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html
190#
191#               Why this additional?
192#               Anybody has decide to link sal with g++ instead of gcc.
193#
194.IF "$(TESTCOVERAGE)"!=""
195.IF "$(GUI)"=="UNX"
196.IF "$(COM)"=="GCC"
197.IF "$(OS)"=="LINUX"
198SHL1STDLIBS+=-lgcc
199.ENDIF
200.ENDIF
201.ENDIF
202.ENDIF
203
204# --- Targets ------------------------------------------------------
205
206.ENDIF # $(header) != ""
207.ENDIF # $(depend) != ""
208
209.INCLUDE :  target.mk
210
211.IF "$(SHL1TARGETN)" != ""
212$(SHL1TARGETN) : $(OUT)$/inc$/udkversion.h
213.ENDIF # "$(SHL1TARGETN)" != ""
214
215$(OUT)$/inc$/udkversion.h:
216	echo '#ifndef _SAL_UDKVERSION_H_'           >  $@
217	echo '#define _SAL_UDKVERSION_H_'           >> $@
218	echo ''                                     >> $@
219	echo '#define SAL_UDK_MAJOR "$(UDK_MAJOR)"' >> $@
220	echo '#define SAL_UDK_MINOR "$(UDK_MINOR)"' >> $@
221	echo '#define SAL_UDK_MICRO "$(UDK_MICRO)"' >> $@
222	echo ''                                     >> $@
223	echo '#endif'                               >> $@
224