xref: /openbmc/qemu/pc-bios/vof/Makefile (revision 2f95279a)
1include config.mak
2VPATH=$(SRC_DIR)
3all: vof.bin
4
5NULL :=
6SPACE := $(NULL) #
7TARGET_PREFIX := $(patsubst %/,%:$(SPACE),$(TARGET_DIR))
8
9quiet-@ = $(if $(V),,@$(if $1,,printf "%s\n" "$(TARGET_PREFIX)$1" && ))
10quiet-command = $(call quiet-@,$2 $@)$1
11
12EXTRA_CFLAGS += -mcpu=power4
13
14%.o: %.S
15	$(call quiet-command, $(CC) $(EXTRA_CFLAGS) -c -o $@ $<,Assembling)
16
17%.o: %.c
18	$(call quiet-command, $(CC) $(EXTRA_CFLAGS) -c -fno-stack-protector -o $@ $<,Compiling)
19
20vof.elf: entry.o main.o ci.o bootmem.o libc.o
21	$(call quiet-command, $(LD) -nostdlib -e_start -T$(SRC_DIR)/vof.lds -EB -o $@ $^,Linking)
22
23%.bin: %.elf
24	$(call quiet-command, $(OBJCOPY) -O binary -j .text -j .data -j .toc -j .got2 $^ $@,Extracting raw object)
25
26clean:
27	rm -f *.o vof.bin vof.elf *~
28
29distclean: clean
30
31.PHONY: all clean distclean
32