Commit a03e6d00 authored by Joanne Hugé's avatar Joanne Hugé

Change client/server to master/slave to avoid confusions

parent 12c9d3cd
SERVER_PROG = server
CLIENT_PROG = client
SLAVE_PROG = slave
MASTER_PROG = master
SRCDIR = ../src
SERVER_SRCS = server.c
SERVER_SRCS += recv_packet.c
SERVER_SRCS += send_packet.c
SERVER_SRCS += common.c
SERVER_SRCS += gpio.c
SLAVE_SRCS = slave.c
SLAVE_SRCS += recv_packet.c
SLAVE_SRCS += send_packet.c
SLAVE_SRCS += common.c
SLAVE_SRCS += gpio.c
CLIENT_SRCS = client.c
CLIENT_SRCS += recv_packet.c
CLIENT_SRCS += send_packet.c
CLIENT_SRCS += common.c
MASTER_SRCS = master.c
MASTER_SRCS += recv_packet.c
MASTER_SRCS += send_packet.c
MASTER_SRCS += common.c
SERVER_OBJS = $(SERVER_SRCS:%.c=%.o)
CLIENT_OBJS = $(CLIENT_SRCS:%.c=%.o)
SLAVE_OBJS = $(SLAVE_SRCS:%.c=%.o)
MASTER_OBJS = $(MASTER_SRCS:%.c=%.o)
ifeq ($(DEBUG),)
CFLAGS = -O2
......@@ -41,36 +41,36 @@ endif
vpath %.c $(SRCDIR)
all: links
links: bin/$(SERVER_PROG) bin/$(CLIENT_PROG)
bin/$(SERVER_PROG): $(SERVER_PROG)
links: bin/$(SLAVE_PROG) bin/$(MASTER_PROG)
bin/$(SLAVE_PROG): $(SLAVE_PROG)
mkdir -p bin
ln -fs $(realpath $(SERVER_PROG)) $@
bin/$(CLIENT_PROG): $(CLIENT_PROG)
ln -fs $(realpath $(SLAVE_PROG)) $@
bin/$(MASTER_PROG): $(MASTER_PROG)
mkdir -p bin
ln -fs $(realpath $(CLIENT_PROG)) $@
ln -fs $(realpath $(MASTER_PROG)) $@
xdp_kern.o: xdp_kern.c
clang $(IFLAGS) -isystem /usr/include/arm-linux-gnueabihf -S -target bpf -D __BPF_TRACING__ -Wall -O2 -emit-llvm -c -g -o xdp_kern.ll $^
llc -march=bpf -filetype=obj -o $@ xdp_kern.ll
ifneq ($(WITH_GIT_XDP),)
$(SERVER_PROG): $(SERVER_OBJS) xdp_kern.o
$(CC) $(LDFLAGS) $(LDIRS) $(SERVER_OBJS) $(LLIBS) -o $@
$(SLAVE_PROG): $(SLAVE_OBJS) xdp_kern.o
$(CC) $(LDFLAGS) $(LDIRS) $(SLAVE_OBJS) $(LLIBS) -o $@
else
$(SERVER_PROG): $(SERVER_OBJS)
$(SLAVE_PROG): $(SLAVE_OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
endif
$(CLIENT_PROG): $(CLIENT_OBJS)
$(MASTER_PROG): $(MASTER_OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
-include $(subst .c,.d,$(SERVER_SRCS))
-include $(subst .c,.d,$(CLIENT_SRCS))
-include $(subst .c,.d,$(SLAVE_SRCS))
-include $(subst .c,.d,$(MASTER_SRCS))
clean:
$(RM) -rf bin
$(RM) $(SERVER_OBJS) $(SERVER_PROG) $(subst .c,.d,$(SERVER_SRCS))
$(RM) $(CLIENT_OBJS) $(CLIENT_PROG) $(subst .c,.d,$(CLIENT_SRCS))
$(RM) $(SLAVE_OBJS) $(SLAVE_PROG) $(subst .c,.d,$(SLAVE_SRCS))
$(RM) $(MASTER_OBJS) $(MASTER_PROG) $(subst .c,.d,$(MASTER_SRCS))
.PHONY: clean all links
/*
* Real time packet sending client
* Motor control master
*
* Large portions taken from cyclictest
*
......
/*
* Real time packet receiving server
* Motor control slave
*
* Large portions taken from cyclictest
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment