aboutsummaryrefslogtreecommitdiff
path: root/examples/system
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2021-10-15 09:22:45 +0800
committerGitHub <noreply@github.com>2021-10-15 09:22:45 +0800
commitdd0f088aaa4c6bf013643be2d1d8621dbffdb000 (patch)
treed848d6ce007d8bb9357c8b99d6a0a39ec41d244e /examples/system
parent9e08d1047fa8deeb3ccb3ce9bb11d69e25a52d56 (diff)
parenteb719a424e6a16fb64209139a32c9f8a7235a929 (diff)
downloadpsn00bsdk-dd0f088aaa4c6bf013643be2d1d8621dbffdb000.tar.gz
Merge pull request #38 from spicyjpeg/cmake
Full CMake support (in place of makefiles)
Diffstat (limited to 'examples/system')
-rw-r--r--examples/system/childexec/CMakeLists.txt41
-rw-r--r--examples/system/childexec/child_exe.s.template (renamed from examples/system/childexec/child_exe.s)2
-rw-r--r--examples/system/childexec/makefile93
-rw-r--r--examples/system/console/CMakeLists.txt22
-rw-r--r--examples/system/console/makefile65
-rw-r--r--examples/system/dynlink/CMakeLists.txt32
-rw-r--r--examples/system/dynlink/iso.xml16
-rw-r--r--examples/system/dynlink/makefile95
-rw-r--r--examples/system/timer/CMakeLists.txt22
-rw-r--r--examples/system/timer/makefile65
-rw-r--r--examples/system/tty/CMakeLists.txt22
-rw-r--r--examples/system/tty/makefile65
12 files changed, 148 insertions, 392 deletions
diff --git a/examples/system/childexec/CMakeLists.txt b/examples/system/childexec/CMakeLists.txt
new file mode 100644
index 0000000..c9983c4
--- /dev/null
+++ b/examples/system/childexec/CMakeLists.txt
@@ -0,0 +1,41 @@
+# PSn00bSDK example CMake script
+# (C) 2021 spicyjpeg - MPL licensed
+
+cmake_minimum_required(VERSION 3.21)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS})
+ set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake)
+endif()
+
+project(
+ childexec
+ LANGUAGES C ASM
+ VERSION 1.0.0
+ DESCRIPTION "PSn00bSDK child process example"
+ HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
+)
+
+configure_file(child_exe.s.template child_exe.s)
+
+file(GLOB _sources *.c)
+file(GLOB _child_sources child/*.c)
+psn00bsdk_add_executable(
+ parent STATIC
+ ${_sources}
+ ${PROJECT_BINARY_DIR}/child_exe.s
+)
+psn00bsdk_add_executable(child STATIC ${_child_sources})
+#psn00bsdk_add_cd_image(childexec_iso childexec iso.xml DEPENDS parent)
+
+# Relocate the child executable to a non-default address to prevent it from
+# overlapping with the main one at 0x80010000.
+# NOTE: child executables are not position-independent and can't be relocated
+# at runtime. If you need your code to be relocatable (e.g. to load it into a
+# dynamically-allocated buffer), consider using a DLL instead.
+target_link_options(child PRIVATE -Ttext=0x80030000)
+
+# Make sure the child executable is built before the parent (so it can be
+# embedded via child_exe.s).
+add_dependencies(parent child)
+
+install(FILES ${PROJECT_BINARY_DIR}/parent.exe DESTINATION .)
diff --git a/examples/system/childexec/child_exe.s b/examples/system/childexec/child_exe.s.template
index 66bd0e2..f76bb3d 100644
--- a/examples/system/childexec/child_exe.s
+++ b/examples/system/childexec/child_exe.s.template
@@ -3,4 +3,4 @@
.global child_exe # Insert spoopypasta
.type child_exe, @object
child_exe:
- .incbin "build/child/child.exe" \ No newline at end of file
+ .incbin "${PROJECT_BINARY_DIR}/child.exe"
diff --git a/examples/system/childexec/makefile b/examples/system/childexec/makefile
deleted file mode 100644
index e801739..0000000
--- a/examples/system/childexec/makefile
+++ /dev/null
@@ -1,93 +0,0 @@
-# PSn00bSDK makefile template
-# Part of the PSn00bSDK Project
-# 2019 - 2021 Lameguy64 / Meido-Tek Productions
-
-## Settings
-
-PSN00BSDK_LIBS ?= ../../../libpsn00b
-
-# 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
-
-# Project target name
-#TARGET = childexec
-
-## Files
-
-# Searches for C, C++ and S (assembler) files in local directory
-CFILES_PARENT = $(notdir $(wildcard *.c))
-CPPFILES_PARENT = $(notdir $(wildcard *.cpp))
-AFILES_PARENT = $(notdir $(wildcard *.s))
-
-CFILES_CHILD = $(notdir $(wildcard child/*.c))
-CPPFILES_CHILD = $(notdir $(wildcard child/*.cpp))
-AFILES_CHILD = $(notdir $(wildcard child/*.s))
-
-# Create names for object files
-OFILES_PARENT = $(addprefix build/,$(CFILES_PARENT:.c=.o)) \
- $(addprefix build/,$(CPPFILES_PARENT:.cpp=.o)) \
- $(addprefix build/,$(AFILES_PARENT:.s=.o))
-OFILES_CHILD = $(addprefix build/child/,$(CFILES_CHILD:.c=.o)) \
- $(addprefix build/child/,$(CPPFILES_CHILD:.cpp=.o)) \
- $(addprefix build/child/,$(AFILES_CHILD:.s=.o))
-
-# Project specific includes and libraries
-# (use -I for include dirs, -L for library dirs, -l for static libraries)
-INCLUDE +=
-LIBDIRS +=
-LIBS +=
-
-# Relocate the child executable to 0x30000
-LDFLAGS_CHILD = -Ttext=0x80030000
-
-## Build rules
-
-#all: iso
-all: build/child/child build/parent
-
-iso: build/child/child build/parent resources
- $(MKPSXISO) -y -q iso.xml
-
-resources:
- # Add commands to build/convert your assets here
- #$(LZPACK) data.xml
-
-build/child/child: $(OFILES_CHILD)
- @mkdir -p $(dir $@)
- $(LD) $(LDFLAGS_EXE) $(LDFLAGS_CHILD) $(LIBDIRS) $^ $(LIBS) -o $@
- $(NM) -f posix -l -n $@ >$@.map
- $(ELF2X) -q $@ $@.exe
-
-build/parent: $(OFILES_PARENT)
- @mkdir -p $(dir $@)
- $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@
- $(NM) -f posix -l -n $@ >$@.map
- $(ELF2X) -q $@ $@.exe
-
-build/child/%.o: child/%.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/child/%.o: child/%.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/child/%.o: child/%.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-clean:
- rm -rf build
diff --git a/examples/system/console/CMakeLists.txt b/examples/system/console/CMakeLists.txt
new file mode 100644
index 0000000..acae08f
--- /dev/null
+++ b/examples/system/console/CMakeLists.txt
@@ -0,0 +1,22 @@
+# PSn00bSDK example CMake script
+# (C) 2021 spicyjpeg - MPL licensed
+
+cmake_minimum_required(VERSION 3.21)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS})
+ set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake)
+endif()
+
+project(
+ console
+ LANGUAGES C
+ VERSION 1.0.0
+ DESCRIPTION "PSn00bSDK stdio console example"
+ HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
+)
+
+file(GLOB _sources *.c)
+psn00bsdk_add_executable(console STATIC ${_sources})
+#psn00bsdk_add_cd_image(console_iso console iso.xml DEPENDS console)
+
+install(FILES ${PROJECT_BINARY_DIR}/console.exe DESTINATION .)
diff --git a/examples/system/console/makefile b/examples/system/console/makefile
deleted file mode 100644
index addf02a..0000000
--- a/examples/system/console/makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-# PSn00bSDK makefile template
-# Part of the PSn00bSDK Project
-# 2019 - 2021 Lameguy64 / Meido-Tek Productions
-
-## Settings
-
-PSN00BSDK_LIBS ?= ../../../libpsn00b
-
-# 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
-
-# Project target name
-TARGET = console
-
-## Files
-
-# 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
-
-build/%.o: %.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-clean:
- rm -rf build
diff --git a/examples/system/dynlink/CMakeLists.txt b/examples/system/dynlink/CMakeLists.txt
new file mode 100644
index 0000000..3af5d4b
--- /dev/null
+++ b/examples/system/dynlink/CMakeLists.txt
@@ -0,0 +1,32 @@
+# PSn00bSDK example CMake script
+# (C) 2021 spicyjpeg - MPL licensed
+
+cmake_minimum_required(VERSION 3.21)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS})
+ set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake)
+endif()
+
+project(
+ dynlink
+ LANGUAGES C
+ VERSION 1.0.0
+ DESCRIPTION "PSn00bSDK dynamic linker example"
+ HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
+)
+
+file(GLOB _sources *.c)
+psn00bsdk_add_executable(dynlink_main DYNAMIC ${_sources})
+psn00bsdk_add_library (dynlink_cube SHARED library/cube.c)
+psn00bsdk_add_library (dynlink_balls SHARED library/balls.c)
+psn00bsdk_add_cd_image(
+ dynlink_iso dynlink iso.xml
+ DEPENDS dynlink_main dynlink_cube dynlink_balls
+)
+
+install(
+ FILES
+ ${PROJECT_BINARY_DIR}/dynlink.bin
+ ${PROJECT_BINARY_DIR}/dynlink.cue
+ DESTINATION .
+)
diff --git a/examples/system/dynlink/iso.xml b/examples/system/dynlink/iso.xml
index 76cc8fc..8f40510 100644
--- a/examples/system/dynlink/iso.xml
+++ b/examples/system/dynlink/iso.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<iso_project
- image_name="build/dynlink.bin"
- cue_sheet="build/dynlink.cue"
+ image_name="${CD_IMAGE_NAME}.bin"
+ cue_sheet="${CD_IMAGE_NAME}.cue"
>
<track type="data">
<identifiers
@@ -9,18 +9,18 @@
volume ="DYNLINK"
volume_set ="DYNLINK"
publisher ="MEIDOTEK"
- data_preparer ="PSN00BSDK BUILD SCRIPT"
+ data_preparer ="PSN00BSDK ${PSN00BSDK_VERSION}"
application ="PLAYSTATION"
copyright ="README.TXT;1"
/>
<directory_tree>
- <file name="SYSTEM.CNF" type="data" source="system.cnf" />
- <file name="MAIN.EXE" type="data" source="build/main.exe" />
- <file name="MAIN.MAP" type="data" source="build/main.map" />
+ <file name="SYSTEM.CNF" type="data" source="${PROJECT_SOURCE_DIR}/system.cnf" />
+ <file name="MAIN.EXE" type="data" source="dynlink_main.exe" />
+ <file name="MAIN.MAP" type="data" source="dynlink_main.map" />
- <file name="CUBE.DLL" type="data" source="build/library/cube.dll" />
- <file name="BALLS.DLL" type="data" source="build/library/balls.dll" />
+ <file name="CUBE.DLL" type="data" source="dynlink_cube.dll" />
+ <file name="BALLS.DLL" type="data" source="dynlink_balls.dll" />
<dummy sectors="1024"/>
</directory_tree>
diff --git a/examples/system/dynlink/makefile b/examples/system/dynlink/makefile
deleted file mode 100644
index b3fb298..0000000
--- a/examples/system/dynlink/makefile
+++ /dev/null
@@ -1,95 +0,0 @@
-# PSn00bSDK makefile template
-# Part of the PSn00bSDK Project
-# 2019 - 2021 Lameguy64 / Meido-Tek Productions
-
-## Settings
-
-PSN00BSDK_LIBS ?= ../../../libpsn00b
-
-# 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
-
-# Project target name
-#TARGET = dynlink
-
-## Files
-
-# Searches for C, C++ and S (assembler) files in local directory
-CFILES_MAIN = $(notdir $(wildcard *.c))
-CPPFILES_MAIN = $(notdir $(wildcard *.cpp))
-AFILES_MAIN = $(notdir $(wildcard *.s))
-
-CFILES_DLL = $(notdir $(wildcard library/*.c))
-CPPFILES_DLL = $(notdir $(wildcard library/*.cpp))
-AFILES_DLL = $(notdir $(wildcard library/*.s))
-
-# Create names for object files
-OFILES_MAIN = $(addprefix build/,$(CFILES_MAIN:.c=.o)) \
- $(addprefix build/,$(CPPFILES_MAIN:.cpp=.o)) \
- $(addprefix build/,$(AFILES_MAIN:.s=.o))
-OFILES_CUBE = build/library/cube.o
-OFILES_BALLS = build/library/balls.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/library/cube build/library/balls build/main
-
-iso: build/library/cube build/library/balls build/main resources
- $(MKPSXISO) -y -q iso.xml
-
-resources:
- # Add commands to build/convert your assets here
- #$(LZPACK) data.xml
-
-build/library/cube: $(OFILES_CUBE)
- @mkdir -p $(dir $@)
- $(LD) $(LDFLAGS_DLL) $^ -o $@
- #$(NM) -f posix -l -n $@ >$@.map
- $(OBJCOPY) -O binary $@ $@.dll
-
-build/library/balls: $(OFILES_BALLS)
- @mkdir -p $(dir $@)
- $(LD) $(LDFLAGS_DLL) $^ -o $@
- #$(NM) -f posix -l -n $@ >$@.map
- $(OBJCOPY) -O binary $@ $@.dll
-
-build/main: $(OFILES_MAIN)
- @mkdir -p $(dir $@)
- $(LD) $(LDFLAGS_EXEDYN) $(LIBDIRS) $^ $(LIBS) -o $@
- $(NM) -f posix -l -n $@ >$@.map
- $(ELF2X) -q $@ $@.exe
-
-build/library/%.o: library/%.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_DLL) $(INCLUDE) -c $< -o $@
-
-build/library/%.o: library/%.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_DLL) $(INCLUDE) -c $< -o $@
-
-build/library/%.o: library/%.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_DLL) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_EXEDYN) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_EXEDYN) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_EXEDYN) $(INCLUDE) -c $< -o $@
-
-clean:
- rm -rf build
diff --git a/examples/system/timer/CMakeLists.txt b/examples/system/timer/CMakeLists.txt
new file mode 100644
index 0000000..189bf87
--- /dev/null
+++ b/examples/system/timer/CMakeLists.txt
@@ -0,0 +1,22 @@
+# PSn00bSDK example CMake script
+# (C) 2021 spicyjpeg - MPL licensed
+
+cmake_minimum_required(VERSION 3.21)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS})
+ set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake)
+endif()
+
+project(
+ timer
+ LANGUAGES C
+ VERSION 1.0.0
+ DESCRIPTION "PSn00bSDK hardware timer example"
+ HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
+)
+
+file(GLOB _sources *.c)
+psn00bsdk_add_executable(timer STATIC ${_sources})
+#psn00bsdk_add_cd_image(timer_iso timer iso.xml DEPENDS timer)
+
+install(FILES ${PROJECT_BINARY_DIR}/timer.exe DESTINATION .)
diff --git a/examples/system/timer/makefile b/examples/system/timer/makefile
deleted file mode 100644
index c418af4..0000000
--- a/examples/system/timer/makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-# PSn00bSDK makefile template
-# Part of the PSn00bSDK Project
-# 2019 - 2021 Lameguy64 / Meido-Tek Productions
-
-## Settings
-
-PSN00BSDK_LIBS ?= ../../../libpsn00b
-
-# 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
-
-# Project target name
-TARGET = timer
-
-## Files
-
-# 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
-
-build/%.o: %.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-clean:
- rm -rf build
diff --git a/examples/system/tty/CMakeLists.txt b/examples/system/tty/CMakeLists.txt
new file mode 100644
index 0000000..024ccd4
--- /dev/null
+++ b/examples/system/tty/CMakeLists.txt
@@ -0,0 +1,22 @@
+# PSn00bSDK example CMake script
+# (C) 2021 spicyjpeg - MPL licensed
+
+cmake_minimum_required(VERSION 3.21)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS})
+ set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake)
+endif()
+
+project(
+ tty
+ LANGUAGES C
+ VERSION 1.0.0
+ DESCRIPTION "PSn00bSDK stdio terminal example"
+ HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
+)
+
+file(GLOB _sources *.c)
+psn00bsdk_add_executable(tty STATIC ${_sources})
+#psn00bsdk_add_cd_image(tty_iso tty iso.xml DEPENDS tty)
+
+install(FILES ${PROJECT_BINARY_DIR}/tty.exe DESTINATION .)
diff --git a/examples/system/tty/makefile b/examples/system/tty/makefile
deleted file mode 100644
index 381aa41..0000000
--- a/examples/system/tty/makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-# PSn00bSDK makefile template
-# Part of the PSn00bSDK Project
-# 2019 - 2021 Lameguy64 / Meido-Tek Productions
-
-## Settings
-
-PSN00BSDK_LIBS ?= ../../../libpsn00b
-
-# 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
-
-# Project target name
-TARGET = tty
-
-## Files
-
-# 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
-
-build/%.o: %.c
- @mkdir -p $(dir $@)
- $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.cpp
- @mkdir -p $(dir $@)
- $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-build/%.o: %.s
- @mkdir -p $(dir $@)
- $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@
-
-clean:
- rm -rf build