feat: C控制程序对接KCP
This commit is contained in:
34
ros-control-c/Makefile
Normal file
34
ros-control-c/Makefile
Normal file
@@ -0,0 +1,34 @@
|
||||
CC = gcc
|
||||
CFLAGS = -std=c11 -Wall -Wextra -O2 -pthread -D_GNU_SOURCE -I../include -I../third_party/cjson -I../third_party/kcp -I./common
|
||||
LDFLAGS = -pthread -lm
|
||||
|
||||
OMNI_SRCS = \
|
||||
../src/omni_common.c \
|
||||
../src/protocol.c \
|
||||
../src/latencylog.c \
|
||||
../src/kcp_packet_debug.c \
|
||||
../src/kcp_session_stats.c \
|
||||
../src/linux_timestamping.c \
|
||||
../src/transport_kcp.c \
|
||||
../src/peer_kcp_client.c \
|
||||
../third_party/cjson/cJSON.c \
|
||||
../third_party/kcp/ikcp.c
|
||||
|
||||
BUILDDIR = build
|
||||
|
||||
TARGETS = $(BUILDDIR)/keyboard_controller $(BUILDDIR)/gamepad_controller
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
$(BUILDDIR)/keyboard_controller: remote/keyboard_controller.c common/protocol.h common/teleop_transport.h common/teleop_transport.c $(OMNI_SRCS)
|
||||
@mkdir -p $(BUILDDIR)
|
||||
$(CC) $(CFLAGS) -o $@ remote/keyboard_controller.c common/teleop_transport.c $(OMNI_SRCS) $(LDFLAGS)
|
||||
|
||||
$(BUILDDIR)/gamepad_controller: remote/gamepad_controller.c common/protocol.h common/teleop_transport.h common/teleop_transport.c $(OMNI_SRCS)
|
||||
@mkdir -p $(BUILDDIR)
|
||||
$(CC) $(CFLAGS) -o $@ remote/gamepad_controller.c common/teleop_transport.c $(OMNI_SRCS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)
|
||||
Reference in New Issue
Block a user