Files
qdl/Makefile
Bjorn Andersson c6200a2068 nbdkit: Don't compile in qdl.c
qdl.c, with its main method, should not be included in the nbdkit.  Add
the global qdl_debug variable to nbdkit and expose it as an nbdkit
configuration option.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-10-02 22:27:25 -07:00

34 lines
708 B
Makefile

OUT := qdl
NBDKIT := nbdkit-qdl-plugin.so
CFLAGS := -O2 -Wall -g `xml2-config --cflags` -fPIC
LDFLAGS := `xml2-config --libs` -ludev
prefix := /usr/local
COMMON_SRCS := firehose.c json.c sahara.c util.c patch.c program.c ufs.c usb.c
QDL_SRCS := qdl.c
QDL_OBJS := $(COMMON_SRCS:.c=.o) $(QDL_SRCS:.c=.o)
$(OUT): $(QDL_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
NBDKIT_SRCS := nbdkit-qdl-plugin.c
NBDKIT_OBJS := $(COMMON_SRCS:.c=.o) $(NBDKIT_SRCS:.c=.o)
$(NBDKIT): LDFLAGS += -shared
$(NBDKIT): $(NBDKIT_OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
.PHONY: lib
lib: $(NBDKIT)
.PHONY: all
all: $(OUT) $(NBDKIT)
clean:
rm -f $(OUT) $(QDL_OBJS) $(NBDKIT_OBJS)
install: $(OUT)
install -D -m 755 $< $(DESTDIR)$(prefix)/bin/$<