44 lines
895 B
Makefile
44 lines
895 B
Makefile
NAME=ps2rom
|
|
TARGET=ee
|
|
KIND=bin
|
|
|
|
SELF=$(shell pwd)
|
|
INCS = -I$(TOP)/rom
|
|
|
|
CFLAGS = -ffreestanding -fno-stack-protector
|
|
CXXFLAGS = -fno-exceptions -fno-rtti
|
|
LDFLAGS = -nostartfiles -nodefaultlibs -Wl,-Map,$(BINDIR)/$(FINALNAME).map -T$(SELF)/link.ld -L$(BINDIR)
|
|
|
|
# Link to each portion of the ROM codebase. For now,
|
|
# this will only link to the EE ROM codebase.
|
|
LIBS=-lps2rom_ee_$(CONFIG)
|
|
|
|
# sources
|
|
SRCS = rom_start.s
|
|
|
|
include $(TOP)/build/core.mk
|
|
|
|
|
|
.PHONY: all clean clean-products
|
|
|
|
|
|
all: $(BINDIR)/$(FINALNAME).rom
|
|
|
|
$(BINDIR)/:
|
|
mkdir -p $@
|
|
|
|
$(OBJDIR)/:
|
|
mkdir -p $@
|
|
|
|
# make sure to assemble the primary ROM start routine
|
|
# as MIPS-I, so that we don't get into any issues.
|
|
$(OBJDIR)/rom_start.o: AS += -march=r3000
|
|
|
|
$(BINDIR)/$(FINALNAME).rom: $(BINDIR)/$(FINALNAME).elf
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
clean: clean-products
|
|
-rm $(BINDIR)/$(FINALNAME).rom
|
|
|
|
include $(TOP)/build/products/$(KIND).mk
|