diff --git a/.github/workflows/01-build-and-release.yml b/.github/workflows/01-build-and-release.yml new file mode 100644 index 0000000..501ac91 --- /dev/null +++ b/.github/workflows/01-build-and-release.yml @@ -0,0 +1,69 @@ +# With thanks to https://gist.github.com/weibeld/f136048d0a82aacc063f42e684e3c494 +name: build-and-release +on: push +permissions: + contents: write +jobs: + build-job: + runs-on: ubuntu-latest + container: + image: ghcr.io/volkertb/debian-djgpp:v0.2 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Build with debug + run: | + cd Make + make clean + make DEBUG=1 + mv output/usbddosp.exe output/usbddosp_dbg.exe + test -f output/usbddosp_dbg.exe + - name: Build without debug + run: | + cd Make + make clean + make + test -f output/usbddosp.exe + test -f output/usbddosp_dbg.exe + # Verify that the non-debug variant is actually different from the debug variant. + ! diff output/usbddosp.exe output/usbddosp_dbg.exe + - name: 'Upload Artifacts' + uses: actions/upload-artifact@v4 + with: + name: compiled-usbddosp-executables + path: | + Make/output/usbddosp.exe + Make/output/usbddosp_dbg.exe + retention-days: 1 + + publish-job: + # TODO: uncomment following line (and remove this TODO) once the PR is approved, just before merging to master/main + #if: github.event.ref_name == github.event.repository.default_branch + needs: build-job + runs-on: ubuntu-latest + steps: + - name: Generate release tag + id: tag + run: | + echo "release_tag=UserBuild_$(date +"%Y.%m.%d_%H-%M")" >> $GITHUB_OUTPUT + - name: 'Download Artifacts' + uses: actions/download-artifact@v4 + with: + name: compiled-usbddosp-executables + - name: Release compiled executables + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.tag.outputs.release_tag }} + files: | + usbddosp.exe + usbddosp_dbg.exe + body: | + ## Description of files + + - `usbddosp.exe` -> Regular build that you should use normally. + - `usbddosp_dbg.exe` -> Debug-enabled build to help with debugging and troubleshooting. + + When the tool isn't working on the hardware you're trying it on, then please try the debug-enabled build. + When opening a GitHub issue to report incompatible hardware, please include any debug output. diff --git a/.gitignore b/.gitignore index 5963105..0c626fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.idea .vscode Make/output/*.* diff --git a/Make/Makefile b/Make/Makefile index 50dfd28..eeecfbc 100644 --- a/Make/Makefile +++ b/Make/Makefile @@ -8,7 +8,15 @@ RM := del clean: $(RM) output\*.o else #PROMPT +ifeq (, $(shell which i586-pc-msdosdjgpp-gcc)) # If i586-pc-msdosdjgpp-gcc is not in the path +ifeq (, $(shell which gcc)) # If gcc is also not in the path +$(error "No compiler found in $(PATH), make sure that either i586-pc-msdosdjgpp-gcc or gcc (DJGPP) is installed.") +else # gcc IS in the path +CC = gcc +endif # If gcc is also not in the path +else # i586-pc-msdosdjgpp-gcc IS in the path CC = i586-pc-msdosdjgpp-gcc +endif # If i586-pc-msdosdjgpp-gcc is not in the path SRC = $(shell find .. -name '*.c') clean: $(RM) $(OBJS) @@ -24,7 +32,7 @@ LDFLAGS = -lm ifeq ($(DEBUG),0) LDFLAGS += -s -CFLAGS += -DNDEBUG +CFLAGS += -DNDEBUG -DDEBUG=0 else CFLAGS += -DDEBUG=1 endif diff --git a/RetroWav/Board/OPL3.c b/RetroWav/Board/OPL3.c index 25a51df..107b3cc 100644 --- a/RetroWav/Board/OPL3.c +++ b/RetroWav/Board/OPL3.c @@ -41,7 +41,7 @@ 并将在法律允许的最大范围内被起诉。 */ -#include "RETROWAV/BOARD/OPL3.h" +#include "OPL3.h" static const int transfer_speed = 2e6; diff --git a/RetroWav/Protocol/Serial.c b/RetroWav/Protocol/Serial.c index ec9523c..eb48733 100644 --- a/RetroWav/Protocol/Serial.c +++ b/RetroWav/Protocol/Serial.c @@ -42,7 +42,7 @@ 并将在法律允许的最大范围内被起诉。 */ -#include "Retrowav/Protocol/Serial.h" +#include "Serial.h" #ifdef __cplusplus extern "C" { diff --git a/RetroWav/RetroWav.c b/RetroWav/RetroWav.c index f119f85..275dbb5 100644 --- a/RetroWav/RetroWav.c +++ b/RetroWav/RetroWav.c @@ -42,7 +42,7 @@ 并将在法律允许的最大范围内被起诉。 */ -#include "RetroWav/RetroWav.h" +#include "RetroWav.h" #include #define RETROWAVE_CMD_BUFFER_SIZE 110 diff --git a/USBDDOS/HCD/hcd.h b/USBDDOS/HCD/hcd.h index 19c2dd4..2ffecce 100644 --- a/USBDDOS/HCD/hcd.h +++ b/USBDDOS/HCD/hcd.h @@ -1,7 +1,7 @@ #ifndef _HCD_H_ #define _HCD_H_ 1 #include "USBDDOS/platform.h" -#include "USBDDOS/USBCFG.H" +#include "USBDDOS/usbcfg.h" #include "USBDDOS/pci.h" //host controler driver generic