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

Change client/server to master/slave to avoid confusions

parent 12c9d3cd
SERVER_PROG = server SLAVE_PROG = slave
CLIENT_PROG = client MASTER_PROG = master
SRCDIR = ../src SRCDIR = ../src
SERVER_SRCS = server.c SLAVE_SRCS = slave.c
SERVER_SRCS += recv_packet.c SLAVE_SRCS += recv_packet.c
SERVER_SRCS += send_packet.c SLAVE_SRCS += send_packet.c
SERVER_SRCS += common.c SLAVE_SRCS += common.c
SERVER_SRCS += gpio.c SLAVE_SRCS += gpio.c
CLIENT_SRCS = client.c MASTER_SRCS = master.c
CLIENT_SRCS += recv_packet.c MASTER_SRCS += recv_packet.c
CLIENT_SRCS += send_packet.c MASTER_SRCS += send_packet.c
CLIENT_SRCS += common.c MASTER_SRCS += common.c
SERVER_OBJS = $(SERVER_SRCS:%.c=%.o) SLAVE_OBJS = $(SLAVE_SRCS:%.c=%.o)
CLIENT_OBJS = $(CLIENT_SRCS:%.c=%.o) MASTER_OBJS = $(MASTER_SRCS:%.c=%.o)
ifeq ($(DEBUG),) ifeq ($(DEBUG),)
CFLAGS = -O2 CFLAGS = -O2
...@@ -41,36 +41,36 @@ endif ...@@ -41,36 +41,36 @@ endif
vpath %.c $(SRCDIR) vpath %.c $(SRCDIR)
all: links all: links
links: bin/$(SERVER_PROG) bin/$(CLIENT_PROG) links: bin/$(SLAVE_PROG) bin/$(MASTER_PROG)
bin/$(SERVER_PROG): $(SERVER_PROG) bin/$(SLAVE_PROG): $(SLAVE_PROG)
mkdir -p bin mkdir -p bin
ln -fs $(realpath $(SERVER_PROG)) $@ ln -fs $(realpath $(SLAVE_PROG)) $@
bin/$(CLIENT_PROG): $(CLIENT_PROG) bin/$(MASTER_PROG): $(MASTER_PROG)
mkdir -p bin mkdir -p bin
ln -fs $(realpath $(CLIENT_PROG)) $@ ln -fs $(realpath $(MASTER_PROG)) $@
xdp_kern.o: xdp_kern.c 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 $^ 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 llc -march=bpf -filetype=obj -o $@ xdp_kern.ll
ifneq ($(WITH_GIT_XDP),) ifneq ($(WITH_GIT_XDP),)
$(SERVER_PROG): $(SERVER_OBJS) xdp_kern.o $(SLAVE_PROG): $(SLAVE_OBJS) xdp_kern.o
$(CC) $(LDFLAGS) $(LDIRS) $(SERVER_OBJS) $(LLIBS) -o $@ $(CC) $(LDFLAGS) $(LDIRS) $(SLAVE_OBJS) $(LLIBS) -o $@
else else
$(SERVER_PROG): $(SERVER_OBJS) $(SLAVE_PROG): $(SLAVE_OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@ $(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
endif endif
$(CLIENT_PROG): $(CLIENT_OBJS) $(MASTER_PROG): $(MASTER_OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@ $(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
-include $(subst .c,.d,$(SERVER_SRCS)) -include $(subst .c,.d,$(SLAVE_SRCS))
-include $(subst .c,.d,$(CLIENT_SRCS)) -include $(subst .c,.d,$(MASTER_SRCS))
clean: clean:
$(RM) -rf bin $(RM) -rf bin
$(RM) $(SERVER_OBJS) $(SERVER_PROG) $(subst .c,.d,$(SERVER_SRCS)) $(RM) $(SLAVE_OBJS) $(SLAVE_PROG) $(subst .c,.d,$(SLAVE_SRCS))
$(RM) $(CLIENT_OBJS) $(CLIENT_PROG) $(subst .c,.d,$(CLIENT_SRCS)) $(RM) $(MASTER_OBJS) $(MASTER_PROG) $(subst .c,.d,$(MASTER_SRCS))
.PHONY: clean all links .PHONY: clean all links
/* /*
* Real time packet sending client * Motor control master
* *
* Large portions taken from cyclictest * Large portions taken from cyclictest
* *
......
/* /*
* Real time packet receiving server * Motor control slave
* *
* Large portions taken from cyclictest * 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