xref: /openbmc/u-boot/tools/binman/test/Makefile (revision 15616a0aa58173bce1efe47569bf2e10d023ae9c)
100ebd1f7SSimon Glass#
200ebd1f7SSimon Glass# Builds test programs
300ebd1f7SSimon Glass#
400ebd1f7SSimon Glass# Copyright (C) 2017 Google, Inc
500ebd1f7SSimon Glass# Written by Simon Glass <sjg@chromium.org>
600ebd1f7SSimon Glass#
700ebd1f7SSimon Glass# SPDX-License-Identifier:      GPL-2.0+
800ebd1f7SSimon Glass#
900ebd1f7SSimon Glass
1000ebd1f7SSimon GlassCFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
1100ebd1f7SSimon Glass
1200ebd1f7SSimon GlassLDS_UCODE := -T u_boot_ucode_ptr.lds
13*5cfcf7e0SSimon GlassLDS_BINMAN := -T u_boot_binman_syms.lds
14*5cfcf7e0SSimon GlassLDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
1500ebd1f7SSimon Glass
16*5cfcf7e0SSimon GlassTARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
17*5cfcf7e0SSimon Glass	u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
18*5cfcf7e0SSimon Glass	u_boot_binman_syms_size
1900ebd1f7SSimon Glass
2000ebd1f7SSimon Glassall: $(TARGETS)
2100ebd1f7SSimon Glass
2200ebd1f7SSimon Glassu_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
2300ebd1f7SSimon Glassu_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
2400ebd1f7SSimon Glass
2500ebd1f7SSimon Glassu_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
2600ebd1f7SSimon Glassu_boot_ucode_ptr: u_boot_ucode_ptr.c
2700ebd1f7SSimon Glass
2856509843SSimon Glassbss_data: CFLAGS += bss_data.lds
2956509843SSimon Glassbss_data: bss_data.c
3056509843SSimon Glass
31*5cfcf7e0SSimon Glassu_boot_binman_syms.bin: u_boot_binman_syms
32*5cfcf7e0SSimon Glass	objcopy -O binary $< -R .note.gnu.build-id $@
33*5cfcf7e0SSimon Glass
34*5cfcf7e0SSimon Glassu_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
35*5cfcf7e0SSimon Glassu_boot_binman_syms: u_boot_binman_syms.c
36*5cfcf7e0SSimon Glass
37*5cfcf7e0SSimon Glassu_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
38*5cfcf7e0SSimon Glassu_boot_binman_syms_bad: u_boot_binman_syms_bad.c
39*5cfcf7e0SSimon Glass
40*5cfcf7e0SSimon Glassu_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
41*5cfcf7e0SSimon Glassu_boot_binman_syms_size: u_boot_binman_syms_size.c
42*5cfcf7e0SSimon Glass
4300ebd1f7SSimon Glassclean:
4400ebd1f7SSimon Glass	rm -f $(TARGETS)
4500ebd1f7SSimon Glass
4600ebd1f7SSimon Glasshelp:
4700ebd1f7SSimon Glass	@echo "Makefile for binman test programs"
4800ebd1f7SSimon Glass	@echo
4900ebd1f7SSimon Glass	@echo "Intended for use on x86 hosts"
5000ebd1f7SSimon Glass	@echo
5100ebd1f7SSimon Glass	@echo "Targets:"
5200ebd1f7SSimon Glass	@echo
5300ebd1f7SSimon Glass	@echo -e "\thelp	- Print help (this is it!)"
5400ebd1f7SSimon Glass	@echo -e "\tall	- Builds test programs (default targget)"
5500ebd1f7SSimon Glass	@echo -e "\tclean	- Delete output files"
56