From 3a68de50cb0513932d92a7d34f742ad0710739b9 Mon Sep 17 00:00:00 2001 From: Wolfywolfy Date: Sun, 21 Nov 2021 21:24:07 -0300 Subject: [PATCH] add new makefile, fix workflow errors and fix make --- .github/workflows/compilation.yml | 12 ++--- Makefile | 73 +++++++++++++++++++++++++++++++ src/engine/Makefile | 51 --------------------- src/engine/Makefile.pref | 2 +- src/samples/cube/Makefile | 2 +- 5 files changed, 81 insertions(+), 59 deletions(-) create mode 100644 Makefile delete mode 100644 src/engine/Makefile diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 81be87a..ebe421c 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -21,7 +21,7 @@ jobs: apk add build-base git - name: Compile engine - working-directory: ./src/engine + working-directory: ./ env: ZLIB: ${PS2SDK}/ports LIBTIFF: ${PS2SDK}/ports @@ -29,32 +29,32 @@ jobs: LIBPNG: ${PS2SDK}/ports TYRA: ${GITHUB_WORKSPACE} run: | - make + make - name: Compile unit test project working-directory: ./src/unit_tests/ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make - name: Compile cube project working-directory: ./src/samples/cube/ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make - name: Compile floors project working-directory: ./src/samples/floors/ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make - name: Compile dolphin project working-directory: ./src/samples/dolphin/ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f20b9d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,73 @@ +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# Copyright 2021, tyra - https://github.com/h4570/tyra +# Licenced under Apache License 2.0 +# André Guilherme + +TYRA_DIR = ./ + +LIB_NAME = libtyra.a + +# ENGINE OBJECTS +ENGINE_OBJS = src/engine/engine.o \ + src/engine/modules/audio.o \ + src/engine/modules/camera_base.o \ + src/engine/modules/file_service.o \ + src/engine/modules/gif_sender.o \ + src/engine/modules/light.o \ + src/engine/modules/pad.o \ + src/engine/modules/renderer.o \ + src/engine/modules/texture_repository.o \ + src/engine/modules/timer.o \ + src/engine/modules/vif_sender.o \ + src/engine/models/math/matrix.o \ + src/engine/models/math/plane.o \ + src/engine/models/math/point.o \ + src/engine/models/math/vector3.o \ + src/engine/models/mesh_frame.o \ + src/engine/models/bounding_box.o \ + src/engine/models/mesh_material.o \ + src/engine/models/mesh.o \ + src/engine/models/sprite.o \ + src/engine/models/texture.o \ + src/engine/utils/math.o \ + src/engine/utils/string.o \ + src/engine/loaders/bmp_loader.o \ + src/engine/loaders/dff_loader.o \ + src/engine/loaders/md2_loader.o \ + src/engine/loaders/obj_loader.o \ + src/engine/loaders/png_loader.o \ + src/engine/vu1_progs/draw3D.o \ + +EE_LIBS := $(EE_LIBS) -ldraw -lcdvd -lgraph -lmath3d -lpacket -ldma -lpacket2 -lpad -laudsrv -lc -lstdc++ -lpng -lz + +EE_INCS := -I$(TYRA)/src/engine/include -I$(PS2SDK)/ports/include $(EE_INCS) + +EE_LDFLAGS := -L$(PS2SDK)/ports/lib -L$(TYRA)/src/engine $(EE_LDFLAGS) + +EE_CXXFLAGS := -DHAVE_LIBJPEG -DHAVE_LIBTIFF -DHAVE_LIBPNG -DHAVE_ZLIB -D_XCDVD $(EE_CXXFLAGS) + +EE_DVP = dvp-as + +EE_VCL = vcl + +EE_VCLPP = vclpp + +all: $(ENGINE_OBJS) + ar rcs $(LIB_NAME) $(ENGINE_OBJS) + cp -f $(LIB_NAME) $(PS2SDK)/ee/lib + rm -f $(ENGINE_OBJS) + +# %.vcl: %.vclpp +# $(EE_VCLPP) $< $@ + +# %.vsm: %.vcl +# $(EE_VCL) $< >> $@ + +%.o: %.vsm + $(EE_DVP) $< -o $@ + +include $(PS2SDK)/samples/Makefile.pref +include $(PS2SDK)/samples/Makefile.eeglobal diff --git a/src/engine/Makefile b/src/engine/Makefile deleted file mode 100644 index 0e22f98..0000000 --- a/src/engine/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -TYRA_DIR = ./ - -EE_OBJS = \ - models/math/matrix.o \ - models/math/plane.o \ - models/math/point.o \ - models/math/vector3.o \ - models/mesh_frame.o \ - models/bounding_box.o \ - models/mesh_material.o \ - models/mesh.o \ - models/sprite.o \ - models/texture.o \ - modules/audio.o \ - modules/camera_base.o \ - modules/file_service.o \ - modules/gif_sender.o \ - modules/light.o \ - modules/pad.o \ - modules/renderer.o \ - modules/texture_repository.o \ - modules/timer.o \ - modules/vif_sender.o \ - utils/math.o \ - utils/string.o \ - loaders/bmp_loader.o \ - loaders/dff_loader.o \ - loaders/md2_loader.o \ - loaders/obj_loader.o \ - loaders/png_loader.o \ - vu1_progs/draw3D.o \ - engine.o - -all: $(EE_OBJS) - ar rcs $(LIB_NAME) $(EE_OBJS) - rm -f $(EE_OBJS) - -# %.vcl: %.vclpp -# $(EE_VCLPP) $< $@ - -# %.vsm: %.vcl -# $(EE_VCL) $< >> $@ - -%.o: %.vsm - $(EE_DVP) $< -o $@ - -clean: - rm -f $(EE_OBJS) - rm -f $(LIB_NAME) - -include Makefile.pref diff --git a/src/engine/Makefile.pref b/src/engine/Makefile.pref index fca0614..5f1309d 100644 --- a/src/engine/Makefile.pref +++ b/src/engine/Makefile.pref @@ -8,4 +8,4 @@ EE_VCLPP = vclpp LIB_NAME = libtyra.a include $(PS2SDK)/samples/Makefile.pref -include $(PS2SDK)/samples/Makefile.eeglobal +include $(PS2SDK)/samples/Makefile.eeglobal \ No newline at end of file diff --git a/src/samples/cube/Makefile b/src/samples/cube/Makefile index 8a57865..c239b12 100644 --- a/src/samples/cube/Makefile +++ b/src/samples/cube/Makefile @@ -36,4 +36,4 @@ run-pcsx2: taskkill.exe /f /t /im pcsx2.exe || true $(WSL_LINUX_PCSX2)/pcsx2.exe --elf=$(WSL_MAKE_WINDOWS)\\repos\\tyra\\src\\samples\\$(DIR_NAME)\\bin\\$(EE_BIN) -include $(TYRA)/src/engine/Makefile.pref +include $(TYRA)/src/engine/Makefile.pref \ No newline at end of file