2 PPC2000 PPC2003 PPC2003X WM5 WM5X \
4 UNIX UNIX32 UNIX64 OPT \
6 ANDROID ANDROID7 ANDROID7NEON ANDROID86 ANDROIDMIPS \
11 ifeq ($(HOST_IS_UNIX
),y
)
17 ifeq ($(filter $(TARGET
),$(TARGETS
)),)
18 $(error Unknown target
: $(TARGET
))
22 TARGET_FLAVOR
:= $(TARGET
)
46 # virtual targets ("flavors")
48 ifeq ($(TARGET
),WIN64
)
53 ifeq ($(TARGET
),PPC2003X
)
55 override TARGET
= PPC2003
63 ifeq ($(TARGET
),ANDROID
)
67 # ARMv5 in the debug build, to allow installation on the emulator
72 ifeq ($(TARGET
),ANDROID7NEON
)
74 override TARGET
= ANDROID7
77 ifeq ($(TARGET
),ANDROID7
)
79 override TARGET
= ANDROID
82 ifeq ($(TARGET
),ANDROID86
)
84 override TARGET
= ANDROID
87 ifeq ($(TARGET
),ANDROIDMIPS
)
89 override TARGET
= ANDROID
92 ifeq ($(TARGET
),ANDROIDFAT
)
94 override TARGET
= ANDROID
99 ifeq ($(TARGET
),PPC2000
)
107 ifeq ($(TARGET
),PPC2003
)
117 TCPREFIX
:= x86_64-w64-mingw32-
120 TCPREFIX
:= i686-w64-mingw32-
121 TARGET_ARCH
+= -march
=i586
124 ifneq ($(MINGWPATH
),)
125 TCPREFIX
:= $(MINGWPATH
)
135 ifeq ($(TARGET
),CYGWIN
)
138 TARGET_ARCH
+= -march
=i586
149 ifeq ($(TARGET
),ALTAIR
)
165 ifeq ($(TARGET
),WINE
)
167 TARGET_ARCH
+= -march
=i586
175 override TARGET
= UNIX
179 ifeq ($(TARGET
),UNIX
)
180 # LOCAL_TCPREFIX is set in local-config.mk if configure was run.
181 TCPREFIX
:= $(LOCAL_TCPREFIX
)
182 TCSUFFIX
:= $(LOCAL_TCSUFFIX
)
183 TARGET_IS_PI
= $(HOST_IS_PI
)
184 ARMV6
= $(HOST_IS_ARMV6
)
185 ARMV7
= $(HOST_IS_ARMV7
)
186 NEON
= $(HOST_HAS_NEON
)
189 ifeq ($(TARGET
),UNIX32
)
190 override TARGET
= UNIX
194 ifeq ($(TARGET
),UNIX64
)
195 override TARGET
= UNIX
200 override TARGET
= UNIX
201 TCPREFIX
:= arm-linux-gnueabihf-
203 TARGET_ARCH
+= -march
=armv6j
-mfpu
=vfp
-mfloat-abi
=hard
208 ifeq ($(TARGET
),KOBO
)
209 # Experimental target for Kobo Mini
210 override TARGET
= UNIX
211 TCPREFIX
:= arm-linux-gnueabihf-
212 KOBO ?
= /opt
/kobo
/arm-unknown-linux-gnueabi
213 TARGET_ARCH
+= -march
=armv7-a
-mfloat-abi
=hard
218 ifeq ($(TARGET
),UNIX
)
225 TARGET_ARCH
+= -march
=armv6
229 TARGET_ARCH
+= -march
=armv7-a
233 TARGET_ARCH
+= -mfpu
=neon
-mfpu
=vfpv3-d16
237 ifeq ($(filter $(TARGET
),UNIX WINE
),$(TARGET
))
238 ifeq ($(HOST_IS_LINUX
),y
)
241 ifeq ($(HOST_IS_DARWIN
),y
)
242 TARGET_IS_DARWIN
:= y
246 ifeq ($(TARGET
),ANDROID
)
247 ANDROID_NDK ?
= $(HOME
)/opt
/android-ndk-r8e
249 ANDROID_PLATFORM
= android-16
250 ANDROID_SDK_PLATFORM
= $(ANDROID_PLATFORM
)
252 # NDK r8b has only android-14
253 ANDROID_NDK_PLATFORM
= android-14
256 ANDROID_ABI2
= arm-linux-androideabi
257 ANDROID_ABI3
= armeabi
258 ANDROID_ABI4
= $(ANDROID_ABI2
)
259 ANDROID_ABI_SUBDIR
= .
260 ANDROID_GCC_VERSION
= 4.7
261 ANDROID_GCC_VERSION2
= $(ANDROID_GCC_VERSION
)
264 ANDROID_ABI3
= armeabi-v7a
265 ANDROID_ABI_SUBDIR
= armv7-a
272 ANDROID_ABI4
= i686-linux-android
277 ANDROID_ABI2
= mipsel-linux-android
281 ANDROID_NDK_PLATFORM_DIR
= $(ANDROID_NDK
)/platforms
/$(ANDROID_NDK_PLATFORM
)
282 ANDROID_TARGET_ROOT
= $(ANDROID_NDK_PLATFORM_DIR
)/arch-
$(ANDROID_ARCH
)
284 ANDROID_GCC_TOOLCHAIN_NAME
= $(ANDROID_ABI2
)-$(ANDROID_GCC_VERSION
)
287 ANDROID_TOOLCHAIN_NAME
= llvm-3.2
289 ANDROID_TOOLCHAIN_NAME
= $(ANDROID_GCC_TOOLCHAIN_NAME
)
292 ifeq ($(HOST_IS_DARWIN
),y
)
293 ANDROID_HOST_TAG
= darwin-x86
294 else ifeq ($(WINHOST
),y
)
295 ANDROID_HOST_TAG
= windows
296 else ifeq ($(UNAME_M
),x86_64
)
297 ANDROID_HOST_TAG
= linux-x86_64
299 ANDROID_HOST_TAG
= linux-x86
302 ANDROID_GCC_TOOLCHAIN
= $(ANDROID_NDK
)/toolchains
/$(ANDROID_GCC_TOOLCHAIN_NAME
)/prebuilt
/$(ANDROID_HOST_TAG
)
303 ANDROID_TOOLCHAIN
= $(ANDROID_NDK
)/toolchains
/$(ANDROID_TOOLCHAIN_NAME
)/prebuilt
/$(ANDROID_HOST_TAG
)
306 TCPREFIX
= $(ANDROID_TOOLCHAIN
)/bin
/
308 TCPREFIX
= $(ANDROID_TOOLCHAIN
)/bin
/$(ANDROID_ABI4
)-
320 LLVM_TRIPLE
= armv5te-none-linux-androideabi
321 TARGET_ARCH
+= -march
=armv5te
-mtune
=xscale
-msoft-float
-mthumb-interwork
326 LLVM_TRIPLE
= armv6-none-linux-androideabi
327 TARGET_ARCH
+= -march
=armv6
-mtune
=xscale
-msoft-float
-mthumb-interwork
332 LLVM_TRIPLE
= armv7-none-linux-androideabi
333 TARGET_ARCH
+= -march
=armv7-a
-mfloat-abi
=softfp
-mthumb-interwork
337 ifeq ($(ARMV7
)$(NEON
),yy
)
338 TARGET_ARCH
+= -mfpu
=neon
341 ifeq ($(ARMV7
)$(NEON
),yn
)
342 TARGET_ARCH
+= -mfpu
=vfpv3-d16
345 TARGET_ARCH
+= -fpic
-funwind-tables
355 TCPREFIX
:= arm-mingw32ce-
359 TARGET_ARCH
+= -mcpu
=xscale
361 TARGET_ARCH
+= -mcpu
=strongarm1110
365 ######## target definitions
368 TARGET_CPPFLAGS
= -I
$(TARGET_OUTPUT_DIR
)/include
371 TARGET_CPPFLAGS
+= -DTESTING
=y
375 TARGET_CPPFLAGS
+= -DWINVER
=$(WINVER
) -D_WIN32_WINDOWS
=$(WINVER
)
376 TARGET_CPPFLAGS
+= -D_WIN32_WINNT
=$(WINVER
) -D_WIN32_IE
=$(WINVER
)
380 TARGET_CPPFLAGS
+= -D_WIN32_WCE
=0x0$(CE_MAJOR
)$(CE_MINOR
)
381 TARGET_CPPFLAGS
+= -DWIN32_PLATFORM_PSPC
=$(CE_MAJOR
)$(CE_MINOR
)
384 ifeq ($(HAVE_WIN32
),y
)
385 TARGET_CPPFLAGS
+= -DWIN32_LEAN_AND_MEAN
386 TARGET_CPPFLAGS
+= -DNOMINMAX
387 ifeq ($(TARGET
),CYGWIN
)
388 TARGET_CPPFLAGS
+= -DWIN32
392 ifeq ($(TARGET
),PPC2000
)
393 TARGET_CPPFLAGS
+= -DNOLINETO
-DNOCLEARTYPE
396 ifeq ($(TARGET
),WINE
)
397 TARGET_CPPFLAGS
+= -D__WINE__
398 TARGET_CPPFLAGS
+= -DWINE_STRICT_PROTOTYPES
402 ifeq ($(TARGET
),ALTAIR
)
403 TARGET_CPPFLAGS
+= -DGNAV
406 ifeq ($(HAVE_POSIX
),y
)
407 TARGET_CPPFLAGS
+= -DHAVE_POSIX
408 TARGET_CPPFLAGS
+= -DHAVE_STDINT_H
409 TARGET_CPPFLAGS
+= -DHAVE_UNISTD_H
410 TARGET_CPPFLAGS
+= -DHAVE_VASPRINTF
413 ifeq ($(HAVE_MSVCRT
),y
)
414 TARGET_CPPFLAGS
+= -DHAVE_MSVCRT
415 TARGET_CPPFLAGS
+= -DUNICODE
-D_UNICODE
418 ifeq ($(HAVE_WIN32
),n
)
419 TARGET_INCLUDES
+= -I
$(SRC
)/unix
422 ifeq ($(TARGET
),WINE
)
423 TARGET_INCLUDES
+= -I
$(SRC
)/wine
426 ifeq ($(HOST_IS_PI
)$(TARGET_IS_PI
),ny
)
427 TARGET_CPPFLAGS
+= --sysroot
=$(PI
) -isystem
$(PI
)/usr
/include/arm-linux-gnueabihf
430 ifeq ($(TARGET_IS_KOBO
),y
)
431 TARGET_CPPFLAGS
+= -DKOBO
432 TARGET_CPPFLAGS
+= -isystem
$(KOBO
)/include
435 ifeq ($(TARGET
),ANDROID
)
436 TARGET_CPPFLAGS
+= --sysroot
=$(ANDROID_TARGET_ROOT
)
437 TARGET_CPPFLAGS
+= -DANDROID
438 CXXFLAGS
+= -D__STDC_VERSION__
=199901L
441 # On NDK r6, the macro _BYTE_ORDER never gets defined - workaround:
442 TARGET_CPPFLAGS
+= -D_BYTE_ORDER
=_LITTLE_ENDIAN
446 ####### compiler target
448 ifeq ($(HAVE_WIN32
),y
)
449 ifeq ($(TARGET
),WINE
)
452 TARGET_ARCH
+= -mwin32
455 WINDRESFLAGS
:= -I
$(SRC
) $(TARGET_CPPFLAGS
)
459 TARGET_ARCH
+= -mwindows
-mms-bitfields
462 ifeq ($(TARGET
),CYGWIN
)
463 WINDRESFLAGS
+= -I.
/Data
466 ####### linker configuration
473 TARGET_LDFLAGS
+= -Wl
,--major-subsystem-version
=5
474 TARGET_LDFLAGS
+= -Wl
,--minor-subsystem-version
=00
476 # default to "console"; see SCREEN_LDLIBS
477 TARGET_LDFLAGS
+= -Wl
,-subsystem
,console
480 ifeq ($(HAVE_WIN32
),y
)
482 TARGET_LDFLAGS
+= -Wl
,--major-subsystem-version
=$(CE_MAJOR
)
483 TARGET_LDFLAGS
+= -Wl
,--minor-subsystem-version
=$(CE_MINOR
)
486 ifeq ($(TARGET
),WINE
)
487 TARGET_LDLIBS
+= -lpthread
489 ifneq ($(TARGET
),CYGWIN
)
490 # link libstdc++-6.dll statically, so we don't have to distribute it
491 TARGET_LDFLAGS
+= -static
496 ifeq ($(HAVE_POSIX
),y
)
497 ifneq ($(TARGET
),ANDROID
)
498 TARGET_LDLIBS
+= -lpthread
499 ifeq ($(TARGET_IS_LINUX
),y
)
500 TARGET_LDLIBS
+= -lrt
# for clock_gettime()
505 ifeq ($(HOST_IS_PI
)$(TARGET_IS_PI
),ny
)
506 TARGET_LDFLAGS
+= --sysroot
=$(PI
) -L
$(PI
)/usr
/lib
/arm-linux-gnueabihf
509 ifeq ($(TARGET_IS_KOBO
),y
)
510 TARGET_LDFLAGS
+= -L
$(KOBO
)/lib
511 TARGET_LDFLAGS
+= -static
514 ifeq ($(TARGET
),ANDROID
)
515 TARGET_LDFLAGS
+= -Wl
,--no-undefined
516 TARGET_LDFLAGS
+= --sysroot
=$(ANDROID_TARGET_ROOT
)
517 TARGET_LDFLAGS
+= -L
$(ANDROID_TARGET_ROOT
)/usr
/lib
520 TARGET_LDFLAGS
+= -Wl
,--fix-cortex-a8
524 ifneq ($(filter PC WINE CYGWIN
,$(TARGET
)),)
525 TARGET_LDLIBS
+= -lwinmm
528 ifeq ($(TARGET
),CYGWIN
)
529 TARGET_LDLIBS
+= -lintl
533 ifneq ($(TARGET
),ALTAIR
)
534 TARGET_CPPFLAGS
+= -DHAVE_NOTE_PRJ_DLL
535 TARGET_CPPFLAGS
+= -DHAVE_AYGSHELL_DLL
536 TARGET_CPPFLAGS
+= -DHAVE_IMGDECMP_DLL
540 ifeq ($(TARGET
),UNIX
)
541 ifeq ($(TARGET_IS_DARWIN
),n
)
546 ifeq ($(TARGET
),ANDROID
)
547 TARGET_LDLIBS
+= -lc
-lm
548 TARGET_LDLIBS
+= -llog
549 TARGET_LDADD
+= $(ANDROID_GCC_TOOLCHAIN
)/lib
/gcc
/$(ANDROID_ABI4
)/$(ANDROID_GCC_VERSION2
)/$(ANDROID_ABI_SUBDIR
)/libgcc.a
552 ######## output files
556 ifeq ($(TARGET
),UNIX
)
560 ifeq ($(TARGET
),ANDROID
)