Skip to content

Instantly share code, notes, and snippets.

@Kakise
Created October 14, 2020 06:38
Show Gist options
  • Save Kakise/637740402370369366cd95e125e64ccb to your computer and use it in GitHub Desktop.
Save Kakise/637740402370369366cd95e125e64ccb to your computer and use it in GitHub Desktop.
commit a2bb1e5bfb2aa8b78ca7f0b950bce3e2a7df6965
Author: Kakise <sam.taa@icloud.com>
Date: Wed Oct 14 08:36:24 2020 +0200
Fix macOS build
diff --git a/ndless/src/installer-4.5/Makefile b/ndless/src/installer-4.5/Makefile
index 71b3206..970f80e 100644
--- a/ndless/src/installer-4.5/Makefile
+++ b/ndless/src/installer-4.5/Makefile
@@ -9,6 +9,12 @@ GXXFLAGS := $(GCCFLAGS) -std=c++11 -fno-exceptions -fno-rtti
LFLAGS := -nostdlib -Tldscript
DISTDIR := ../../calcbin
+BASE64 := base64 -w0
+ifeq ($(shell base64 -w 2> /dev/null),)
+ BASE64 := base64
+endif
+
+
all: $(DISTDIR)/ndless_installer_4.5.0.tns
%.o: %.c
@@ -27,7 +33,7 @@ all: $(DISTDIR)/ndless_installer_4.5.0.tns
$(OBJCOPY) -O binary $^ $@
payload: ndless_installer.bin
- (../tools/MakeChunkDispatch/MakeChunkDispatch 0x1800e7f4 0x12480000; cat $^) | base64 -w0 > $@ || rm $@
+ (../tools/MakeChunkDispatch/MakeChunkDispatch 0x1800e7f4 0x12480000; cat $^) | $(BASE64) > $@ || rm $@
ndless_installer.elf: stage0.o stage1.o utils.o
$(LD) $(LFLAGS) $^ -o $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment