2011-10-21 02:21:43 +00:00
|
|
|
# make ... for both libusb and libsg
|
|
|
|
#
|
|
|
|
# make CONFIG_USE_LIBSG=0 ...
|
|
|
|
# for just libusb
|
|
|
|
#
|
2011-10-07 20:17:48 +00:00
|
|
|
|
|
|
|
PRG := st-util
|
|
|
|
OBJS = gdb-remote.o gdb-server.o
|
|
|
|
|
|
|
|
CFLAGS+=-g -Wall -Werror -std=gnu99 -I../src
|
2011-10-21 02:21:43 +00:00
|
|
|
CFLAGS+=-DCONFIG_USE_LIBUSB=1
|
|
|
|
LDFLAGS=-lusb-1.0 -L.. -lstlink
|
2011-10-07 20:17:48 +00:00
|
|
|
|
2011-10-21 02:21:43 +00:00
|
|
|
ifeq ($(CONFIG_USE_LIBSG),)
|
|
|
|
CONFIG_USE_LIBSG=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_USE_LIBSG),0)
|
|
|
|
CFLAGS+=-DCONFIG_USE_LIBSG=1
|
|
|
|
LDFLAGS+=-lsgutils2
|
|
|
|
endif
|
2011-10-07 20:17:48 +00:00
|
|
|
|
|
|
|
all: $(PRG)
|
|
|
|
|
|
|
|
$(PRG): $(OBJS)
|
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJS)
|
|
|
|
rm -rf $(PRG)
|
|
|
|
|
|
|
|
.PHONY: clean all
|