Travis Geiselbrecht | 78d0e6c | 2009-11-27 13:37:03 -0800 | [diff] [blame] | 1 | ifeq ($(MAKECMDGOALS),spotless) |
| 2 | spotless: |
| 3 | rm -rf build-* |
| 4 | else |
| 5 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 6 | -include local.mk |
Travis Geiselbrecht | 5bcbd9d | 2009-01-24 20:15:32 -0800 | [diff] [blame] | 7 | include make/macros.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 8 | |
Brian Swetland | f1e5afd | 2009-01-24 22:09:30 -0800 | [diff] [blame] | 9 | # If one of our goals (from the commandline) happens to have a |
| 10 | # matching project/goal.mk, then we should re-invoke make with |
| 11 | # that project name specified... |
| 12 | |
| 13 | project-name := $(firstword $(MAKECMDGOALS)) |
| 14 | |
| 15 | ifneq ($(project-name),) |
| 16 | ifneq ($(wildcard project/$(project-name).mk),) |
| 17 | do-nothing := 1 |
| 18 | $(MAKECMDGOALS) _all: make-make |
| 19 | make-make: |
| 20 | @PROJECT=$(project-name) $(MAKE) $(filter-out $(project-name), $(MAKECMDGOALS)) |
| 21 | endif |
| 22 | endif |
| 23 | |
| 24 | ifeq ($(do-nothing),) |
| 25 | |
| 26 | ifeq ($(PROJECT),) |
| 27 | $(error No project specified. Use "make projectname" or put "PROJECT := projectname" in local.mk) |
| 28 | endif |
| 29 | |
Chandan Uddaraju | 40b227d | 2010-08-03 19:25:41 -0700 | [diff] [blame] | 30 | DEBUG ?= 0 |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 31 | |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 32 | ifndef $(BOOTLOADER_OUT) |
| 33 | BOOTLOADER_OUT := . |
| 34 | endif |
| 35 | |
Chandan Uddaraju | 885e4db | 2009-12-03 22:45:26 -0800 | [diff] [blame] | 36 | LK_TOP_DIR:= . |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 37 | BUILDDIR := $(BOOTLOADER_OUT)/build-$(PROJECT) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 38 | OUTBIN := $(BUILDDIR)/lk.bin |
| 39 | OUTELF := $(BUILDDIR)/lk |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 40 | OUTELF_STRIP := $(BUILDDIR)/lk_s.elf |
| 41 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 42 | CONFIGHEADER := $(BUILDDIR)/config.h |
| 43 | |
Subbaraman Narayanamurthy | 8bcd5fd | 2011-01-17 17:18:44 -0800 | [diff] [blame] | 44 | #Initialize the command-line flag ENABLE_TRUSTZONE. Value for flag passed in at command-line will take precedence |
| 45 | ENABLE_TRUSTZONE := 0 |
| 46 | |
| 47 | ifeq ($(ENABLE_TRUSTZONE),1) |
| 48 | INPUT_TZ_BIN := tzbsp/tzbsp.bin |
| 49 | OUTPUT_TZ_BIN := $(BUILDDIR)/tzbsp_bin.o |
| 50 | endif |
| 51 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 52 | INCLUDES := -I$(BUILDDIR) -Iinclude |
S A Muqthyar | d8d0ed0 | 2018-03-14 13:13:59 +0530 | [diff] [blame] | 53 | CFLAGS := -O2 -g -fno-builtin -finline -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function $(LKLE_CFLAGS) -include $(CONFIGHEADER) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 54 | #CFLAGS += -Werror |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 55 | ifeq ($(EMMC_BOOT),1) |
| 56 | CFLAGS += -D_EMMC_BOOT=1 |
| 57 | endif |
Shashank Mittal | cd98d47 | 2011-08-02 14:29:24 -0700 | [diff] [blame] | 58 | |
| 59 | ifeq ($(SIGNED_KERNEL),1) |
| 60 | CFLAGS += -D_SIGNED_KERNEL=1 |
| 61 | endif |
| 62 | |
jessicatseng | 8db2f60 | 2020-05-06 19:02:18 +0800 | [diff] [blame] | 63 | #//<2020/05/06-JessicaTseng, Enable fastboot command in user build |
| 64 | #ifeq ($(TARGET_BUILD_VARIANT),user) |
| 65 | # CFLAGS += -DDISABLE_FASTBOOT_CMDS=1 |
| 66 | #endif |
| 67 | #//>2020/05/06-JessicaTseng |
Sridhar Parasuram | e94e815 | 2014-10-24 14:06:03 -0700 | [diff] [blame] | 68 | |
anisha agarwal | ebc52bc | 2016-07-08 15:50:00 -0700 | [diff] [blame] | 69 | ifeq ($(APPEND_CMDLINE),1) |
| 70 | CFLAGS += -D_APPEND_CMDLINE=1 |
| 71 | endif |
Himal Ghimiray | c5d8121 | 2017-04-28 14:06:04 +0530 | [diff] [blame] | 72 | ifeq ($(ENABLE_HARD_FPU),1) |
| 73 | CFLAGS += -mfloat-abi=hard -mfpu=neon |
| 74 | endif |
Sachin Prakash Gejji | f557d22 | 2017-08-04 17:18:45 +0530 | [diff] [blame] | 75 | |
| 76 | ifeq ($(ENABLE_EARLY_ETHERNET),1) |
| 77 | CFLAGS += -DENABLE_EARLY_ETHERNET=1 |
| 78 | endif |
| 79 | |
jhchen | 7a504d1 | 2020-04-24 15:45:57 +0800 | [diff] [blame] | 80 | # [Arima_8910][jhchen] add fuse check property 20181031 begin |
| 81 | CFLAGS += -DENABLE_FUSE_CHECK=1 |
| 82 | # [Arima_8910][jhchen] 20181031 end |
| 83 | |
tracychui | d184b91 | 2020-06-05 17:31:38 +0800 | [diff] [blame] | 84 | #[20200605][TracyChui] Implement get Serial Number start |
| 85 | CFLAGS += -DENABLE_PRODINFO_ACCESS=1 |
| 86 | #[20200605][TracyChui] Implement get Serial Number end |
| 87 | |
tracychui | 5cfe443 | 2020-09-21 16:15:16 +0800 | [diff] [blame] | 88 | #[TracyChui] Disable lock/unlock commend on user mode 20200921 start |
tracychui | 8fd71dc | 2020-06-11 10:17:13 +0800 | [diff] [blame] | 89 | #[TracyChui] Add lock unlock fastboot commnad to skip ui check 20200611 start |
tracychui | 5cfe443 | 2020-09-21 16:15:16 +0800 | [diff] [blame] | 90 | ifneq ($(TARGET_BUILD_VARIANT),user) |
tracychui | 8fd71dc | 2020-06-11 10:17:13 +0800 | [diff] [blame] | 91 | CFLAGS += -DENABLE_LOCK_UNLOCK_SKIP_UI_CHECK=1 |
tracychui | 5cfe443 | 2020-09-21 16:15:16 +0800 | [diff] [blame] | 92 | endif |
tracychui | 8fd71dc | 2020-06-11 10:17:13 +0800 | [diff] [blame] | 93 | #[TracyChui] Add lock unlock fastboot commnad to skip ui check 20200611 end |
tracychui | 5cfe443 | 2020-09-21 16:15:16 +0800 | [diff] [blame] | 94 | #[TracyChui] Disable lock/unlock commend on user mode 20200921 end |
tracychui | 8fd71dc | 2020-06-11 10:17:13 +0800 | [diff] [blame] | 95 | |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 96 | # setup toolchain prefix |
| 97 | TOOLCHAIN_PREFIX ?= arm-eabi- |
Maria Yu | d320051 | 2014-05-28 15:57:51 +0800 | [diff] [blame] | 98 | CFLAGS += -fstack-protector-all |
vijay kumar | c2119f1 | 2014-07-22 18:30:11 +0530 | [diff] [blame] | 99 | CFLAGS += -fno-strict-overflow |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 100 | CPPFLAGS := -fno-exceptions -fno-rtti -fno-threadsafe-statics |
| 101 | #CPPFLAGS += -Weffc++ |
| 102 | ASMFLAGS := -DASSEMBLY |
| 103 | LDFLAGS := |
| 104 | |
| 105 | CFLAGS += -ffunction-sections -fdata-sections |
| 106 | LDFLAGS += -gc-sections |
| 107 | |
| 108 | # top level rule |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 109 | all:: $(OUTBIN) $(OUTELF).lst $(OUTELF).debug.lst $(OUTELF).sym $(OUTELF).size $(OUTELF_STRIP) APPSBOOTHEADER |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 110 | |
| 111 | # the following three object lists are identical except for the ordering |
| 112 | # which is bootobjs, kobjs, objs |
| 113 | BOOTOBJS := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 114 | OBJS := |
| 115 | |
| 116 | # a linker script needs to be declared in one of the project/target/platform files |
| 117 | LINKER_SCRIPT := |
| 118 | |
| 119 | # anything you add here will be deleted in make clean |
| 120 | GENERATED := $(CONFIGHEADER) |
| 121 | |
| 122 | # anything added to DEFINES will be put into $(BUILDDIR)/config.h |
| 123 | DEFINES := LK=1 |
| 124 | |
| 125 | # Anything added to SRCDEPS will become a dependency of every source file in the system. |
| 126 | # Useful for header files that may be included by one or more source files. |
| 127 | SRCDEPS := $(CONFIGHEADER) |
| 128 | |
Shashank Mittal | e99a8d3 | 2014-09-11 19:51:06 -0700 | [diff] [blame] | 129 | ifeq ($(VERIFIED_BOOT),1) |
| 130 | DEFINES += VERIFIED_BOOT=1 |
| 131 | DEFINES += _SIGNED_KERNEL=1 |
| 132 | ifeq ($(DEFAULT_UNLOCK),true) |
| 133 | DEFINES += DEFAULT_UNLOCK=1 |
| 134 | endif |
| 135 | endif |
| 136 | |
AnilKumar Chimata | 4686432 | 2017-08-10 14:51:25 +0530 | [diff] [blame] | 137 | ifeq ($(VERIFIED_BOOT_LE),1) |
| 138 | DEFINES += VERIFIED_BOOT_LE=1 |
| 139 | ifeq ($(DEFAULT_UNLOCK),true) |
| 140 | DEFINES += DEFAULT_UNLOCK=1 |
| 141 | endif |
| 142 | endif |
Monika Singh | ae7e964 | 2018-03-08 17:44:30 +0530 | [diff] [blame] | 143 | ifeq ($(VERIFIED_BOOT_2),1) |
| 144 | DEFINES += VERIFIED_BOOT_2=1 |
| 145 | DEFINES += _SIGNED_KERNEL=1 |
| 146 | endif |
AnilKumar Chimata | 4686432 | 2017-08-10 14:51:25 +0530 | [diff] [blame] | 147 | |
Monika Singh | 4d659d2 | 2019-12-05 16:38:04 +0530 | [diff] [blame] | 148 | ifeq ($(VB1_KEY_USED),1) |
| 149 | DEFINES += VB1_KEY_USED=1 |
| 150 | endif |
| 151 | |
Mayank Grover | c8a46c4 | 2019-04-25 11:46:00 +0530 | [diff] [blame] | 152 | ifeq ($(DYNAMIC_PARTITION_SUPPORT),1) |
| 153 | DEFINES += DYNAMIC_PARTITION_SUPPORT=1 |
| 154 | endif |
| 155 | |
Jiten Patel | 3f6e701 | 2018-08-22 12:46:20 +0530 | [diff] [blame] | 156 | ifeq ($(TARGET_DTBO_NOT_SUPPORTED),1) |
| 157 | DEFINES += TARGET_DTBO_NOT_SUPPORTED=1 |
| 158 | endif |
| 159 | |
Vijay Kumar Pendoti | 2f86905 | 2016-07-15 12:04:19 +0530 | [diff] [blame] | 160 | ifeq ($(OSVERSION_IN_BOOTIMAGE),1) |
| 161 | DEFINES += OSVERSION_IN_BOOTIMAGE=1 |
| 162 | endif |
| 163 | |
Mayank Grover | 02b160c | 2018-05-15 14:52:18 +0530 | [diff] [blame] | 164 | ifeq ($(HIBERNATION_SUPPORT),1) |
| 165 | DEFINES += HIBERNATION_SUPPORT=1 |
| 166 | endif |
| 167 | |
Vijay Kumar Pendoti | 2f86905 | 2016-07-15 12:04:19 +0530 | [diff] [blame] | 168 | ifeq ($(ENABLE_VB_ATTEST),1) |
| 169 | DEFINES += ENABLE_VB_ATTEST=1 |
| 170 | endif |
| 171 | |
Channagoud Kadabi | 9071af3 | 2015-03-12 12:39:56 -0700 | [diff] [blame] | 172 | ifeq ($(USER_BUILD_VARIANT),true) |
| 173 | DEFINES += USER_BUILD_VARIANT=1 |
| 174 | endif |
| 175 | |
Hareesh Gautham | 49c6a61 | 2017-04-21 15:54:27 +0530 | [diff] [blame] | 176 | ifeq ($(USE_LE_SYSTEMD),true) |
| 177 | DEFINES += USE_LE_SYSTEMD=1 |
| 178 | else |
| 179 | DEFINES += USE_LE_SYSTEMD=0 |
| 180 | endif |
| 181 | |
zhaochen | 3e3b52f | 2018-02-06 19:25:27 +0800 | [diff] [blame] | 182 | ifeq ($(MOUNT_EMMC_LE),true) |
| 183 | DEFINES += MOUNT_EMMC_LE=1 |
| 184 | else |
| 185 | DEFINES += MOUNT_EMMC_LE=0 |
| 186 | endif |
| 187 | |
lijuang | c43b2cb | 2017-12-07 14:45:23 +0800 | [diff] [blame] | 188 | #Enable kaslr seed support |
| 189 | ifeq ($(ENABLE_KASLRSEED),1) |
| 190 | DEFINES += ENABLE_KASLRSEED_SUPPORT=1 |
| 191 | else |
| 192 | DEFINES += ENABLE_KASLRSEED_SUPPORT=0 |
| 193 | endif |
| 194 | |
Mayank Grover | 44180df | 2018-05-09 12:13:12 +0530 | [diff] [blame] | 195 | ifeq ($(TARGET_USE_SYSTEM_AS_ROOT_IMAGE),1) |
| 196 | DEFINES += TARGET_USE_SYSTEM_AS_ROOT_IMAGE=1 |
| 197 | else |
| 198 | DEFINES += TARGET_USE_SYSTEM_AS_ROOT_IMAGE=0 |
| 199 | endif |
| 200 | |
tracychui | d184b91 | 2020-06-05 17:31:38 +0800 | [diff] [blame] | 201 | #[20200605][TracyChui]Show SW and modem version and internal storage size on fastboot screen start |
tracychui | 5cfe443 | 2020-09-21 16:15:16 +0800 | [diff] [blame] | 202 | DEFINES += ARIMA_BOOTLOADER_VERSION=\"8901.3.val.0001-SS.20200819\" |
| 203 | DEFINES += ARIMA_BASEBAND_VERSION=\"MPSS.TA.3.1.c1-00021-8953_GEN_PACK-2\" |
tracychui | d184b91 | 2020-06-05 17:31:38 +0800 | [diff] [blame] | 204 | #[20200605][TracyChui]Show SW and modem version and internal storage size on fastboot screen end |
| 205 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 206 | # these need to be filled out by the project/target/platform rules.mk files |
| 207 | TARGET := |
| 208 | PLATFORM := |
| 209 | ARCH := |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 210 | ALLMODULES := |
| 211 | MODULES := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 212 | |
| 213 | # any rules you put here will also be built by the system before considered being complete |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 214 | EXTRA_BUILDDEPS := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 215 | |
| 216 | # any rules you put here will be depended on in clean builds |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 217 | EXTRA_CLEANDEPS := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 218 | |
Travis Geiselbrecht | 577036f | 2009-01-24 21:37:21 -0800 | [diff] [blame] | 219 | include project/$(PROJECT).mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 220 | include target/$(TARGET)/rules.mk |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 221 | include target/$(TARGET)/tools/makefile |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 222 | include platform/$(PLATFORM)/rules.mk |
| 223 | include arch/$(ARCH)/rules.mk |
| 224 | include platform/rules.mk |
| 225 | include target/rules.mk |
| 226 | include kernel/rules.mk |
| 227 | include dev/rules.mk |
Travis Geiselbrecht | 6837223 | 2009-01-24 21:21:08 -0800 | [diff] [blame] | 228 | include app/rules.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 229 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 230 | # recursively include any modules in the MODULE variable, leaving a trail of included |
| 231 | # modules in the ALLMODULES list |
Travis Geiselbrecht | 5bcbd9d | 2009-01-24 20:15:32 -0800 | [diff] [blame] | 232 | include make/module.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 233 | |
| 234 | # any extra top level build dependencies that someone declared |
| 235 | all:: $(EXTRA_BUILDDEPS) |
| 236 | |
| 237 | ALLOBJS := \ |
| 238 | $(BOOTOBJS) \ |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 239 | $(OBJS) |
| 240 | |
| 241 | # add some automatic configuration defines |
| 242 | DEFINES += \ |
| 243 | PROJECT_$(PROJECT)=1 \ |
| 244 | TARGET_$(TARGET)=1 \ |
| 245 | PLATFORM_$(PLATFORM)=1 \ |
| 246 | ARCH_$(ARCH)=1 \ |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 247 | $(addsuffix =1,$(addprefix WITH_,$(ALLMODULES))) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 248 | |
Mayank Grover | 9ca6d48 | 2018-05-30 18:10:16 +0530 | [diff] [blame] | 249 | # Add MEMRWOFF as . for targets this is not declared. |
| 250 | # . will be replaced as string in linker file. |
| 251 | ifeq ($(MEMRWOFF),) |
| 252 | MEMRWOFF:= . |
| 253 | DEFINES += MEMRWOFF=$(MEMRWOFF) |
| 254 | endif |
| 255 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 256 | # debug build? |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 257 | ifneq ($(DEBUG),) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 258 | DEFINES += \ |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 259 | DEBUG=$(DEBUG) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 260 | endif |
| 261 | |
| 262 | ALLOBJS := $(addprefix $(BUILDDIR)/,$(ALLOBJS)) |
| 263 | |
| 264 | DEPS := $(ALLOBJS:%o=%d) |
| 265 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 266 | # default to no ccache |
| 267 | CCACHE ?= |
| 268 | CC := $(CCACHE) $(TOOLCHAIN_PREFIX)gcc |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 269 | ifeq ($(LD),ld) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 270 | LD := $(TOOLCHAIN_PREFIX)ld |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 271 | endif |
| 272 | STRIP := $(TOOLCHAIN_PREFIX)strip |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 273 | OBJDUMP := $(TOOLCHAIN_PREFIX)objdump |
| 274 | OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy |
| 275 | CPPFILT := $(TOOLCHAIN_PREFIX)c++filt |
| 276 | SIZE := $(TOOLCHAIN_PREFIX)size |
| 277 | NM := $(TOOLCHAIN_PREFIX)nm |
| 278 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 279 | # comment out or override if you want to see the full output of each command |
| 280 | NOECHO ?= @ |
| 281 | |
| 282 | # the logic to compile and link stuff is in here |
Travis Geiselbrecht | 5bcbd9d | 2009-01-24 20:15:32 -0800 | [diff] [blame] | 283 | include make/build.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 284 | |
| 285 | clean: $(EXTRA_CLEANDEPS) |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 286 | rm -f $(ALLOBJS) $(DEPS) $(GENERATED) $(OUTBIN) $(OUTELF) $(OUTELF).lst $(OUTELF_STRIP) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 287 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 288 | install: all |
| 289 | scp $(OUTBIN) 192.168.0.4:/tftproot |
| 290 | |
| 291 | # generate a config.h file with all of the DEFINES laid out in #define format |
| 292 | configheader: |
| 293 | |
| 294 | $(CONFIGHEADER): configheader |
| 295 | @$(MKDIR) |
| 296 | @echo generating $@ |
| 297 | @rm -f $(CONFIGHEADER).tmp; \ |
| 298 | echo \#ifndef __CONFIG_H > $(CONFIGHEADER).tmp; \ |
| 299 | echo \#define __CONFIG_H >> $(CONFIGHEADER).tmp; \ |
Mayank Grover | 88647b5 | 2018-06-11 16:40:02 +0530 | [diff] [blame] | 300 | echo \#define BOARD $(BOARD_NAME) >> $(CONFIGHEADER).tmp; \ |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 301 | for d in `echo $(DEFINES) | tr [:lower:] [:upper:]`; do \ |
| 302 | echo "#define $$d" | sed "s/=/\ /g;s/-/_/g;s/\//_/g" >> $(CONFIGHEADER).tmp; \ |
| 303 | done; \ |
| 304 | echo \#endif >> $(CONFIGHEADER).tmp; \ |
| 305 | if [ -f "$(CONFIGHEADER)" ]; then \ |
| 306 | if cmp "$(CONFIGHEADER).tmp" "$(CONFIGHEADER)"; then \ |
| 307 | rm -f $(CONFIGHEADER).tmp; \ |
| 308 | else \ |
| 309 | mv $(CONFIGHEADER).tmp $(CONFIGHEADER); \ |
| 310 | fi \ |
| 311 | else \ |
| 312 | mv $(CONFIGHEADER).tmp $(CONFIGHEADER); \ |
| 313 | fi |
| 314 | |
| 315 | # Empty rule for the .d files. The above rules will build .d files as a side |
| 316 | # effect. Only works on gcc 3.x and above, however. |
| 317 | %.d: |
| 318 | |
| 319 | ifeq ($(filter $(MAKECMDGOALS), clean), ) |
| 320 | -include $(DEPS) |
| 321 | endif |
| 322 | |
| 323 | .PHONY: configheader |
Brian Swetland | f1e5afd | 2009-01-24 22:09:30 -0800 | [diff] [blame] | 324 | endif |
Travis Geiselbrecht | 78d0e6c | 2009-11-27 13:37:03 -0800 | [diff] [blame] | 325 | |
| 326 | endif # make spotless |