xref: /openbmc/u-boot/tools/binman/test/Makefile (revision cd1cc31f)
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
10CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
11
12LDS_UCODE := -T u_boot_ucode_ptr.lds
13LDS_BINMAN := -T u_boot_binman_syms.lds
14LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
15
16TARGETS = 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
19
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
28bss_data: CFLAGS += bss_data.lds
29bss_data: bss_data.c
30
31u_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
43clean:
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"
56