Skip to content

Commit

Permalink
Updated Makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Dec 25, 2019
1 parent 5532f07 commit 5ac8a68
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 41 deletions.
13 changes: 10 additions & 3 deletions common-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ INCLUDE += -I$(BASEDIR)/common
LIBDIRS += -L$(BASEDIR)/common
LIBS += -lcommon -lpsxetc -lpsxgpu -lpsxapi -lc

all: $(OFILES)
TARGET_EXE := $(TARGET:.elf=.exe)

$(TARGET): $(OFILES)
@echo "LD $(TARGET)"
@$(LD) $(LDFLAGS) $(LIBDIRS) $(OFILES) $(LIBS) -o $(TARGET)

$(TARGET_EXE): $(TARGET)
@echo "ELF2X $(TARGET:.elf=.exe)"
@elf2x -q $(TARGET)


all: $(TARGET_EXE)

clean:
rm -rf build $(TARGET) $(TARGET:.elf=.exe)
rm -rf build $(TARGET) $(TARGET_EXE)

.PHONY: all clean
.DEFAULT_GOAL := $(TARGET_EXE)
10 changes: 5 additions & 5 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ LIBDIRS := -L$(PSN00BSDK)/libpsn00b
GCC_VERSION = 7.4.0
GCC_BASE = /usr/local/mipsel-unknown-elf

CFLAGS = -g -msoft-float -O2 -fno-builtin -fdata-sections -ffunction-sections
CPPFLAGS = $(CFLAGS) -fno-exceptions -std=c++17
AFLAGS = -g -msoft-float
LDFLAGS = -g -Ttext=0x80010000 -gc-sections -T $(GCC_BASE)/mipsel-unknown-elf/lib/ldscripts/elf32elmip.x
CFLAGS ?= -g -msoft-float -O2 -fno-builtin -fdata-sections -ffunction-sections
CPPFLAGS ?= $(CFLAGS) -fno-exceptions -std=c++17
AFLAGS ?= -g -msoft-float
LDFLAGS ?= -g -Ttext=0x80010000 -gc-sections -T $(GCC_BASE)/mipsel-unknown-elf/lib/ldscripts/elf32elmip.x

# Toolchain programs
CC = $(PREFIX)gcc
Expand All @@ -18,7 +18,7 @@ AR = $(PREFIX)ar
LD = $(PREFIX)ld
RANLIB = $(PREFIX)ranlib

LIBS =
LIBS ?=

CFILES = $(notdir $(wildcard *.c))
CPPFILES = $(notdir $(wildcard *.cpp))
Expand Down
4 changes: 2 additions & 2 deletions gpu/bandwidth/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = bandwidth.elf

TARGET = bandwidth.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/benchmark/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = benchmark.elf

TARGET = benchmark.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/gp0-e1/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = gp0-e1.elf

TARGET = gp0-e1.elf
include ../../common-test.mk
6 changes: 3 additions & 3 deletions gpu/lines/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../../common-test.mk

TARGET = lines.elf
LIBS += -lpsxgte -lpsxapi
LIBS += -lpsxgte

include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/mask-bit/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = mask-bit.elf

TARGET = mask-bit.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/quad/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk

TARGET = quad.elf

include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/rectangles/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = rectangles.elf

TARGET = rectangles.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/texture-overflow/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk

TARGET = texture-overflow.elf

include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/transparency/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = transparency.elf

TARGET = transparency.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/triangle/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = triangle.elf

TARGET = triangle.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions gpu/vram-to-vram-overlap/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = vram-to-vram-overlap.elf

TARGET = vram-to-vram-overlap.elf
include ../../common-test.mk
6 changes: 3 additions & 3 deletions gte-fuzz/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../common-test.mk

TARGET = gte-fuzz.elf
LIBS += -lpsxgte
LIBS += -lpsxgte

include ../common-test.mk
6 changes: 3 additions & 3 deletions spu/stereo/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../../common-test.mk

TARGET = stereo.elf
LIBS += -lpsxspu
LIBS += -lpsxspu

include ../../common-test.mk
4 changes: 2 additions & 2 deletions spu/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../../common-test.mk
TARGET = test.elf

TARGET = test.elf
include ../../common-test.mk
4 changes: 2 additions & 2 deletions timers/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include ../common-test.mk
TARGET = timers.elf

TARGET = timers.elf
include ../common-test.mk

0 comments on commit 5ac8a68

Please sign in to comment.