X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gdbserver%2FMakefile;h=bd5c73dbc9107f0be46c32533a604001d4d29362;hb=08d4d37532361731d024eb24c9e70aee03df6fab;hp=a8d1b90aa3b35dda5ba88637e1b65ddb51a9c798;hpb=9bc72d4519e63fb1cf657a6c93008eaa8989fd01;p=fw%2Fstlink diff --git a/gdbserver/Makefile b/gdbserver/Makefile index a8d1b90..bd5c73d 100644 --- a/gdbserver/Makefile +++ b/gdbserver/Makefile @@ -1,28 +1,16 @@ -# make ... for both libusb and libsg -# -# make CONFIG_USE_LIBSG=0 ... -# for just libusb -# - PRG := st-util OBJS = gdb-remote.o gdb-server.o CFLAGS+=-g -Wall -Werror -std=gnu99 -I../src -CFLAGS+=-DCONFIG_USE_LIBUSB=1 -LDFLAGS=-lusb-1.0 -L.. -lstlink - -ifeq ($(CONFIG_USE_LIBSG),) -CONFIG_USE_LIBSG=1 -endif +LDFLAGS=-L.. -lstlink -ifneq ($(CONFIG_USE_LIBSG),0) -CFLAGS+=-DCONFIG_USE_LIBSG=1 -LDFLAGS+=-lsgutils2 -endif +# libusb location +LDFLAGS+=`pkg-config --libs libusb-1.0` +CFLAGS+=`pkg-config --cflags libusb-1.0` all: $(PRG) -$(PRG): $(OBJS) +$(PRG): $(OBJS) ../libstlink.a $(CC) -o $@ $^ $(LDFLAGS) clean: