45 lines
763 B
Makefile
45 lines
763 B
Makefile
NAME=ps2rom
|
|
TARGET=ee
|
|
KIND=bin
|
|
|
|
SELF=$(shell pwd)
|
|
INCS = -I$(TOP)/src
|
|
|
|
CFLAGS = -ffreestanding -fno-stack-protector -mabi=32
|
|
CXXFLAGS = -fno-exceptions -fno-rtti
|
|
LDFLAGS = -nostartfiles -nodefaultlibs -Wl,-Map,$(BINDIR)/$(FINALNAME).map -T$(SELF)/link.ld
|
|
|
|
# sources
|
|
SRCS = start.s \
|
|
ee_start.c
|
|
|
|
|
|
.PHONY: all clean clean-products
|
|
include $(TOP)/build/core.mk
|
|
|
|
|
|
all: $(BINDIR)/$(FINALNAME).rom
|
|
|
|
|
|
$(BINDIR)/:
|
|
mkdir -p $@
|
|
|
|
$(OBJDIR)/:
|
|
mkdir -p $@
|
|
|
|
|
|
clean-products:
|
|
-rm $(BINDIR)/$(FINALNAME).elf
|
|
-rm -rf obj
|
|
|
|
clean: clean-products
|
|
-rm $(BINDIR)/$(FINALNAME).rom
|
|
|
|
|
|
$(BINDIR)/$(FINALNAME).rom: $(BINDIR)/$(FINALNAME).elf
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
$(BINDIR)/$(FINALNAME).elf: $(OBJDIR)/ $(BINDIR)/ $(OBJECTS)
|
|
$(LD) $(LDFLAGS) $(LIBS) $(OBJECTS) -o $@
|
|
|