Closed mangobuge closed 4 years ago
In case anyone needs it
git clone https://github.com/dgibson/dtc.git
cd dtc
git checkout v1.6.1
make
then made these changes to the makefile
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,7 @@ DEFAULT_CFLAGS += -D_NETBSD_SOURCE
endif
DEFAULT_CFLAGS += -Iinclude/
+DEFAULT_CFLAGS += -I${HOME}/Dev/dtc/libfdt
PKG_CONFIG ?= pkg-config
@@ -126,6 +127,7 @@ LIBUSB_LIBS ?= `$(PKG_CONFIG) --libs $(LIBUSB)`
ZLIB = zlib
ZLIB_CFLAGS ?= `$(PKG_CONFIG) --cflags $(ZLIB)`
ZLIB_LIBS ?= `$(PKG_CONFIG) --libs $(ZLIB)`
+FDT_LIBS ?= -L ${HOME}/Dev/dtc/libfdt/
ifeq ($(OS),Windows_NT)
# Windows lacks mman.h / mmap()
@@ -143,7 +145,7 @@ SPI_FLASH:= fel-spiflash.c fel-spiflash.h fel-remotefunc-spi-data-transfer.h
sunxi-fel: fel.c fit_image.c thunks/fel-to-spl-thunk.h $(PROGRESS) $(SOC_INFO) $(FEL_LIB) $(SPI_FLASH)
$(CC) $(HOST_CFLAGS) $(LIBUSB_CFLAGS) $(ZLIB_CFLAGS) $(LDFLAGS) -o $@ \
- $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS) $(ZLIB_LIBS) -lfdt
+ $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS) $(ZLIB_LIBS) $(FDT_LIBS) -lfdt
sunxi-nand-part: nand-part-main.c nand-part.c nand-part-a10.h nand-part-a20.h
$(CC) $(HOST_CFLAGS) -c -o nand-part-main.o nand-part-main.c
I want to use it under mac