Simon Glass | 151ba36 | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 1 | # |
Simon Glass | 93a806f | 2019-08-24 07:22:59 -0600 | [diff] [blame] | 2 | # Builds test programs. This is launched from elf_test.BuildElfTestFiles() |
Simon Glass | 151ba36 | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 3 | # |
| 4 | # Copyright (C) 2017 Google, Inc |
| 5 | # Written by Simon Glass <sjg@chromium.org> |
| 6 | # |
| 7 | # SPDX-License-Identifier: GPL-2.0+ |
| 8 | # |
| 9 | |
Simon Glass | f629089 | 2019-08-24 07:22:53 -0600 | [diff] [blame] | 10 | VPATH := $(SRC) |
Simon Glass | 5d0c026 | 2019-08-24 07:22:56 -0600 | [diff] [blame] | 11 | CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \ |
| 12 | -Wl,--no-dynamic-linker |
Simon Glass | 151ba36 | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 13 | |
Simon Glass | 4affd4b | 2019-08-24 07:22:54 -0600 | [diff] [blame] | 14 | LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds |
Simon Glass | 5d0c026 | 2019-08-24 07:22:56 -0600 | [diff] [blame] | 15 | LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds |
Simon Glass | 46ea691 | 2019-08-24 07:22:58 -0600 | [diff] [blame] | 16 | LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds |
Simon Glass | 72555fa | 2019-11-06 17:22:44 -0700 | [diff] [blame] | 17 | LDS_BINMAN_X86 := -T $(SRC)u_boot_binman_syms_x86.lds |
Simon Glass | 151ba36 | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 18 | |
Simon Glass | ff33925 | 2017-11-13 18:54:58 -0700 | [diff] [blame] | 19 | TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \ |
| 20 | u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \ |
Simon Glass | 72555fa | 2019-11-06 17:22:44 -0700 | [diff] [blame] | 21 | u_boot_binman_syms_size u_boot_binman_syms_x86 |
Simon Glass | 151ba36 | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 22 | |
| 23 | all: $(TARGETS) |
| 24 | |
| 25 | u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE) |
| 26 | u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c |
| 27 | |
| 28 | u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE) |
| 29 | u_boot_ucode_ptr: u_boot_ucode_ptr.c |
| 30 | |
Simon Glass | f629089 | 2019-08-24 07:22:53 -0600 | [diff] [blame] | 31 | bss_data: CFLAGS += $(SRC)bss_data.lds |
Simon Glass | 7f94e83 | 2017-11-12 21:52:25 -0700 | [diff] [blame] | 32 | bss_data: bss_data.c |
| 33 | |
Simon Glass | ff33925 | 2017-11-13 18:54:58 -0700 | [diff] [blame] | 34 | u_boot_binman_syms.bin: u_boot_binman_syms |
| 35 | objcopy -O binary $< -R .note.gnu.build-id $@ |
| 36 | |
| 37 | u_boot_binman_syms: CFLAGS += $(LDS_BINMAN) |
| 38 | u_boot_binman_syms: u_boot_binman_syms.c |
| 39 | |
Simon Glass | 72555fa | 2019-11-06 17:22:44 -0700 | [diff] [blame] | 40 | u_boot_binman_syms_x86: CFLAGS += $(LDS_BINMAN_X86) |
| 41 | u_boot_binman_syms_x86: u_boot_binman_syms_x86.c |
| 42 | |
Simon Glass | ff33925 | 2017-11-13 18:54:58 -0700 | [diff] [blame] | 43 | u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD) |
| 44 | u_boot_binman_syms_bad: u_boot_binman_syms_bad.c |
| 45 | |
| 46 | u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN) |
| 47 | u_boot_binman_syms_size: u_boot_binman_syms_size.c |
| 48 | |
Simon Glass | 151ba36 | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 49 | clean: |
| 50 | rm -f $(TARGETS) |
| 51 | |
| 52 | help: |
| 53 | @echo "Makefile for binman test programs" |
| 54 | @echo |
| 55 | @echo "Intended for use on x86 hosts" |
| 56 | @echo |
| 57 | @echo "Targets:" |
| 58 | @echo |
| 59 | @echo -e "\thelp - Print help (this is it!)" |
| 60 | @echo -e "\tall - Builds test programs (default targget)" |
| 61 | @echo -e "\tclean - Delete output files" |