xref: /AOO41X/main/graphite/makefile.mk (revision de2c434cf06d3b138089e2a8fcdfa14ba1901f6e)
17871dc3eSAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
19cdf0e10cSrcweir#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir# TODO: enable warnings again when external module compiles without warnings on all platforms
25cdf0e10cSrcweirEXTERNAL_WARNINGS_NOT_ERRORS := TRUE
26cdf0e10cSrcweir
27cdf0e10cSrcweirPRJ=.
28cdf0e10cSrcweir
29cdf0e10cSrcweirPRJNAME=graphite
30cdf0e10cSrcweirTARGET=so_graphite
31cdf0e10cSrcweir
32cdf0e10cSrcweir# --- Settings -----------------------------------------------------
33cdf0e10cSrcweir
34cdf0e10cSrcweir.INCLUDE :	settings.mk
35cdf0e10cSrcweir
36cdf0e10cSrcweir.IF "$(SYSTEM_GRAPHITE)" == "YES"
379ef65f0eSAndre Fischer
38cdf0e10cSrcweirall:
39cdf0e10cSrcweir        @echo "An already available installation of silgraphite should exist on your system."
40cdf0e10cSrcweir        @echo "Therefore the version provided here does not need to be built in addition."
419ef65f0eSAndre Fischer
429ef65f0eSAndre Fischer.ELIF "$(ENABLE_GRAPHITE)" != "TRUE"
439ef65f0eSAndre Fischer
449ef65f0eSAndre Fischerall:
459ef65f0eSAndre Fischer        @echo "Support for silgraphite has been disabled.  Nothing to do."
469ef65f0eSAndre Fischer
479ef65f0eSAndre Fischer.ELSE
48cdf0e10cSrcweir
49cdf0e10cSrcweir# --- Files --------------------------------------------------------
509ef65f0eSAndre Fischer
51cdf0e10cSrcweirTARFILE_NAME=silgraphite-2.3.1
52cdf0e10cSrcweirTARFILE_MD5=d35724900f6a4105550293686688bbb3
5306494426SHerbert DürrPATCH_FILES=graphite-2.3.1.patch graphite-2.3.1_debug.patch graphite-2.3.1_stlportemu.patch
54cdf0e10cSrcweir
55cdf0e10cSrcweir# convert line-endings to avoid problems when patching
56cdf0e10cSrcweirCONVERTFILES=\
57cdf0e10cSrcweir	engine/makefile.vc8 \
58cdf0e10cSrcweir	engine/test/RegressionTest/RtTextSrc.h
59cdf0e10cSrcweir
60cdf0e10cSrcweir#.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
61cdf0e10cSrcweir#CONFIGURE_DIR=win32
62cdf0e10cSrcweir#.ELSE
63cdf0e10cSrcweir#CONFIGURE_DIR=engine
64cdf0e10cSrcweir#.ENDIF
65cdf0e10cSrcweir
66cdf0e10cSrcweirCONFIGURE_DIR=engine
67cdf0e10cSrcweir
68cdf0e10cSrcweir.IF "$(COM)"=="MSC"
69cdf0e10cSrcweir.IF "$(COMEX)"=="10"
70cdf0e10cSrcweirVCNUM=7
71cdf0e10cSrcweir.ELSE
72cdf0e10cSrcweirVCNUM=8
73cdf0e10cSrcweir.ENDIF
7406494426SHerbert Dürr.IF "$(USE_SYSTEM_STL)"!="YES"
75cdf0e10cSrcweir# make use of stlport headerfiles
76cdf0e10cSrcweirEXT_USE_STLPORT=TRUE
7706494426SHerbert Dürr.ENDIF
78cdf0e10cSrcweirBUILD_ACTION=nmake VERBOSE=1
79cdf0e10cSrcweir.IF "x$(debug)"!="x"
80cdf0e10cSrcweirBUILD_FLAGS= "CFG=DEBUG"
81cdf0e10cSrcweirCFLAGSWITHPATH= $(CFLAGS:s!-Fd.!-Fd../../../../../!)
82cdf0e10cSrcweir.ELSE
83cdf0e10cSrcweir# Speed Optimization is really needed for Graphite
84cdf0e10cSrcweirCFLAGSWITHPATH= $(CFLAGS) /O2
85cdf0e10cSrcweir.ENDIF
86cdf0e10cSrcweir### convert CFLAGS as cl.exe cannot handle OOO"s generic ones directly
87cdf0e10cSrcweir### TODO: use "guw.exe" instead?
88cdf0e10cSrcweirALLCFLAGS= $(CFLAGSWITHPATH) $(CFLAGSCXX) $(CFLAGSEXCEPTIONS) $(CDEFS)
89cdf0e10cSrcweirJUSTASLASH= /
90cdf0e10cSrcweirCFLAGS2MSC= $(ALLCFLAGS:s/-Z/$(JUSTASLASH)Z/)
91cdf0e10cSrcweirCFLAGS4MSC= $(CFLAGS2MSC:s/ -/ $(JUSTASLASH)/)
92cdf0e10cSrcweirBUILD_FLAGS+= "CFLAGS4MSC=$(CFLAGS4MSC)" /F makefile.vc$(VCNUM) lib_dll
93cdf0e10cSrcweir.ENDIF
94cdf0e10cSrcweir
95*de2c434cSPedro Giffuni.IF "$(COM)"=="GCC" || "$(OS)"=="FREEBSD"
96cdf0e10cSrcweir
97cdf0e10cSrcweir# Does linux want --disable-shared?
98cdf0e10cSrcweir.IF "x$(debug)"!="x"
99cdf0e10cSrcweirGR_CONFIGURE_FLAGS= --enable-debug=yes --disable-final --enable-static --disable-shared
100cdf0e10cSrcweir.ELSE
101cdf0e10cSrcweirGR_CONFIGURE_FLAGS= --enable-final=yes --enable-static --disable-shared
102cdf0e10cSrcweir.ENDIF
103cdf0e10cSrcweirEXTRA_GR_CXX_FLAGS=-fPIC
104cdf0e10cSrcweir
105cdf0e10cSrcweir.IF "$(USE_SYSTEM_STL)"!="YES"
106cdf0e10cSrcweir# #i112124# STLPort seems to require libstdc++
107cdf0e10cSrcweirEXTRA_GR_LD_FLAGS=$(LIBSTLPORT) -lm -lstdc++
108cdf0e10cSrcweirGR_LIB_PATH=LD_LIBRARY_PATH=$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)
109cdf0e10cSrcweir.ELSE
110cdf0e10cSrcweirGR_LIB_PATH=
111cdf0e10cSrcweir.ENDIF
112cdf0e10cSrcweir
113cdf0e10cSrcweir.IF "$(OS)"=="WNT"
114cdf0e10cSrcweirPATCH_FILES+=graphite-2.3.1.patch.mingw
115cdf0e10cSrcweirEXTRA_GR_CXX_FLAGS=-mthreads -nostdinc
116cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
117cdf0e10cSrcweirEXTRA_GR_CXX_FLAGS+=-shared-libgcc
118cdf0e10cSrcweir.ENDIF
119cdf0e10cSrcweirEXTRA_GR_LD_FLAGS+=-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2
120cdf0e10cSrcweir.ENDIF
121cdf0e10cSrcweir
122cdf0e10cSrcweir# don't use SOLARLIB for LDFLAGS because it pulls in system graphite so build will fail
123cdf0e10cSrcweir#
124cdf0e10cSrcweirCONFIGURE_ACTION=bash -c 'CXXFLAGS="$(INCLUDE) $(CFLAGSCXX) $(CFLAGSCOBJ) $(CDEFS) $(CDEFSOBJ) $(SOLARINC) $(LFS_CFLAGS) $(EXTRA_GR_CXX_FLAGS)" $(GR_LIB_PATH) LDFLAGS="-L$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT) $(EXTRA_GR_LD_FLAGS)" ./configure $(GR_CONFIGURE_FLAGS)'
125cdf0e10cSrcweir.ENDIF
126cdf0e10cSrcweir
127cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
128cdf0e10cSrcweir
129cdf0e10cSrcweir.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
130cdf0e10cSrcweir#OUT2LIB=win32$/bin.msvc$/*.lib
131cdf0e10cSrcweir.IF "x$(debug)"!="x"
132cdf0e10cSrcweirOUT2LIB=engine$/debug$/*.lib
133cdf0e10cSrcweir.ELSE
134cdf0e10cSrcweirOUT2LIB=engine$/release$/*.lib
135cdf0e10cSrcweir.ENDIF
136cdf0e10cSrcweir.ELSE
137cdf0e10cSrcweirOUT2LIB=engine$/src$/.libs$/libgraphite*.a
138cdf0e10cSrcweir.ENDIF
139cdf0e10cSrcweir
140*de2c434cSPedro Giffuni.IF "$(COM)"=="GCC" || "$(OS)"=="FREEBSD"
141cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
142cdf0e10cSrcweir.ENDIF
143cdf0e10cSrcweir
144cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
145cdf0e10cSrcweirOUT2LIB+=src$/.libs$/libgraphite.*.dylib
146cdf0e10cSrcweir.ELSE
147cdf0e10cSrcweir.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
148cdf0e10cSrcweir#OUT2LIB+=engine$/src$/.libs$/libgraphite*.dll
149cdf0e10cSrcweir.IF "x$(debug)"!="x"
150cdf0e10cSrcweirOUT2BIN= \
151cdf0e10cSrcweir#    engine$/debug$/*.dll \
152cdf0e10cSrcweir    engine$/debug$/*.pdb
153cdf0e10cSrcweir.ELSE
154cdf0e10cSrcweirOUT2BIN=
155cdf0e10cSrcweir#    engine$/release$/*.dll
156cdf0e10cSrcweir#    engine$/release$/*.pdb
157cdf0e10cSrcweir.ENDIF
158cdf0e10cSrcweir.ELSE
159cdf0e10cSrcweir#OUT2LIB+=engine$/src$/.libs$/libgraphite.so.*.*.*
160cdf0e10cSrcweir.ENDIF
161cdf0e10cSrcweir.ENDIF
162cdf0e10cSrcweir
163cdf0e10cSrcweir
164cdf0e10cSrcweirOUTDIR2INC= \
165cdf0e10cSrcweir	engine$/include$/graphite
166cdf0e10cSrcweir
167cdf0e10cSrcweir.IF "$(OS)"=="WNT"
168cdf0e10cSrcweirOUT2INC=wrappers$/win32$/WinFont.h
169cdf0e10cSrcweir.ENDIF
1709ef65f0eSAndre Fischer
171cdf0e10cSrcweir# --- Targets ------------------------------------------------------
172cdf0e10cSrcweir
173cdf0e10cSrcweir
174cdf0e10cSrcweir.INCLUDE :	set_ext.mk
175cdf0e10cSrcweir.INCLUDE :	target.mk
176cdf0e10cSrcweir.INCLUDE :	tg_ext.mk
177cdf0e10cSrcweir
1789ef65f0eSAndre Fischer.ENDIF
179