From c876d3bbefe0dc00c27ca0c12d29da5874946962 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 15 Dec 2021 21:04:28 +0100 Subject: rbutil: Merge rbutil with utils folder. rbutil uses several components from the utils folder, and can be considered part of utils too. Having it in a separate folder is an arbitrary split that doesn't help anymore these days, so merge them. This also allows other utils to easily use libtools.make without the need to navigate to a different folder. Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21 --- utils/mks5lboot/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 utils/mks5lboot/Makefile (limited to 'utils/mks5lboot/Makefile') diff --git a/utils/mks5lboot/Makefile b/utils/mks5lboot/Makefile new file mode 100644 index 0000000000..72ea521d5f --- /dev/null +++ b/utils/mks5lboot/Makefile @@ -0,0 +1,43 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +CC := gcc +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 := + +CPPDEFINES := $(shell echo foo | $(CROSS)$(CC) -dM -E -) + +ifeq ($(findstring WIN32,$(CPPDEFINES)),WIN32) +LDOPTS += -lsetupapi +# optional libusb support (needed for WinUSB and libusbK drivers) +ifeq ($(findstring MINGW,$(CPPDEFINES)),MINGW) +ifeq ($(USE_LIBUSBAPI),1) +CFLAGS += -DUSE_LIBUSBAPI +LDOPTS += -Wl,-Bstatic -lusb-1.0 +endif +endif +else +ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) +LDOPTS += -L/usr/local/lib -framework IOKit -framework CoreFoundation +else # Linux +CFLAGS += -DUSE_LIBUSBAPI +LDOPTS += -lusb-1.0 +endif +endif + +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 -- cgit v1.2.3