Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux support to the Makefile #64

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine:3.14
RUN apk add --no-cache alpine-sdk
RUN git clone https://github.com/mat1jaczyyy/LP-Firmware-Utility/ /tmp/utils

WORKDIR /tmp/utils
RUN make tools
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.PHONY: all clean

ifeq ($(OS),Windows_NT)

define rmdir
Expand All @@ -18,6 +20,9 @@ define mkdir
mkdir -p "$(1)"
endef

UNAME := $(shell uname)
OCIRUNTIME = docker

endif

BUILDDIR = build
Expand Down Expand Up @@ -67,9 +72,19 @@ LDFLAGS += -T$(LDSCRIPT) -u _start -u _Minimum_Stack_Size -mcpu=cortex-m3 -mthu

all: $(SYX)

ifeq ($(UNAME), Linux)
$(SYX): $(BIN)
$(OCIRUNTIME) build -t bintosyxbuilder .
$(OCIRUNTIME) run --rm -it \
-v $(shell pwd)/$(BUILDDIR):/tmp/utils/$(BUILDDIR) \
bintosyxbuilder \
./tools/out/bintosyx /pro 000 $(BIN) $(SYX)
else
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interested in your thoughts on having macOS build the bintosyx tool via Docker from the other repo as well. The only counter-argument I can think of is that macOS machines don't come with gcc preinstalled (but, anyone tinkering with this on a Mac is likely to have gcc installed anyway).

For Windows I'd avoid using Docker and keep the currently prebuilt EXE because you have to either make VS a requirement or deal with the mess of using gcc on Windows, both of which I'd prefer to avoid in a firmware project.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could go either way for Mac, assuming the already provided tools/bintosyx binary has been working. Maybe in another branch, I can experiment with it and let you know what I think.


# build the final sysex file from the ELF - run the simulator first
$(SYX): $(BIN)
./$(BINTOSYX) /pro 000 $(BIN) $(SYX)
endif

$(BIN): $(ELF)
$(OBJCOPY) -O binary $< $@
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ To install the firmware offline, simply send ("flash") the generated SysEx messa

* macOS only: [SysEx Librarian](https://www.snoize.com/SysExLibrarian/)
* Windows only: [MIDI-OX](http://www.midiox.com/moxdown.htm)
* Linux only: [amidi](https://man.archlinux.org/man/amidi.1)

## Usage

Expand Down Expand Up @@ -118,6 +119,17 @@ Then, to directly compile the code:
make
```

### Linux

Install the GCC ARM toolchain through your package manager.
You'll also need a container runtime such as `podman` or `docker` to build part of the tooling.

Compile with:

```
make
```

## Issues

Some Setup parameters found on the stock firmware are not implemented in order to simplify the firmware, including:
Expand Down