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-05-11 12:25:26 +00:00
|
|
|
src/identify_file.c src/fiiom3k.c src/usb.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-04-29 19:31:20 +00:00
|
|
|
# OSX -- /opt location is cheesy attempt to support ARM macs
|
2021-05-11 12:25:26 +00:00
|
|
|
# COMPLETELY UNTESTED, testing from someone with an actual Mac is appreciated!
|
2021-04-29 19:31:20 +00:00
|
|
|
CFLAGS += -I/usr/local/include -I/opt/homebrew/include
|
|
|
|
LDOPTS += -L/usr/local/lib -L/opt/homebrew/lib -lusb-1.0
|
2021-04-13 15:58:15 +00:00
|
|
|
else
|
|
|
|
# Linux
|
|
|
|
CFLAGS += `pkg-config --cflags libusb-1.0`
|
|
|
|
LDOPTS += `pkg-config --libs libusb-1.0`
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
include ../libtools.make
|