diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 81be87a..f574355 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/ + working-directory: ./ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make cube - name: Compile floors project - working-directory: ./src/samples/floors/ + working-directory: ./ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make floors - name: Compile dolphin project - working-directory: ./src/samples/dolphin/ + working-directory: ./ env: TYRA: ${GITHUB_WORKSPACE} run: | - make + make dolphin diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4cb74dd --- /dev/null +++ b/Makefile @@ -0,0 +1,83 @@ +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# 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) + +# cube example +cube: + $(MAKE) -C src/samples/cube all clean +# dolphin example +dolphin: + $(MAKE) -C src/samples/dolphin all clean +# floors example +floors: + $(MAKE) -C src/samples/floors all clean + +# %.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 index 0e22f98..1b3fca8 100644 --- a/src/engine/Makefile +++ b/src/engine/Makefile @@ -48,4 +48,4 @@ clean: rm -f $(EE_OBJS) rm -f $(LIB_NAME) -include Makefile.pref +include Makefile.pref \ No newline at end of file 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