Skip to content
Snippets Groups Projects
Commit b2f303b1 authored by Mats Engstrom's avatar Mats Engstrom
Browse files

Support for MacOS

parent 34220231
No related branches found
No related tags found
No related merge requests found
......@@ -7,14 +7,27 @@ CFLAGS:=-O0 -g3 -Wall
ifeq ($(OS),Windows_NT)
LDFLAGS:=-lpthread -lusb-1.0 -lsetupapi
else
LDFLAGS:=-lpthread -lusb-1.0 -ludev
OS_NAME := $(shell uname -s | tr A-Z a-z)
ifeq ($(OS_NAME),linux)
LDFLAGS:=-lpthread -lusb-1.0 -ludev
endif
ifeq ($(OS_NAME),darwin)
LDFLAGS:=-lpthread -lusb-1.0 -framework CoreFoundation -framework IOKit
CFLAGS:=-O0 -Wall -Wno-asm-operand-widths -Wno-deprecated-declarations -Wno-deprecated-non-prototype -D__MACOSX__
INCLUDES:=-I /opt/homebrew/Cellar/libusb/1.0.26/include/libusb-1.0
LIBINCLUDES:=-L /opt/homebrew/Cellar/libusb/1.0.26/lib
INCS:=$(INCLUDES) $(LIBINCLUDES)
endif
endif
minichlink : minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c
gcc -o $@ $^ $(LDFLAGS) $(CFLAGS)
gcc -o $@ $^ $(LDFLAGS) $(CFLAGS) $(INCS)
minichlink.so : minichlink.c pgm-wch-linke.c pgm-esp32s2-ch32xx.c nhc-link042.c
gcc -o $@ $^ $(LDFLAGS) $(CFLAGS) -shared -fPIC
gcc -o $@ $^ $(LDFLAGS) $(CFLAGS) $(INCS) -shared -fPIC
install_udev_rules :
cp 99-WCH-LinkE.rules /etc/udev/rules.d/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment