2021-04-13 15:58:15 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
|
2021-05-11 12:25:26 +00:00
|
|
|
CFLAGS += -Wall -Wextra -Iinclude -I../../tools/ucl/include -I../../lib/microtar/src
|
2021-04-13 15:58:15 +00:00
|
|
|
OUTPUT = jztool
|
|
|
|
|
|
|
|
ifdef RELEASE
|
|
|
|
CFLAGS += -Os -DNDEBUG
|
|
|
|
else
|
|
|
|
CFLAGS += -O0 -ggdb
|
|
|
|
endif
|
|
|
|
|
|
|
|
LIBSOURCES := src/buffer.c src/context.c src/device_info.c \
|
2021-07-17 18:35:09 +00:00
|
|
|
src/identify_file.c src/ucl_unpack.c src/usb.c src/x1000.c
|
2021-04-13 15:58:15 +00:00
|
|
|
SOURCES := $(LIBSOURCES) jztool.c
|
2021-05-11 12:25:26 +00:00
|
|
|
EXTRADEPS := libucl.a libmicrotar.a
|
2021-04-13 15:58:15 +00:00
|
|
|
|
|
|
|
CPPDEFINES := $(shell echo foo | $(CROSS)$(CC) -dM -E -)
|
|
|
|
|
|
|
|
ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32)
|
|
|
|
# TODO: support Windows
|
|
|
|
else
|
|
|
|
ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
|
2021-06-05 21:36:24 +00:00
|
|
|
# Mac, tested on x86 only -- may need to adjust paths if building on ARM.
|
|
|
|
# paths should work with homebrew libusb.
|
|
|
|
LIBUSB_CFLAGS ?= -I/usr/local/include/libusb-1.0
|
|
|
|
ifdef STATIC
|
|
|
|
LIBUSB_LDOPTS ?= /usr/local/lib/libusb-1.0.a -framework IOKit -framework CoreFoundation
|
2021-04-13 15:58:15 +00:00
|
|
|
else
|
2021-06-05 21:36:24 +00:00
|
|
|
LIBUSB_LDOPTS ?= -L/usr/local/lib -lusb-1.0
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
# Linux; note for static builds you need to build a copy of libusb without
|
|
|
|
# udev support and specify the includes / libs manually
|
|
|
|
LIBUSB_CFLAGS ?= `pkg-config --cflags libusb-1.0`
|
|
|
|
LIBUSB_LDOPTS ?= `pkg-config --libs libusb-1.0`
|
2021-04-13 15:58:15 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-06-05 21:36:24 +00:00
|
|
|
CFLAGS += $(LIBUSB_CFLAGS)
|
|
|
|
LDOPTS += $(LIBUSB_LDOPTS)
|
|
|
|
|
2021-04-13 15:58:15 +00:00
|
|
|
include ../libtools.make
|