blob: e4fd97bb2e11b6361efa9ac42f892e7c6d898afc [file] [log] [blame]
Simon Glass00ebd1f2017-11-12 21:52:07 -07001#
Simon Glassc9a0b272019-08-24 07:22:59 -06002# Builds test programs. This is launched from elf_test.BuildElfTestFiles()
Simon Glass00ebd1f2017-11-12 21:52:07 -07003#
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 Glass53e22bf2019-08-24 07:22:53 -060010VPATH := $(SRC)
Simon Glass1542c8b2019-08-24 07:22:56 -060011CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
12 -Wl,--no-dynamic-linker
Simon Glass00ebd1f2017-11-12 21:52:07 -070013
Simon Glassf514d8f2019-08-24 07:22:54 -060014LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
Simon Glass1542c8b2019-08-24 07:22:56 -060015LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
Simon Glass8dc60f92019-08-24 07:22:58 -060016LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
Simon Glass7c150132019-11-06 17:22:44 -070017LDS_BINMAN_X86 := -T $(SRC)u_boot_binman_syms_x86.lds
Simon Glass00ebd1f2017-11-12 21:52:07 -070018
Simon Glass5cfcf7e2017-11-13 18:54:58 -070019TARGETS = 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 Glass7c150132019-11-06 17:22:44 -070021 u_boot_binman_syms_size u_boot_binman_syms_x86
Simon Glass00ebd1f2017-11-12 21:52:07 -070022
23all: $(TARGETS)
24
25u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
26u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
27
28u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
29u_boot_ucode_ptr: u_boot_ucode_ptr.c
30
Simon Glass53e22bf2019-08-24 07:22:53 -060031bss_data: CFLAGS += $(SRC)bss_data.lds
Simon Glass56509842017-11-12 21:52:25 -070032bss_data: bss_data.c
33
Simon Glass5cfcf7e2017-11-13 18:54:58 -070034u_boot_binman_syms.bin: u_boot_binman_syms
35 objcopy -O binary $< -R .note.gnu.build-id $@
36
37u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
38u_boot_binman_syms: u_boot_binman_syms.c
39
Simon Glass7c150132019-11-06 17:22:44 -070040u_boot_binman_syms_x86: CFLAGS += $(LDS_BINMAN_X86)
41u_boot_binman_syms_x86: u_boot_binman_syms_x86.c
42
Simon Glass5cfcf7e2017-11-13 18:54:58 -070043u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
44u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
45
46u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
47u_boot_binman_syms_size: u_boot_binman_syms_size.c
48
Simon Glass00ebd1f2017-11-12 21:52:07 -070049clean:
50 rm -f $(TARGETS)
51
52help:
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"