Skip to content

Commit a9b5248

Browse files
committed
Merge pull request adafruit#672 from marcusva/makefile
toolchain fixes to enable cross compatibility
2 parents dc93193 + 8ffc024 commit a9b5248

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

py/mkenv.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ ECHO = @echo
4242
CP = cp
4343
MKDIR = mkdir
4444
SED = sed
45-
PYTHON = python
46-
47-
AS = $(CROSS_COMPILE)as
48-
CC = $(CROSS_COMPILE)gcc
49-
LD = $(CROSS_COMPILE)ld
50-
OBJCOPY = $(CROSS_COMPILE)objcopy
51-
SIZE = $(CROSS_COMPILE)size
52-
STRIP = $(CROSS_COMPILE)strip
45+
PYTHON ?= python
46+
47+
AS ?= $(CROSS_COMPILE)as
48+
CC ?= $(CROSS_COMPILE)gcc
49+
LD ?= $(CROSS_COMPILE)ld
50+
OBJCOPY ?= $(CROSS_COMPILE)objcopy
51+
SIZE ?= $(CROSS_COMPILE)size
52+
STRIP ?= $(CROSS_COMPILE)strip
5353

5454
all:
5555
.PHONY: all

py/py-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# Note: git describe doesn't work if no tag is available
44
git_tag="$(git describe --dirty --always)"

unix/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ ifeq ($(MICROPY_PY_FFI),1)
4848
LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi)
4949
LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi)
5050
CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_PY_FFI=1
51-
LDFLAGS_MOD += -ldl $(LIBFFI_LDFLAGS_MOD)
51+
ifeq ($(UNAME_S),Linux)
52+
LDFLAGS_MOD += -ldl
53+
endif
54+
LDFLAGS_MOD += $(LIBFFI_LDFLAGS_MOD)
5255
SRC_MOD += modffi.c
5356
endif
5457

0 commit comments

Comments
 (0)