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 | 8fd71dc | 2020-06-11 10:17:13 +0800 | [diff] [blame] | 88 | #[TracyChui] Add lock unlock fastboot commnad to skip ui check 20200611 start |
| 89 | CFLAGS += -DENABLE_LOCK_UNLOCK_SKIP_UI_CHECK=1 |
| 90 | #[TracyChui] Add lock unlock fastboot commnad to skip ui check 20200611 end |
| 91 | |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 92 | # setup toolchain prefix |
| 93 | TOOLCHAIN_PREFIX ?= arm-eabi- |
Maria Yu | d320051 | 2014-05-28 15:57:51 +0800 | [diff] [blame] | 94 | CFLAGS += -fstack-protector-all |
vijay kumar | c2119f1 | 2014-07-22 18:30:11 +0530 | [diff] [blame] | 95 | CFLAGS += -fno-strict-overflow |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 96 | CPPFLAGS := -fno-exceptions -fno-rtti -fno-threadsafe-statics |
| 97 | #CPPFLAGS += -Weffc++ |
| 98 | ASMFLAGS := -DASSEMBLY |
| 99 | LDFLAGS := |
| 100 | |
| 101 | CFLAGS += -ffunction-sections -fdata-sections |
| 102 | LDFLAGS += -gc-sections |
| 103 | |
| 104 | # top level rule |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 105 | 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] | 106 | |
| 107 | # the following three object lists are identical except for the ordering |
| 108 | # which is bootobjs, kobjs, objs |
| 109 | BOOTOBJS := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 110 | OBJS := |
| 111 | |
| 112 | # a linker script needs to be declared in one of the project/target/platform files |
| 113 | LINKER_SCRIPT := |
| 114 | |
| 115 | # anything you add here will be deleted in make clean |
| 116 | GENERATED := $(CONFIGHEADER) |
| 117 | |
| 118 | # anything added to DEFINES will be put into $(BUILDDIR)/config.h |
| 119 | DEFINES := LK=1 |
| 120 | |
| 121 | # Anything added to SRCDEPS will become a dependency of every source file in the system. |
| 122 | # Useful for header files that may be included by one or more source files. |
| 123 | SRCDEPS := $(CONFIGHEADER) |
| 124 | |
Shashank Mittal | e99a8d3 | 2014-09-11 19:51:06 -0700 | [diff] [blame] | 125 | ifeq ($(VERIFIED_BOOT),1) |
| 126 | DEFINES += VERIFIED_BOOT=1 |
| 127 | DEFINES += _SIGNED_KERNEL=1 |
| 128 | ifeq ($(DEFAULT_UNLOCK),true) |
| 129 | DEFINES += DEFAULT_UNLOCK=1 |
| 130 | endif |
| 131 | endif |
| 132 | |
AnilKumar Chimata | 4686432 | 2017-08-10 14:51:25 +0530 | [diff] [blame] | 133 | ifeq ($(VERIFIED_BOOT_LE),1) |
| 134 | DEFINES += VERIFIED_BOOT_LE=1 |
| 135 | ifeq ($(DEFAULT_UNLOCK),true) |
| 136 | DEFINES += DEFAULT_UNLOCK=1 |
| 137 | endif |
| 138 | endif |
Monika Singh | ae7e964 | 2018-03-08 17:44:30 +0530 | [diff] [blame] | 139 | ifeq ($(VERIFIED_BOOT_2),1) |
| 140 | DEFINES += VERIFIED_BOOT_2=1 |
| 141 | DEFINES += _SIGNED_KERNEL=1 |
| 142 | endif |
AnilKumar Chimata | 4686432 | 2017-08-10 14:51:25 +0530 | [diff] [blame] | 143 | |
Monika Singh | 4d659d2 | 2019-12-05 16:38:04 +0530 | [diff] [blame] | 144 | ifeq ($(VB1_KEY_USED),1) |
| 145 | DEFINES += VB1_KEY_USED=1 |
| 146 | endif |
| 147 | |
Mayank Grover | c8a46c4 | 2019-04-25 11:46:00 +0530 | [diff] [blame] | 148 | ifeq ($(DYNAMIC_PARTITION_SUPPORT),1) |
| 149 | DEFINES += DYNAMIC_PARTITION_SUPPORT=1 |
| 150 | endif |
| 151 | |
Jiten Patel | 3f6e701 | 2018-08-22 12:46:20 +0530 | [diff] [blame] | 152 | ifeq ($(TARGET_DTBO_NOT_SUPPORTED),1) |
| 153 | DEFINES += TARGET_DTBO_NOT_SUPPORTED=1 |
| 154 | endif |
| 155 | |
Vijay Kumar Pendoti | 2f86905 | 2016-07-15 12:04:19 +0530 | [diff] [blame] | 156 | ifeq ($(OSVERSION_IN_BOOTIMAGE),1) |
| 157 | DEFINES += OSVERSION_IN_BOOTIMAGE=1 |
| 158 | endif |
| 159 | |
Mayank Grover | 02b160c | 2018-05-15 14:52:18 +0530 | [diff] [blame] | 160 | ifeq ($(HIBERNATION_SUPPORT),1) |
| 161 | DEFINES += HIBERNATION_SUPPORT=1 |
| 162 | endif |
| 163 | |
Vijay Kumar Pendoti | 2f86905 | 2016-07-15 12:04:19 +0530 | [diff] [blame] | 164 | ifeq ($(ENABLE_VB_ATTEST),1) |
| 165 | DEFINES += ENABLE_VB_ATTEST=1 |
| 166 | endif |
| 167 | |
Channagoud Kadabi | 9071af3 | 2015-03-12 12:39:56 -0700 | [diff] [blame] | 168 | ifeq ($(USER_BUILD_VARIANT),true) |
| 169 | DEFINES += USER_BUILD_VARIANT=1 |
| 170 | endif |
| 171 | |
Hareesh Gautham | 49c6a61 | 2017-04-21 15:54:27 +0530 | [diff] [blame] | 172 | ifeq ($(USE_LE_SYSTEMD),true) |
| 173 | DEFINES += USE_LE_SYSTEMD=1 |
| 174 | else |
| 175 | DEFINES += USE_LE_SYSTEMD=0 |
| 176 | endif |
| 177 | |
zhaochen | 3e3b52f | 2018-02-06 19:25:27 +0800 | [diff] [blame] | 178 | ifeq ($(MOUNT_EMMC_LE),true) |
| 179 | DEFINES += MOUNT_EMMC_LE=1 |
| 180 | else |
| 181 | DEFINES += MOUNT_EMMC_LE=0 |
| 182 | endif |
| 183 | |
lijuang | c43b2cb | 2017-12-07 14:45:23 +0800 | [diff] [blame] | 184 | #Enable kaslr seed support |
| 185 | ifeq ($(ENABLE_KASLRSEED),1) |
| 186 | DEFINES += ENABLE_KASLRSEED_SUPPORT=1 |
| 187 | else |
| 188 | DEFINES += ENABLE_KASLRSEED_SUPPORT=0 |
| 189 | endif |
| 190 | |
Mayank Grover | 44180df | 2018-05-09 12:13:12 +0530 | [diff] [blame] | 191 | ifeq ($(TARGET_USE_SYSTEM_AS_ROOT_IMAGE),1) |
| 192 | DEFINES += TARGET_USE_SYSTEM_AS_ROOT_IMAGE=1 |
| 193 | else |
| 194 | DEFINES += TARGET_USE_SYSTEM_AS_ROOT_IMAGE=0 |
| 195 | endif |
| 196 | |
tracychui | d184b91 | 2020-06-05 17:31:38 +0800 | [diff] [blame] | 197 | #[20200605][TracyChui]Show SW and modem version and internal storage size on fastboot screen start |
| 198 | DEFINES += ARIMA_BOOTLOADER_VERSION=\"$(ARIMA_SW_VERSION_ABOOT)\" |
| 199 | DEFINES += ARIMA_BASEBAND_VERSION=\"$(MODEM_BUILDID)\" |
| 200 | #[20200605][TracyChui]Show SW and modem version and internal storage size on fastboot screen end |
| 201 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 202 | # these need to be filled out by the project/target/platform rules.mk files |
| 203 | TARGET := |
| 204 | PLATFORM := |
| 205 | ARCH := |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 206 | ALLMODULES := |
| 207 | MODULES := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 208 | |
| 209 | # 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] | 210 | EXTRA_BUILDDEPS := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 211 | |
| 212 | # any rules you put here will be depended on in clean builds |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 213 | EXTRA_CLEANDEPS := |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 214 | |
Travis Geiselbrecht | 577036f | 2009-01-24 21:37:21 -0800 | [diff] [blame] | 215 | include project/$(PROJECT).mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 216 | include target/$(TARGET)/rules.mk |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 217 | include target/$(TARGET)/tools/makefile |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 218 | include platform/$(PLATFORM)/rules.mk |
| 219 | include arch/$(ARCH)/rules.mk |
| 220 | include platform/rules.mk |
| 221 | include target/rules.mk |
| 222 | include kernel/rules.mk |
| 223 | include dev/rules.mk |
Travis Geiselbrecht | 6837223 | 2009-01-24 21:21:08 -0800 | [diff] [blame] | 224 | include app/rules.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 225 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 226 | # recursively include any modules in the MODULE variable, leaving a trail of included |
| 227 | # modules in the ALLMODULES list |
Travis Geiselbrecht | 5bcbd9d | 2009-01-24 20:15:32 -0800 | [diff] [blame] | 228 | include make/module.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 229 | |
| 230 | # any extra top level build dependencies that someone declared |
| 231 | all:: $(EXTRA_BUILDDEPS) |
| 232 | |
| 233 | ALLOBJS := \ |
| 234 | $(BOOTOBJS) \ |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 235 | $(OBJS) |
| 236 | |
| 237 | # add some automatic configuration defines |
| 238 | DEFINES += \ |
| 239 | PROJECT_$(PROJECT)=1 \ |
| 240 | TARGET_$(TARGET)=1 \ |
| 241 | PLATFORM_$(PLATFORM)=1 \ |
| 242 | ARCH_$(ARCH)=1 \ |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 243 | $(addsuffix =1,$(addprefix WITH_,$(ALLMODULES))) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 244 | |
Mayank Grover | 9ca6d48 | 2018-05-30 18:10:16 +0530 | [diff] [blame] | 245 | # Add MEMRWOFF as . for targets this is not declared. |
| 246 | # . will be replaced as string in linker file. |
| 247 | ifeq ($(MEMRWOFF),) |
| 248 | MEMRWOFF:= . |
| 249 | DEFINES += MEMRWOFF=$(MEMRWOFF) |
| 250 | endif |
| 251 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 252 | # debug build? |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 253 | ifneq ($(DEBUG),) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 254 | DEFINES += \ |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 255 | DEBUG=$(DEBUG) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 256 | endif |
| 257 | |
| 258 | ALLOBJS := $(addprefix $(BUILDDIR)/,$(ALLOBJS)) |
| 259 | |
| 260 | DEPS := $(ALLOBJS:%o=%d) |
| 261 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 262 | # default to no ccache |
| 263 | CCACHE ?= |
| 264 | CC := $(CCACHE) $(TOOLCHAIN_PREFIX)gcc |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 265 | ifeq ($(LD),ld) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 266 | LD := $(TOOLCHAIN_PREFIX)ld |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 267 | endif |
| 268 | STRIP := $(TOOLCHAIN_PREFIX)strip |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 269 | OBJDUMP := $(TOOLCHAIN_PREFIX)objdump |
| 270 | OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy |
| 271 | CPPFILT := $(TOOLCHAIN_PREFIX)c++filt |
| 272 | SIZE := $(TOOLCHAIN_PREFIX)size |
| 273 | NM := $(TOOLCHAIN_PREFIX)nm |
| 274 | |
Travis Geiselbrecht | f54ab82 | 2008-09-05 04:14:40 -0700 | [diff] [blame] | 275 | # comment out or override if you want to see the full output of each command |
| 276 | NOECHO ?= @ |
| 277 | |
| 278 | # the logic to compile and link stuff is in here |
Travis Geiselbrecht | 5bcbd9d | 2009-01-24 20:15:32 -0800 | [diff] [blame] | 279 | include make/build.mk |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 280 | |
| 281 | clean: $(EXTRA_CLEANDEPS) |
Channagoud Kadabi | 02072a4 | 2014-02-28 19:15:40 -0800 | [diff] [blame] | 282 | rm -f $(ALLOBJS) $(DEPS) $(GENERATED) $(OUTBIN) $(OUTELF) $(OUTELF).lst $(OUTELF_STRIP) |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 283 | |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 284 | install: all |
| 285 | scp $(OUTBIN) 192.168.0.4:/tftproot |
| 286 | |
| 287 | # generate a config.h file with all of the DEFINES laid out in #define format |
| 288 | configheader: |
| 289 | |
| 290 | $(CONFIGHEADER): configheader |
| 291 | @$(MKDIR) |
| 292 | @echo generating $@ |
| 293 | @rm -f $(CONFIGHEADER).tmp; \ |
| 294 | echo \#ifndef __CONFIG_H > $(CONFIGHEADER).tmp; \ |
| 295 | echo \#define __CONFIG_H >> $(CONFIGHEADER).tmp; \ |
Mayank Grover | 88647b5 | 2018-06-11 16:40:02 +0530 | [diff] [blame] | 296 | echo \#define BOARD $(BOARD_NAME) >> $(CONFIGHEADER).tmp; \ |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 297 | for d in `echo $(DEFINES) | tr [:lower:] [:upper:]`; do \ |
| 298 | echo "#define $$d" | sed "s/=/\ /g;s/-/_/g;s/\//_/g" >> $(CONFIGHEADER).tmp; \ |
| 299 | done; \ |
| 300 | echo \#endif >> $(CONFIGHEADER).tmp; \ |
| 301 | if [ -f "$(CONFIGHEADER)" ]; then \ |
| 302 | if cmp "$(CONFIGHEADER).tmp" "$(CONFIGHEADER)"; then \ |
| 303 | rm -f $(CONFIGHEADER).tmp; \ |
| 304 | else \ |
| 305 | mv $(CONFIGHEADER).tmp $(CONFIGHEADER); \ |
| 306 | fi \ |
| 307 | else \ |
| 308 | mv $(CONFIGHEADER).tmp $(CONFIGHEADER); \ |
| 309 | fi |
| 310 | |
| 311 | # Empty rule for the .d files. The above rules will build .d files as a side |
| 312 | # effect. Only works on gcc 3.x and above, however. |
| 313 | %.d: |
| 314 | |
| 315 | ifeq ($(filter $(MAKECMDGOALS), clean), ) |
| 316 | -include $(DEPS) |
| 317 | endif |
| 318 | |
| 319 | .PHONY: configheader |
Brian Swetland | f1e5afd | 2009-01-24 22:09:30 -0800 | [diff] [blame] | 320 | endif |
Travis Geiselbrecht | 78d0e6c | 2009-11-27 13:37:03 -0800 | [diff] [blame] | 321 | |
| 322 | endif # make spotless |