blob: bdbb009874d4a6a1016a4735328ce22ce4456442 [file] [log] [blame]
Simon Glass151ba362017-11-12 21:52:07 -07001#
Simon Glass93a806f2019-08-24 07:22:59 -06002# Builds test programs. This is launched from elf_test.BuildElfTestFiles()
Simon Glass151ba362017-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 Glassf6290892019-08-24 07:22:53 -060010VPATH := $(SRC)
Simon Glass5d0c0262019-08-24 07:22:56 -060011CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
12 -Wl,--no-dynamic-linker
Simon Glass151ba362017-11-12 21:52:07 -070013
Simon Glass4affd4b2019-08-24 07:22:54 -060014LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
Simon Glass5d0c0262019-08-24 07:22:56 -060015LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
Simon Glass46ea6912019-08-24 07:22:58 -060016LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
Simon Glass151ba362017-11-12 21:52:07 -070017
Simon Glassff339252017-11-13 18:54:58 -070018TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
19 u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
20 u_boot_binman_syms_size
Simon Glass151ba362017-11-12 21:52:07 -070021
22all: $(TARGETS)
23
24u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
25u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
26
27u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
28u_boot_ucode_ptr: u_boot_ucode_ptr.c
29
Simon Glassf6290892019-08-24 07:22:53 -060030bss_data: CFLAGS += $(SRC)bss_data.lds
Simon Glass7f94e832017-11-12 21:52:25 -070031bss_data: bss_data.c
32
Simon Glassff339252017-11-13 18:54:58 -070033u_boot_binman_syms.bin: u_boot_binman_syms
34 objcopy -O binary $< -R .note.gnu.build-id $@
35
36u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
37u_boot_binman_syms: u_boot_binman_syms.c
38
39u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
40u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
41
42u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
43u_boot_binman_syms_size: u_boot_binman_syms_size.c
44
Simon Glass151ba362017-11-12 21:52:07 -070045clean:
46 rm -f $(TARGETS)
47
48help:
49 @echo "Makefile for binman test programs"
50 @echo
51 @echo "Intended for use on x86 hosts"
52 @echo
53 @echo "Targets:"
54 @echo
55 @echo -e "\thelp - Print help (this is it!)"
56 @echo -e "\tall - Builds test programs (default targget)"
57 @echo -e "\tclean - Delete output files"