blob: e58fc807757b3528acf7bfaef14266ed982d585d [file] [log] [blame]
Simon Glass151ba362017-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
10CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
11
12LDS_UCODE := -T u_boot_ucode_ptr.lds
Simon Glassff339252017-11-13 18:54:58 -070013LDS_BINMAN := -T u_boot_binman_syms.lds
14LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
Simon Glass151ba362017-11-12 21:52:07 -070015
Simon Glassff339252017-11-13 18:54:58 -070016TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
17 u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
18 u_boot_binman_syms_size
Simon Glass151ba362017-11-12 21:52:07 -070019
20all: $(TARGETS)
21
22u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
23u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
24
25u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
26u_boot_ucode_ptr: u_boot_ucode_ptr.c
27
Simon Glass7f94e832017-11-12 21:52:25 -070028bss_data: CFLAGS += bss_data.lds
29bss_data: bss_data.c
30
Simon Glassff339252017-11-13 18:54:58 -070031u_boot_binman_syms.bin: u_boot_binman_syms
32 objcopy -O binary $< -R .note.gnu.build-id $@
33
34u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
35u_boot_binman_syms: u_boot_binman_syms.c
36
37u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
38u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
39
40u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
41u_boot_binman_syms_size: u_boot_binman_syms_size.c
42
Simon Glass151ba362017-11-12 21:52:07 -070043clean:
44 rm -f $(TARGETS)
45
46help:
47 @echo "Makefile for binman test programs"
48 @echo
49 @echo "Intended for use on x86 hosts"
50 @echo
51 @echo "Targets:"
52 @echo
53 @echo -e "\thelp - Print help (this is it!)"
54 @echo -e "\tall - Builds test programs (default targget)"
55 @echo -e "\tclean - Delete output files"