|
| 1 | + |
| 2 | +######################################################### |
| 3 | +# Common build definitions (CUSTOM) |
| 4 | +######################################################### |
| 5 | + |
| 6 | +RELEASE_BUILD = yes |
| 7 | +QUIET_BUILD = yes |
| 8 | + |
| 9 | +######################################################### |
| 10 | +# System utility definitions (STATIC) |
| 11 | +######################################################### |
| 12 | +define CHECK_UNDEFINITION |
| 13 | + ifdef $(1) |
| 14 | + $$(warning ERROR : $(1) defined $(2)) |
| 15 | + ERROR=1 |
| 16 | + endif |
| 17 | +endef |
| 18 | + |
| 19 | +define EXIT_IF_ERROR |
| 20 | + ifeq "$$(ERROR)" "1" |
| 21 | + $$(error There has been some errors) |
| 22 | + endif |
| 23 | +endef |
| 24 | + |
| 25 | + |
| 26 | +######################################################### |
| 27 | +# Validity control (STATIC) |
| 28 | +######################################################### |
| 29 | + |
| 30 | +ifdef PC_TARGET |
| 31 | + $(eval $(call CHECK_UNDEFINITION,CONSOLE_TARGET,(should not be defined when PC_TARGET is defined))) |
| 32 | +endif |
| 33 | + |
| 34 | +$(eval $(call EXIT_IF_ERROR)) |
| 35 | + |
| 36 | + |
| 37 | +######################################################### |
| 38 | +# Common definitions (STATIC) |
| 39 | +######################################################### |
| 40 | + |
| 41 | +ifeq "$(QUIET_BUILD)" "yes" |
| 42 | + MAKE=@make -s |
| 43 | +else |
| 44 | + MAKE=make |
| 45 | +endif |
| 46 | + |
| 47 | +COMMON_DIR:=../Common |
| 48 | + |
| 49 | +SDK_FLAGS:="NO_EXAMPLES=yes" |
| 50 | +SDK_FLAGS+="USE_SDK=yes" |
| 51 | +SDK_FLAGS+="QUIET_BUILD=$(QUIET_BUILD)" |
| 52 | +SDK_FLAGS+="RELEASE_BUILD=$(RELEASE_BUILD)" |
| 53 | +SDK_FLAGS+="SDK_VERSION=$(SDK_VERSION)" |
| 54 | + |
| 55 | +ifeq ($(filter NO_COM=%,$(TMP_SDK_FLAGS)),) |
| 56 | + SDK_FLAGS+="NO_COM=no" |
| 57 | +endif |
| 58 | + |
| 59 | +######################################################### |
| 60 | +# PC_TARGET specific definitions (STATIC) |
| 61 | +######################################################### |
| 62 | +ifdef PC_TARGET |
| 63 | + SDK_FLAGS+="NO_COM=no" |
| 64 | + |
| 65 | + ifeq ($(ARDRONE_TARGET_OS),Linux) |
| 66 | + OS_DEFINE=GNU_LINUX |
| 67 | + else |
| 68 | + ifeq ($(ARDRONE_TARGET_OS),iphoneos) |
| 69 | + OS_DEFINE=GNU_LINUX |
| 70 | + else |
| 71 | + ifeq ($(ARDRONE_TARGET_OS),iphonesimulator) |
| 72 | + OS_DEFINE=GNU_LINUX |
| 73 | + else |
| 74 | + TARGET:=$(TARGET).exe |
| 75 | + OS_DEFINE=WINDOW |
| 76 | + endif |
| 77 | + endif |
| 78 | + endif |
| 79 | + |
| 80 | + GENERIC_CFLAGS+=-D_MOBILE |
| 81 | + |
| 82 | + ifeq ("$(PC_USE_TABLE_PILOTAGE)","yes") |
| 83 | + GENERIC_CFLAGS+=-DUSE_TABLE_PILOTAGE |
| 84 | + endif |
| 85 | + |
| 86 | + ifeq ("$(RECORD_VIDEO)","yes") |
| 87 | + GENERIC_CFLAGS+=-DRECORD_VIDEO |
| 88 | + endif |
| 89 | + |
| 90 | + GENERIC_CFLAGS+=-D$(OS_DEFINE) |
| 91 | + ifeq ($(IPHONE_MODE),yes) |
| 92 | + ifeq ($(ARDRONE_TARGET_OS),iphoneos) |
| 93 | + GENERIC_CFLAGS+=-DTARGET_OS_IPHONE |
| 94 | + else |
| 95 | + GENERIC_CFLAGS+=-DTARGET_IPHONE_SIMULATOR |
| 96 | + endif |
| 97 | + endif |
| 98 | + |
| 99 | + ifneq ("$(USE_MINGW32)","yes") |
| 100 | + GENERIC_CFLAGS+=$(shell pkg-config --cflags gtk+-2.0) |
| 101 | + GENERIC_LIBS+=$(shell pkg-config --libs gtk+-2.0) |
| 102 | + endif |
| 103 | + |
| 104 | + ifeq ("$(USE_LINUX)","yes") |
| 105 | + SDK_FLAGS+="USE_LINUX=yes" |
| 106 | + else |
| 107 | + SDK_FLAGS+="USE_LINUX=no" |
| 108 | + endif |
| 109 | + |
| 110 | + SDK_FLAGS+="USE_ELINUX=no" |
| 111 | + |
| 112 | + ifneq ($(findstring iphone,$(ARDRONE_TARGET_OS)),) |
| 113 | + SDK_FLAGS+="USE_IPHONE=yes" |
| 114 | + SDK_FLAGS+="IPHONE_PLATFORM=$(ARDRONE_TARGET_OS)" |
| 115 | + else |
| 116 | + SDK_FLAGS+="USE_IPHONE=no" |
| 117 | + endif |
| 118 | + SDK_FLAGS+="IPHONE_SDK_PATH=$(IPHONE_SDK_PATH)" |
| 119 | + |
| 120 | + ifeq ("$(USE_NDS)","yes") |
| 121 | + SDK_FLAGS+="USE_NDS=yes" |
| 122 | + SDK_FLAGS+="NDS_CPU=ARM7" |
| 123 | + else |
| 124 | + SDK_FLAGS+="USE_NDS=no" |
| 125 | + endif |
| 126 | + |
| 127 | + ifeq ("$(USE_ANDROID)","yes") |
| 128 | + SDK_FLAGS+="USE_ANDROID=yes" |
| 129 | + SDK_FLAGS+="TOOLCHAIN_VERSION=arm-eabi-4.4.0" |
| 130 | + SDK_FLAGS+="NDK_PLATFORM_VERSION=android-5" |
| 131 | + else |
| 132 | + SDK_FLAGS+="USE_ANDROID=no" |
| 133 | + endif |
| 134 | + |
| 135 | + ifeq ($(filter USE_BLUEZ=%,$(TMP_SDK_FLAGS)),) |
| 136 | + SDK_FLAGS+="USE_BLUEZ=no" |
| 137 | + endif |
| 138 | + |
| 139 | + SDK_FLAGS+="USE_VLIB=yes" |
| 140 | + SDK_FLAGS+="USE_BONJOUR=no" |
| 141 | + SDK_FLAGS+="USE_WIFI=yes" |
| 142 | + |
| 143 | + SDK_FLAGS+="USE_BROADCOM=no" |
| 144 | + SDK_FLAGS+="USE_IWLIB=no" |
| 145 | + |
| 146 | + SDK_FLAGS+="FF_ARCH=Intel" |
| 147 | + |
| 148 | + SDK_FLAGS+="USE_PARROTOS_CORE=no" |
| 149 | + SDK_FLAGS+="USE_PARROTOS_DRIVERS=no" |
| 150 | + SDK_FLAGS+="USE_PARROTOS_DEVS=no" |
| 151 | + SDK_FLAGS+="USE_PARROTOS_CODEC=no" |
| 152 | + |
| 153 | + |
| 154 | + SDK_FLAGS+="USE_ARDRONELIB=yes" |
| 155 | + SDK_FLAGS+="USE_ARDRONE_VISION=yes" |
| 156 | + SDK_FLAGS+="USE_ARDRONE_POLARIS=no" |
| 157 | + SDK_FLAGS+="USE_ARDRONE_TEST_BENCHS=no" |
| 158 | + SDK_FLAGS+="USE_ARDRONE_CALIBRATION=no" |
| 159 | + |
| 160 | +endif |
| 161 | + |
0 commit comments