aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/vof/Makefile
blob: d1eb6ced7ec919dc15e6911d6b528265945eab17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
include config.mak
VPATH=$(SRC_DIR)
all: vof.bin

NULL :=
SPACE := $(NULL) #
TARGET_PREFIX := $(patsubst %/,%:$(SPACE),$(TARGET_DIR))

quiet-@ = $(if $(V),,@$(if $1,,printf "%s\n" "$(TARGET_PREFIX)$1" && ))
quiet-command = $(call quiet-@,$2 $@)$1

EXTRA_CFLAGS += -mcpu=power4

%.o: %.S
	$(call quiet-command, $(CC) $(EXTRA_CFLAGS) -c -o $@ $<,Assembling)

%.o: %.c
	$(call quiet-command, $(CC) $(EXTRA_CFLAGS) -c -fno-stack-protector -o $@ $<,Compiling)

vof.elf: entry.o main.o ci.o bootmem.o libc.o
	$(call quiet-command, $(LD) -nostdlib -e_start -T$(SRC_DIR)/vof.lds -EB -o $@ $^,Linking)

%.bin: %.elf
	$(call quiet-command, $(OBJCOPY) -O binary -j .text -j .data -j .toc -j .got2 $^ $@,Extracting raw object)

clean:
	rm -f *.o vof.bin vof.elf *~

distclean: clean

.PHONY: all clean distclean