binman: Use the Makefile for u_boot_binman_syms_bad
[platform/kernel/u-boot.git] / tools / binman / test / Makefile
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
10 VPATH := $(SRC)
11 CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
12         -Wl,--no-dynamic-linker
13
14 LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
15 LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
16 LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
17
18 TARGETS = 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
21
22 all: $(TARGETS)
23
24 u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
25 u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
26
27 u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
28 u_boot_ucode_ptr: u_boot_ucode_ptr.c
29
30 bss_data: CFLAGS += $(SRC)bss_data.lds
31 bss_data: bss_data.c
32
33 u_boot_binman_syms.bin: u_boot_binman_syms
34         objcopy -O binary $< -R .note.gnu.build-id $@
35
36 u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
37 u_boot_binman_syms: u_boot_binman_syms.c
38
39 u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
40 u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
41
42 u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
43 u_boot_binman_syms_size: u_boot_binman_syms_size.c
44
45 clean:
46         rm -f $(TARGETS)
47
48 help:
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"