blob: fd660eac6ecdd6be5681d09f8b46c2c500f2d406 [file] [log] [blame]
Simon Glass00ebd1f2017-11-12 21:52:07 -07001#
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 Glass53e22bf2019-08-24 07:22:53 -060010VPATH := $(SRC)
Simon Glass00ebd1f2017-11-12 21:52:07 -070011CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
12
Simon Glassf514d8f2019-08-24 07:22:54 -060013LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
Simon Glass5cfcf7e2017-11-13 18:54:58 -070014LDS_BINMAN := -T u_boot_binman_syms.lds
15LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
Simon Glass00ebd1f2017-11-12 21:52:07 -070016
Simon Glass5cfcf7e2017-11-13 18:54:58 -070017TARGETS = 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 Glass00ebd1f2017-11-12 21:52:07 -070020
21all: $(TARGETS)
22
23u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
24u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
25
26u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
27u_boot_ucode_ptr: u_boot_ucode_ptr.c
28
Simon Glass53e22bf2019-08-24 07:22:53 -060029bss_data: CFLAGS += $(SRC)bss_data.lds
Simon Glass56509842017-11-12 21:52:25 -070030bss_data: bss_data.c
31
Simon Glass5cfcf7e2017-11-13 18:54:58 -070032u_boot_binman_syms.bin: u_boot_binman_syms
33 objcopy -O binary $< -R .note.gnu.build-id $@
34
35u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
36u_boot_binman_syms: u_boot_binman_syms.c
37
38u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
39u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
40
41u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
42u_boot_binman_syms_size: u_boot_binman_syms_size.c
43
Simon Glass00ebd1f2017-11-12 21:52:07 -070044clean:
45 rm -f $(TARGETS)
46
47help:
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"