Simon Glass | 00ebd1f | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 1 | # |
| 2 | # Builds test programs |
| 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 | 53e22bf | 2019-08-24 07:22:53 -0600 | [diff] [blame] | 10 | VPATH := $(SRC) |
Simon Glass | 00ebd1f | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 11 | CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include |
| 12 | |
Simon Glass | f514d8f | 2019-08-24 07:22:54 -0600 | [diff] [blame^] | 13 | LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds |
Simon Glass | 5cfcf7e | 2017-11-13 18:54:58 -0700 | [diff] [blame] | 14 | LDS_BINMAN := -T u_boot_binman_syms.lds |
| 15 | LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds |
Simon Glass | 00ebd1f | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 16 | |
Simon Glass | 5cfcf7e | 2017-11-13 18:54:58 -0700 | [diff] [blame] | 17 | TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \ |
| 18 | u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \ |
| 19 | u_boot_binman_syms_size |
Simon Glass | 00ebd1f | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 20 | |
| 21 | all: $(TARGETS) |
| 22 | |
| 23 | u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE) |
| 24 | u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c |
| 25 | |
| 26 | u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE) |
| 27 | u_boot_ucode_ptr: u_boot_ucode_ptr.c |
| 28 | |
Simon Glass | 53e22bf | 2019-08-24 07:22:53 -0600 | [diff] [blame] | 29 | bss_data: CFLAGS += $(SRC)bss_data.lds |
Simon Glass | 5650984 | 2017-11-12 21:52:25 -0700 | [diff] [blame] | 30 | bss_data: bss_data.c |
| 31 | |
Simon Glass | 5cfcf7e | 2017-11-13 18:54:58 -0700 | [diff] [blame] | 32 | u_boot_binman_syms.bin: u_boot_binman_syms |
| 33 | objcopy -O binary $< -R .note.gnu.build-id $@ |
| 34 | |
| 35 | u_boot_binman_syms: CFLAGS += $(LDS_BINMAN) |
| 36 | u_boot_binman_syms: u_boot_binman_syms.c |
| 37 | |
| 38 | u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD) |
| 39 | u_boot_binman_syms_bad: u_boot_binman_syms_bad.c |
| 40 | |
| 41 | u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN) |
| 42 | u_boot_binman_syms_size: u_boot_binman_syms_size.c |
| 43 | |
Simon Glass | 00ebd1f | 2017-11-12 21:52:07 -0700 | [diff] [blame] | 44 | clean: |
| 45 | rm -f $(TARGETS) |
| 46 | |
| 47 | help: |
| 48 | @echo "Makefile for binman test programs" |
| 49 | @echo |
| 50 | @echo "Intended for use on x86 hosts" |
| 51 | @echo |
| 52 | @echo "Targets:" |
| 53 | @echo |
| 54 | @echo -e "\thelp - Print help (this is it!)" |
| 55 | @echo -e "\tall - Builds test programs (default targget)" |
| 56 | @echo -e "\tclean - Delete output files" |