2018-08-02 14:56:11 +08:00
|
|
|
HAVE_LIBUDEV=1
|
|
|
|
HAVE_LIBQRTR=1
|
2018-07-03 00:18:31 +08:00
|
|
|
|
2018-07-07 03:51:47 +08:00
|
|
|
.PHONY: all
|
|
|
|
|
2018-07-11 03:35:04 +08:00
|
|
|
DIAG := diag-router
|
2018-07-07 03:51:47 +08:00
|
|
|
SEND_DATA := send_data
|
|
|
|
|
|
|
|
all: $(DIAG) $(SEND_DATA)
|
2016-11-23 09:03:39 +08:00
|
|
|
|
2019-01-17 08:39:30 +08:00
|
|
|
CFLAGS ?= -Wall -g -O2
|
2018-07-03 00:18:31 +08:00
|
|
|
ifeq ($(HAVE_LIBUDEV),1)
|
|
|
|
CFLAGS += -DHAS_LIBUDEV=1
|
|
|
|
LDFLAGS += -ludev
|
|
|
|
endif
|
2018-07-07 06:36:15 +08:00
|
|
|
ifeq ($(HAVE_LIBQRTR),1)
|
|
|
|
CFLAGS += -DHAS_LIBQRTR=1
|
|
|
|
LDFLAGS += -lqrtr
|
|
|
|
endif
|
2016-11-23 09:03:39 +08:00
|
|
|
|
2018-07-11 03:35:04 +08:00
|
|
|
SRCS := router/app_cmds.c \
|
|
|
|
router/circ_buf.c \
|
|
|
|
router/common_cmds.c \
|
|
|
|
router/diag.c \
|
|
|
|
router/diag_cntl.c \
|
|
|
|
router/dm.c \
|
|
|
|
router/hdlc.c \
|
|
|
|
router/masks.c \
|
|
|
|
router/mbuf.c \
|
|
|
|
router/peripheral.c \
|
|
|
|
router/router.c \
|
|
|
|
router/socket.c \
|
|
|
|
router/uart.c \
|
|
|
|
router/unix.c \
|
|
|
|
router/usb.c \
|
|
|
|
router/util.c \
|
|
|
|
router/watch.c
|
2018-01-07 19:51:06 +08:00
|
|
|
|
2018-07-03 00:18:31 +08:00
|
|
|
ifeq ($(HAVE_LIBUDEV),1)
|
2018-07-11 03:35:04 +08:00
|
|
|
SRCS += router/peripheral-rpmsg.c
|
2018-07-03 00:18:31 +08:00
|
|
|
endif
|
|
|
|
|
2018-07-07 06:36:15 +08:00
|
|
|
ifeq ($(HAVE_LIBQRTR),1)
|
2018-07-11 03:35:04 +08:00
|
|
|
SRCS += router/peripheral-qrtr.c
|
2018-07-07 06:36:15 +08:00
|
|
|
endif
|
|
|
|
|
2016-11-23 09:03:39 +08:00
|
|
|
OBJS := $(SRCS:.c=.o)
|
|
|
|
|
|
|
|
$(DIAG): $(OBJS)
|
2016-12-01 12:42:15 +08:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2016-11-23 09:03:39 +08:00
|
|
|
|
2018-07-11 03:35:04 +08:00
|
|
|
SEND_DATA_SRCS := tools/send_data.c
|
2018-07-07 03:51:47 +08:00
|
|
|
SEND_DATA_OBJS := $(SEND_DATA_SRCS:.c=.o)
|
|
|
|
|
|
|
|
$(SEND_DATA): $(SEND_DATA_OBJS)
|
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
install: $(DIAG) $(SEND_DATA)
|
|
|
|
install -D -m 755 $(DIAG) $(DESTDIR)$(prefix)/bin/$(DIAG)
|
|
|
|
install -D -m 755 $(SEND_DATA) $(DESTDIR)$(prefix)/bin/$(SEND_DATA)
|
2016-11-23 09:03:39 +08:00
|
|
|
|
|
|
|
clean:
|
2018-07-07 03:51:47 +08:00
|
|
|
rm -f $(DIAG) $(OBJS) $(SEND_DATA) $(SEND_DATA_OBJS)
|