diff options
Diffstat (limited to 'utils/jztool/Makefile')
-rw-r--r-- | utils/jztool/Makefile | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/utils/jztool/Makefile b/utils/jztool/Makefile new file mode 100644 index 0000000000..d1bbae578c --- /dev/null +++ b/utils/jztool/Makefile | |||
@@ -0,0 +1,47 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | |||
8 | CFLAGS += -Wall -Wextra -Iinclude -I../../tools/ucl/include -I../../lib/microtar/src | ||
9 | OUTPUT = jztool | ||
10 | |||
11 | ifdef RELEASE | ||
12 | CFLAGS += -Os -DNDEBUG | ||
13 | else | ||
14 | CFLAGS += -O0 -ggdb | ||
15 | endif | ||
16 | |||
17 | LIBSOURCES := src/buffer.c src/context.c src/device_info.c \ | ||
18 | src/identify_file.c src/ucl_unpack.c src/usb.c src/x1000.c | ||
19 | SOURCES := $(LIBSOURCES) jztool.c | ||
20 | EXTRADEPS := libucl.a libmicrotar.a | ||
21 | |||
22 | CPPDEFINES := $(shell echo foo | $(CROSS)$(CC) -dM -E -) | ||
23 | |||
24 | ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32) | ||
25 | # TODO: support Windows | ||
26 | else | ||
27 | ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) | ||
28 | # Mac, tested on x86 only -- may need to adjust paths if building on ARM. | ||
29 | # paths should work with homebrew libusb. | ||
30 | LIBUSB_CFLAGS ?= -I/usr/local/include/libusb-1.0 | ||
31 | ifdef STATIC | ||
32 | LIBUSB_LDOPTS ?= /usr/local/lib/libusb-1.0.a -framework IOKit -framework CoreFoundation | ||
33 | else | ||
34 | LIBUSB_LDOPTS ?= -L/usr/local/lib -lusb-1.0 | ||
35 | endif | ||
36 | else | ||
37 | # Linux; note for static builds you need to build a copy of libusb without | ||
38 | # udev support and specify the includes / libs manually | ||
39 | LIBUSB_CFLAGS ?= `pkg-config --cflags libusb-1.0` | ||
40 | LIBUSB_LDOPTS ?= `pkg-config --libs libusb-1.0` | ||
41 | endif | ||
42 | endif | ||
43 | |||
44 | CFLAGS += $(LIBUSB_CFLAGS) | ||
45 | LDOPTS += $(LIBUSB_LDOPTS) | ||
46 | |||
47 | include ../libtools.make | ||