2016-02-04 22:05:17 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2017-05-04 08:52:03 +00:00
|
|
|
CC := gcc
|
2016-02-04 22:05:17 +00:00
|
|
|
CFLAGS += -Wall -Wextra
|
|
|
|
|
|
|
|
OUTPUT = mks5lboot
|
|
|
|
|
|
|
|
# inputs for lib
|
|
|
|
LIBSOURCES := dualboot.c mkdfu.c ipoddfu.c
|
|
|
|
# inputs for binary only
|
|
|
|
SOURCES := $(LIBSOURCES) main.c
|
|
|
|
# dependencies for binary
|
|
|
|
EXTRADEPS :=
|
|
|
|
|
2017-05-04 08:52:03 +00:00
|
|
|
CPPDEFINES := $(shell echo foo | $(CROSS)$(CC) -dM -E -)
|
|
|
|
|
|
|
|
ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32)
|
2016-02-04 22:05:17 +00:00
|
|
|
LDOPTS += -lsetupapi
|
2017-05-04 08:52:03 +00:00
|
|
|
# optional libusb support (needed for WinUSB and libusbK drivers)
|
|
|
|
ifeq ($(findstring MINGW,$(CPPDEFINES)),MINGW)
|
|
|
|
ifeq ($(USE_LIBUSBAPI),1)
|
|
|
|
CFLAGS += -DUSE_LIBUSBAPI
|
2016-02-04 22:05:17 +00:00
|
|
|
LDOPTS += -Wl,-Bstatic -lusb-1.0
|
|
|
|
endif
|
2017-05-04 08:52:03 +00:00
|
|
|
endif
|
2016-02-04 22:05:17 +00:00
|
|
|
else
|
2017-05-04 08:52:03 +00:00
|
|
|
ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE)
|
|
|
|
LDOPTS += -L/usr/local/lib -framework IOKit -framework CoreFoundation
|
|
|
|
else # Linux
|
|
|
|
CFLAGS += -DUSE_LIBUSBAPI
|
2016-02-04 22:05:17 +00:00
|
|
|
LDOPTS += -lusb-1.0
|
|
|
|
endif
|
2017-05-04 08:52:03 +00:00
|
|
|
endif
|
2016-02-04 22:05:17 +00:00
|
|
|
|
|
|
|
include ../libtools.make
|
|
|
|
|
|
|
|
# explicit dependencies on dualboot.{c,h} and mks5lboot.h
|
|
|
|
$(OBJDIR)mks5lboot.o: dualboot.h dualboot.c mks5lboot.h
|
|
|
|
$(OBJDIR)main.o: dualboot.h dualboot.c main.c mks5lboot.h
|