diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-08-17 11:36:56 +0000 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-08-17 11:36:56 +0000 |
| commit | 89751f29467b359339a8c8b57c218cc3328bae43 (patch) | |
| tree | f92eeff576fea528e6a5c5a984207aac9e0d2b8c /examples/cdrom | |
| parent | 5f5461879c73720359e87fa41cbfe8c452f5155e (diff) | |
| download | psn00bsdk-89751f29467b359339a8c8b57c218cc3328bae43.tar.gz | |
Rewritten all Makefiles, set up proper GCC options, added iso.xml to template
Diffstat (limited to 'examples/cdrom')
| -rw-r--r-- | examples/cdrom/cdbrowse/iso.xml | 33 | ||||
| -rw-r--r-- | examples/cdrom/cdbrowse/makefile | 80 | ||||
| -rw-r--r-- | examples/cdrom/cdxa/iso.xml | 29 | ||||
| -rw-r--r-- | examples/cdrom/cdxa/makefile | 80 |
4 files changed, 132 insertions, 90 deletions
diff --git a/examples/cdrom/cdbrowse/iso.xml b/examples/cdrom/cdbrowse/iso.xml index a828df1..5d8963d 100644 --- a/examples/cdrom/cdbrowse/iso.xml +++ b/examples/cdrom/cdbrowse/iso.xml @@ -1,33 +1,34 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<iso_project image_name="cdbrowse.iso"> - +<?xml version="1.0" encoding="utf-8"?> +<iso_project + image_name="build/cdbrowse.bin" + cue_sheet="build/cdbrowse.cue" +> <track type="data"> - <identifiers system ="PLAYSTATION" - application ="PLAYSTATION" - volume ="PSN00BSDK" - volume_set ="PSN00BSDK" + volume ="CDBROWSE" + volume_set ="CDBROWSE" publisher ="MEIDOTEK" + data_preparer ="PSN00BSDK BUILD SCRIPT" + application ="PLAYSTATION" + copyright ="README.TXT;1" /> <directory_tree> + <file name="SYSTEM.CNF" type="data" source="system.cnf" /> + <file name="CDBROWSE.EXE" type="data" source="build/cdbrowse.exe" /> + <file name="CDBROWSE.MAP" type="data" source="build/cdbrowse.map" /> - <file name="system.cnf" type="data" source="system.cnf"/> - <file name="cdbrowse.exe" type="data" source="cdbrowse.exe"/> - - <dir name="dira"> - <dir name="diraa"> + <dir name="DIRA"> + <dir name="DIRAA"> </dir> </dir> - <dir name="dirb"> + <dir name="DIRB"> </dir> <dummy sectors="1024"/> - </directory_tree> - </track> + <!--<track type="audio" source="track2.wav" />--> </iso_project> diff --git a/examples/cdrom/cdbrowse/makefile b/examples/cdrom/cdbrowse/makefile index ee925d2..954408b 100644 --- a/examples/cdrom/cdbrowse/makefile +++ b/examples/cdrom/cdbrowse/makefile @@ -1,45 +1,65 @@ -include ../../examples-setup.mk +# PSn00bSDK makefile template +# Part of the PSn00bSDK Project +# 2019 - 2021 Lameguy64 / Meido-Tek Productions -TARGET = cdbrowse.elf +## Settings -CFILES = $(notdir $(wildcard *.c)) -CPPFILES = $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) +PSN00BSDK_LIBS ?= ../../../libpsn00b -OFILES = $(addprefix build/,$(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(AFILES:.s=.o)) +# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's +# root folder (it only depends on environment variables). +include ../../../psn00bsdk-setup.mk -LIBS = -lpsxcd -lpsxgpu -lpsxgte -lpsxspu -lpsxsio -lpsxetc -lpsxapi -lc +# Project target name +TARGET = cdbrowse -CFLAGS = -g -O2 -fno-builtin -fdata-sections -ffunction-sections -CPPFLAGS = $(CFLAGS) \ - -fno-exceptions \ - -fno-rtti \ - -fno-unwind-tables \ - -fno-threadsafe-statics \ - -fno-use-cxa-atexit +## Files -AFLAGS = -g -msoft-float -LDFLAGS = -g -Ttext=0x80010000 -gc-sections \ - -T $(GCC_BASE)/$(PREFIX)/lib/ldscripts/elf32elmip.x +# Searches for C, C++ and S (assembler) files in local directory +CFILES = $(notdir $(wildcard *.c)) +CPPFILES= $(notdir $(wildcard *.cpp)) +AFILES = $(notdir $(wildcard *.s)) + +# Create names for object files +OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ + $(addprefix build/,$(CPPFILES:.cpp=.o)) \ + $(addprefix build/,$(AFILES:.s=.o)) + +# Project specific includes and libraries +# (use -I for include dirs, -L for library dirs, -l for static libraries) +INCLUDE += +LIBDIRS += +LIBS += + +## Build rules + +all: iso +#all: build/$(TARGET) + +iso: build/$(TARGET) resources + $(MKPSXISO) -y -q iso.xml + +resources: + # Add commands to build/convert your assets here + #$(LZPACK) data.xml + +build/$(TARGET): $(OFILES) + @mkdir -p $(dir $@) + $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ + $(NM) -f posix -l -n $@ >$@.map + $(ELF2X) -q $@ $@.exe -all: $(OFILES) - $(LD) $(LDFLAGS) $(LIBDIRS) $(OFILES) $(LIBS) -o $(TARGET) - elf2x -q $(TARGET) - -iso: - mkpsxiso -y -q iso.xml - build/%.o: %.c @mkdir -p $(dir $@) - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ build/%.o: %.cpp @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS) $(INCLUDE) -c $< -o $@ - + $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ + build/%.o: %.s @mkdir -p $(dir $@) - $(CC) $(AFLAGS) $(INCLUDE) -c $< -o $@ - + $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ + clean: - rm -rf build $(TARGET) $(TARGET:.elf=.exe) + rm -rf build diff --git a/examples/cdrom/cdxa/iso.xml b/examples/cdrom/cdxa/iso.xml index 840b414..9a6a206 100644 --- a/examples/cdrom/cdxa/iso.xml +++ b/examples/cdrom/cdxa/iso.xml @@ -1,29 +1,30 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<iso_project image_name="cdxa.iso"> - +<?xml version="1.0" encoding="utf-8"?> +<iso_project + image_name="build/cdxa.bin" + cue_sheet="build/cdxa.cue" +> <track type="data"> - <identifiers system ="PLAYSTATION" - application ="PLAYSTATION" - volume ="PSN00BSDK" - volume_set ="PSN00BSDK" + volume ="CDXA" + volume_set ="CDXA" publisher ="MEIDOTEK" + data_preparer ="PSN00BSDK BUILD SCRIPT" + application ="PLAYSTATION" + copyright ="README.TXT;1" /> <directory_tree> + <file name="SYSTEM.CNF" type="data" source="system.cnf" /> + <file name="CDXA.EXE" type="data" source="build/cdxa.exe" /> + <file name="CDXA.MAP" type="data" source="build/cdxa.map" /> - <file name="system.cnf" type="data" source="system.cnf"/> - <file name="cdxa.exe" type="data" source="cdxa.exe"/> - <!-- CD-XA file, you'll have to provide your own to make this example work --> - <file name="xasample.xa" type="xa" source="D:\str-temp\subcon.xa"/> + <file name="XASAMPLE.XA" type="mixed" source="xasample.xa"/> <dummy sectors="1024"/> - </directory_tree> - </track> + <!--<track type="audio" source="track2.wav" />--> </iso_project> diff --git a/examples/cdrom/cdxa/makefile b/examples/cdrom/cdxa/makefile index b95efa7..b1627f7 100644 --- a/examples/cdrom/cdxa/makefile +++ b/examples/cdrom/cdxa/makefile @@ -1,45 +1,65 @@ -include ../../examples-setup.mk +# PSn00bSDK makefile template +# Part of the PSn00bSDK Project +# 2019 - 2021 Lameguy64 / Meido-Tek Productions -TARGET = cdxa.elf +## Settings -CFILES = $(notdir $(wildcard *.c)) -CPPFILES = $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) +PSN00BSDK_LIBS ?= ../../../libpsn00b -OFILES = $(addprefix build/,$(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(AFILES:.s=.o)) +# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's +# root folder (it only depends on environment variables). +include ../../../psn00bsdk-setup.mk -LIBS = -lpsxcd -lpsxgpu -lpsxgte -lpsxspu -lpsxsio -lpsxetc -lpsxapi -lc +# Project target name +TARGET = cdxa -CFLAGS = -g -O2 -fno-builtin -fdata-sections -ffunction-sections -CPPFLAGS = $(CFLAGS) \ - -fno-exceptions \ - -fno-rtti \ - -fno-unwind-tables \ - -fno-threadsafe-statics \ - -fno-use-cxa-atexit +## Files -AFLAGS = -g -msoft-float -LDFLAGS = -g -Ttext=0x80010000 -gc-sections \ - -T $(GCC_BASE)/$(PREFIX)/lib/ldscripts/elf32elmip.x +# Searches for C, C++ and S (assembler) files in local directory +CFILES = $(notdir $(wildcard *.c)) +CPPFILES= $(notdir $(wildcard *.cpp)) +AFILES = $(notdir $(wildcard *.s)) + +# Create names for object files +OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ + $(addprefix build/,$(CPPFILES:.cpp=.o)) \ + $(addprefix build/,$(AFILES:.s=.o)) + +# Project specific includes and libraries +# (use -I for include dirs, -L for library dirs, -l for static libraries) +INCLUDE += +LIBDIRS += +LIBS += + +## Build rules + +#all: iso +all: build/$(TARGET) + +iso: build/$(TARGET) resources + $(MKPSXISO) -y -q iso.xml + +resources: + # Add commands to build/convert your assets here + #$(LZPACK) data.xml + +build/$(TARGET): $(OFILES) + @mkdir -p $(dir $@) + $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ + $(NM) -f posix -l -n $@ >$@.map + $(ELF2X) -q $@ $@.exe -all: $(OFILES) - $(LD) $(LDFLAGS) $(LIBDIRS) $(OFILES) $(LIBS) -o $(TARGET) - elf2x -q $(TARGET) - -iso: - mkpsxiso -y -q iso.xml - build/%.o: %.c @mkdir -p $(dir $@) - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ build/%.o: %.cpp @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS) $(INCLUDE) -c $< -o $@ - + $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ + build/%.o: %.s @mkdir -p $(dir $@) - $(CC) $(AFLAGS) $(INCLUDE) -c $< -o $@ - + $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ + clean: - rm -rf build $(TARGET) $(TARGET:.elf=.exe) + rm -rf build |
