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
)
47 # virtual targets ("flavors")
49 ifeq ($(TARGET
),WIN64
)
54 ifeq ($(TARGET
),PPC2003X
)
57 override TARGET
= PPC2003
66 ifeq ($(TARGET
),ANDROID
)
71 # ARMv5 in the debug build, to allow installation on the emulator
76 ifeq ($(TARGET
),ANDROID7NEON
)
78 override TARGET
= ANDROID7
81 ifeq ($(TARGET
),ANDROID7
)
84 override TARGET
= ANDROID
87 ifeq ($(TARGET
),ANDROID86
)
89 override TARGET
= ANDROID
92 ifeq ($(TARGET
),ANDROIDMIPS
)
94 override TARGET
= ANDROID
97 ifeq ($(TARGET
),ANDROIDFAT
)
99 override TARGET
= ANDROID
104 ifeq ($(TARGET
),PPC2000
)
113 ifeq ($(TARGET
),PPC2003
)
124 TCPREFIX
:= x86_64-w64-mingw32-
127 TCPREFIX
:= i686-w64-mingw32-
128 TARGET_ARCH
+= -march
=i586
131 ifneq ($(MINGWPATH
),)
132 TCPREFIX
:= $(MINGWPATH
)
142 ifeq ($(TARGET
),CYGWIN
)
145 TARGET_ARCH
+= -march
=i586
156 ifeq ($(TARGET
),ALTAIR
)
174 ifeq ($(TARGET
),WINE
)
176 TARGET_ARCH
+= -march
=i586
184 override TARGET
= UNIX
188 ifeq ($(TARGET
),UNIX
)
189 # LOCAL_TCPREFIX is set in local-config.mk if configure was run.
190 TCPREFIX
:= $(LOCAL_TCPREFIX
)
191 TCSUFFIX
:= $(LOCAL_TCSUFFIX
)
192 TARGET_IS_ARM
= $(HOST_IS_ARM
)
193 TARGET_IS_PI
= $(HOST_IS_PI
)
194 ARMV6
= $(HOST_IS_ARMV6
)
195 ARMV7
= $(HOST_IS_ARMV7
)
196 NEON
= $(HOST_HAS_NEON
)
199 ifeq ($(TARGET
),UNIX32
)
200 override TARGET
= UNIX
204 ifeq ($(TARGET
),UNIX64
)
205 override TARGET
= UNIX
210 override TARGET
= UNIX
211 TCPREFIX
:= arm-linux-gnueabihf-
213 TARGET_ARCH
+= -march
=armv6j
-mfpu
=vfp
-mfloat-abi
=hard
219 ifeq ($(TARGET
),KOBO
)
220 # Experimental target for Kobo Mini
221 override TARGET
= UNIX
222 TCPREFIX
:= arm-linux-gnueabihf-
223 KOBO ?
= /opt
/kobo
/arm-unknown-linux-gnueabi
224 TARGET_ARCH
+= -march
=armv7-a
-mfloat-abi
=hard
230 ifeq ($(TARGET
),UNIX
)
237 TARGET_ARCH
+= -march
=armv6
241 TARGET_ARCH
+= -march
=armv7-a
245 TARGET_ARCH
+= -mfpu
=neon
-mfpu
=vfpv3-d16
249 ifeq ($(filter $(TARGET
),UNIX WINE
),$(TARGET
))
250 ifeq ($(HOST_IS_LINUX
),y
)
253 ifeq ($(HOST_IS_DARWIN
),y
)
254 TARGET_IS_DARWIN
:= y
258 ifeq ($(TARGET
),ANDROID
)
259 ANDROID_NDK ?
= $(HOME
)/opt
/android-ndk-r8e
261 ANDROID_PLATFORM
= android-16
262 ANDROID_SDK_PLATFORM
= $(ANDROID_PLATFORM
)
264 # NDK r8b has only android-14
265 ANDROID_NDK_PLATFORM
= android-14
268 ANDROID_ABI2
= arm-linux-androideabi
269 ANDROID_ABI3
= armeabi
270 ANDROID_ABI4
= $(ANDROID_ABI2
)
271 ANDROID_ABI_SUBDIR
= .
272 ANDROID_GCC_VERSION
= 4.7
273 ANDROID_GCC_VERSION2
= $(ANDROID_GCC_VERSION
)
276 ANDROID_ABI3
= armeabi-v7a
277 ANDROID_ABI_SUBDIR
= armv7-a
284 ANDROID_ABI4
= i686-linux-android
289 ANDROID_ABI2
= mipsel-linux-android
293 ANDROID_NDK_PLATFORM_DIR
= $(ANDROID_NDK
)/platforms
/$(ANDROID_NDK_PLATFORM
)
294 ANDROID_TARGET_ROOT
= $(ANDROID_NDK_PLATFORM_DIR
)/arch-
$(ANDROID_ARCH
)
296 ANDROID_GCC_TOOLCHAIN_NAME
= $(ANDROID_ABI2
)-$(ANDROID_GCC_VERSION
)
299 ANDROID_TOOLCHAIN_NAME
= llvm-3.2
301 # workaround: use libstdc++ 4.6, because 4.7 fails to link with
302 # clang due to missing __atomic_* symbols
303 ANDROID_GCC_VERSION
= 4.6
305 ANDROID_TOOLCHAIN_NAME
= $(ANDROID_GCC_TOOLCHAIN_NAME
)
308 ifeq ($(HOST_IS_DARWIN
),y
)
309 ANDROID_HOST_TAG
= darwin-x86
310 else ifeq ($(WINHOST
),y
)
311 ANDROID_HOST_TAG
= windows
312 else ifeq ($(UNAME_M
),x86_64
)
313 ANDROID_HOST_TAG
= linux-x86_64
315 ANDROID_HOST_TAG
= linux-x86
318 ANDROID_GCC_TOOLCHAIN
= $(ANDROID_NDK
)/toolchains
/$(ANDROID_GCC_TOOLCHAIN_NAME
)/prebuilt
/$(ANDROID_HOST_TAG
)
319 ANDROID_TOOLCHAIN
= $(ANDROID_NDK
)/toolchains
/$(ANDROID_TOOLCHAIN_NAME
)/prebuilt
/$(ANDROID_HOST_TAG
)
322 TCPREFIX
= $(ANDROID_TOOLCHAIN
)/bin
/
324 TCPREFIX
= $(ANDROID_TOOLCHAIN
)/bin
/$(ANDROID_ABI4
)-
336 LLVM_TRIPLE
= armv5te-none-linux-androideabi
337 TARGET_ARCH
+= -march
=armv5te
-mtune
=xscale
-msoft-float
-mthumb-interwork
342 LLVM_TRIPLE
= armv6-none-linux-androideabi
343 TARGET_ARCH
+= -march
=armv6
-mtune
=xscale
-msoft-float
-mthumb-interwork
348 LLVM_TRIPLE
= armv7-none-linux-androideabi
349 TARGET_ARCH
+= -march
=armv7-a
-mfloat-abi
=softfp
-mthumb-interwork
353 ifeq ($(ARMV7
)$(NEON
),yy
)
354 TARGET_ARCH
+= -mfpu
=neon
357 ifeq ($(ARMV7
)$(NEON
),yn
)
358 TARGET_ARCH
+= -mfpu
=vfpv3-d16
361 TARGET_ARCH
+= -fpic
-funwind-tables
371 TCPREFIX
:= arm-mingw32ce-
375 TARGET_ARCH
+= -mcpu
=xscale
377 TARGET_ARCH
+= -mcpu
=strongarm1110
381 ######## target definitions
384 TARGET_CPPFLAGS
= -I
$(TARGET_OUTPUT_DIR
)/include
387 TARGET_CPPFLAGS
+= -DTESTING
=y
391 TARGET_CPPFLAGS
+= -DWINVER
=$(WINVER
) -D_WIN32_WINDOWS
=$(WINVER
)
392 TARGET_CPPFLAGS
+= -D_WIN32_WINNT
=$(WINVER
) -D_WIN32_IE
=$(WINVER
)
396 TARGET_CPPFLAGS
+= -D_WIN32_WCE
=0x0$(CE_MAJOR
)$(CE_MINOR
)
397 TARGET_CPPFLAGS
+= -DWIN32_PLATFORM_PSPC
=$(CE_MAJOR
)$(CE_MINOR
)
400 ifeq ($(HAVE_WIN32
),y
)
401 TARGET_CPPFLAGS
+= -DWIN32_LEAN_AND_MEAN
402 TARGET_CPPFLAGS
+= -DNOMINMAX
403 ifeq ($(TARGET
),CYGWIN
)
404 TARGET_CPPFLAGS
+= -DWIN32
408 ifeq ($(TARGET
),PPC2000
)
409 TARGET_CPPFLAGS
+= -DNOLINETO
-DNOCLEARTYPE
412 ifeq ($(TARGET
),WINE
)
413 TARGET_CPPFLAGS
+= -D__WINE__
414 TARGET_CPPFLAGS
+= -DWINE_STRICT_PROTOTYPES
418 ifeq ($(TARGET
),ALTAIR
)
419 TARGET_CPPFLAGS
+= -DGNAV
422 ifeq ($(HAVE_POSIX
),y
)
423 TARGET_CPPFLAGS
+= -DHAVE_POSIX
424 TARGET_CPPFLAGS
+= -DHAVE_STDINT_H
425 TARGET_CPPFLAGS
+= -DHAVE_UNISTD_H
426 TARGET_CPPFLAGS
+= -DHAVE_VASPRINTF
429 ifeq ($(HAVE_MSVCRT
),y
)
430 TARGET_CPPFLAGS
+= -DHAVE_MSVCRT
431 TARGET_CPPFLAGS
+= -DUNICODE
-D_UNICODE
434 ifeq ($(HAVE_WIN32
),n
)
435 TARGET_INCLUDES
+= -I
$(SRC
)/unix
438 ifeq ($(TARGET
),WINE
)
439 TARGET_INCLUDES
+= -I
$(SRC
)/wine
442 ifeq ($(HOST_IS_PI
)$(TARGET_IS_PI
),ny
)
443 TARGET_CPPFLAGS
+= --sysroot
=$(PI
) -isystem
$(PI
)/usr
/include/arm-linux-gnueabihf
446 ifeq ($(TARGET_IS_KOBO
),y
)
447 TARGET_CPPFLAGS
+= -DKOBO
448 TARGET_CPPFLAGS
+= -isystem
$(KOBO
)/include
451 ifeq ($(TARGET
),ANDROID
)
452 TARGET_CPPFLAGS
+= --sysroot
=$(ANDROID_TARGET_ROOT
)
453 TARGET_CPPFLAGS
+= -DANDROID
454 CXXFLAGS
+= -D__STDC_VERSION__
=199901L
457 # On NDK r6, the macro _BYTE_ORDER never gets defined - workaround:
458 TARGET_CPPFLAGS
+= -D_BYTE_ORDER
=_LITTLE_ENDIAN
462 ####### compiler target
464 ifeq ($(HAVE_WIN32
),y
)
465 ifeq ($(TARGET
),WINE
)
468 TARGET_ARCH
+= -mwin32
471 WINDRESFLAGS
:= -I
$(SRC
) $(TARGET_CPPFLAGS
)
475 TARGET_ARCH
+= -mwindows
-mms-bitfields
478 ifeq ($(TARGET
),CYGWIN
)
479 WINDRESFLAGS
+= -I.
/Data
482 ####### linker configuration
489 TARGET_LDFLAGS
+= -Wl
,--major-subsystem-version
=5
490 TARGET_LDFLAGS
+= -Wl
,--minor-subsystem-version
=00
492 # default to "console"; see SCREEN_LDLIBS
493 TARGET_LDFLAGS
+= -Wl
,-subsystem
,console
496 ifeq ($(HAVE_WIN32
),y
)
498 TARGET_LDFLAGS
+= -Wl
,--major-subsystem-version
=$(CE_MAJOR
)
499 TARGET_LDFLAGS
+= -Wl
,--minor-subsystem-version
=$(CE_MINOR
)
502 ifeq ($(TARGET
),WINE
)
503 TARGET_LDLIBS
+= -lpthread
505 ifneq ($(TARGET
),CYGWIN
)
506 # link libstdc++-6.dll statically, so we don't have to distribute it
507 TARGET_LDFLAGS
+= -static
512 ifeq ($(HAVE_POSIX
),y
)
513 ifneq ($(TARGET
),ANDROID
)
514 TARGET_LDLIBS
+= -lpthread
515 ifeq ($(TARGET_IS_LINUX
),y
)
516 TARGET_LDLIBS
+= -lrt
# for clock_gettime()
521 ifeq ($(HOST_IS_PI
)$(TARGET_IS_PI
),ny
)
522 TARGET_LDFLAGS
+= --sysroot
=$(PI
) -L
$(PI
)/usr
/lib
/arm-linux-gnueabihf
525 ifeq ($(TARGET_IS_KOBO
),y
)
526 TARGET_LDFLAGS
+= -L
$(KOBO
)/lib
527 TARGET_LDFLAGS
+= -static
530 ifeq ($(TARGET
),ANDROID
)
531 TARGET_LDFLAGS
+= -Wl
,--no-undefined
532 TARGET_LDFLAGS
+= --sysroot
=$(ANDROID_TARGET_ROOT
)
533 TARGET_LDFLAGS
+= -L
$(ANDROID_TARGET_ROOT
)/usr
/lib
536 TARGET_LDFLAGS
+= -Wl
,--fix-cortex-a8
540 ifneq ($(filter PC WINE CYGWIN
,$(TARGET
)),)
541 TARGET_LDLIBS
+= -lwinmm
544 ifeq ($(TARGET
),CYGWIN
)
545 TARGET_LDLIBS
+= -lintl
549 ifneq ($(TARGET
),ALTAIR
)
550 TARGET_CPPFLAGS
+= -DHAVE_NOTE_PRJ_DLL
551 TARGET_CPPFLAGS
+= -DHAVE_AYGSHELL_DLL
552 TARGET_CPPFLAGS
+= -DHAVE_IMGDECMP_DLL
556 ifeq ($(TARGET
),UNIX
)
557 ifeq ($(TARGET_IS_DARWIN
),n
)
562 ifeq ($(TARGET
),ANDROID
)
563 TARGET_LDLIBS
+= -lc
-lm
564 TARGET_LDLIBS
+= -llog
565 TARGET_LDADD
+= $(ANDROID_GCC_TOOLCHAIN
)/lib
/gcc
/$(ANDROID_ABI4
)/$(ANDROID_GCC_VERSION2
)/$(ANDROID_ABI_SUBDIR
)/libgcc.a
568 ######## output files
572 ifeq ($(TARGET
),UNIX
)
576 ifeq ($(TARGET
),ANDROID
)