Home | History | Annotate | Download | only in test
      1 #
      2 # Builds test programs
      3 #
      4 # Copyright (C) 2017 Google, Inc
      5 # Written by Simon Glass <sjg (at] chromium.org>
      6 #
      7 # SPDX-License-Identifier:      GPL-2.0+
      8 #
      9 
     10 CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
     11 
     12 LDS_UCODE := -T u_boot_ucode_ptr.lds
     13 LDS_BINMAN := -T u_boot_binman_syms.lds
     14 LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds
     15 
     16 TARGETS = 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 
     20 all: $(TARGETS)
     21 
     22 u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
     23 u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
     24 
     25 u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
     26 u_boot_ucode_ptr: u_boot_ucode_ptr.c
     27 
     28 bss_data: CFLAGS += bss_data.lds
     29 bss_data: bss_data.c
     30 
     31 u_boot_binman_syms.bin: u_boot_binman_syms
     32 	objcopy -O binary $< -R .note.gnu.build-id $@
     33 
     34 u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
     35 u_boot_binman_syms: u_boot_binman_syms.c
     36 
     37 u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
     38 u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
     39 
     40 u_boot_binman_syms_size: CFLAGS += $(LDS_BINMAN)
     41 u_boot_binman_syms_size: u_boot_binman_syms_size.c
     42 
     43 clean:
     44 	rm -f $(TARGETS)
     45 
     46 help:
     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