Commit 055487d6 authored by Joanne Hugé's avatar Joanne Hugé

Make global makefile

parent 3b0c4fa5
*.o
*.ll
*.d
latency-measure/build/main
latency-measure/build/main
clockres/build/clockres
clockres/build/clockres_arm
packet-exchange/build/server
packet-exchange/build/client
gettime/build/gettime
software-pulse/build/software-pulse
test-ptp/build/server
test-ptp/build/client
bin
src/clockres/build/*
!src/clockres/build/Makefile
src/gettime/build/*
!src/gettime/build/Makefile
src/packet-exchange/build/*
!src/packet-exchange/build/Makefile
src/software-pulse/build/*
!src/software-pulse/build/Makefile
src/test-ptp/build/*
!src/test-ptp/build/Makefile
src/xdp-testing/build/*
!src/xdp-testing/build/Makefile
scripts/packet-histogram_stop-options*
SUBPROGS=packet-exchange clockres gettime software-pulse
CLEANPROGS=$(SUBPROGS:%=clean%)
all: $(SUBPROGS)
$(SUBPROGS):
cd src/$@/build && $(MAKE)
cd ../../..
mkdir -p bin
ln -fs $(realpath src)/$@/build/bin/* bin/
clean: $(CLEANPROGS)
$(RM) -rf bin
$(CLEANPROGS):
cd src/$(@:clean%=%)/build && $(MAKE) clean
......@@ -20,12 +20,19 @@ LDFLAGS = -pthread
vpath %.c $(SRCDIR)
all: links
links: bin/$(PROG)
bin/$(PROG): $(PROG)
mkdir -p bin
ln -fs $(realpath $(PROG)) bin/$(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
-include $(subst .c,.d,$(SRCS))
clean:
$(RM) -rf bin
$(RM) $(OBJS) $(PROG) $(subst .c,.d,$(SRCS))
.PHONY: clean
.PHONY: clean all links
......@@ -19,12 +19,19 @@ LLIBS = -pthread
vpath %.c $(SRCDIR)
all: links
links: bin/$(PROG)
bin/$(PROG): $(PROG)
mkdir -p bin
ln -fs $(realpath $(PROG)) bin/$(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
-include $(subst .c,.d,$(SRCS))
clean:
$(RM) -rf bin
$(RM) $(OBJS) $(PROG) $(subst .c,.d,$(SRCS))
.PHONY: clean
.PHONY: clean all links
......@@ -42,6 +42,15 @@ endif
vpath %.c $(SRCDIR)
all: links
links: bin/$(SERVER_PROG) bin/$(CLIENT_PROG)
bin/$(SERVER_PROG): $(SERVER_PROG)
mkdir -p bin
ln -fs $(realpath $(SERVER_PROG)) $@
bin/$(CLIENT_PROG): $(CLIENT_PROG)
mkdir -p bin
ln -fs $(realpath $(CLIENT_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
......@@ -62,7 +71,8 @@ $(CLIENT_PROG): $(CLIENT_OBJS)
-include $(subst .c,.d,$(CLIENT_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))
.PHONY: clean
.PHONY: clean all links
......@@ -22,12 +22,19 @@ LLIBS = -pthread
vpath %.c $(SRCDIR)
all: links
links: bin/$(PROG)
bin/$(PROG): $(PROG)
mkdir -p bin
ln -fs $(realpath $(PROG)) bin/$(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) $(LDIRS) $^ $(LLIBS) -o $@
-include $(subst .c,.d,$(SRCS))
clean:
$(RM) -rf bin
$(RM) $(OBJS) $(PROG) $(subst .c,.d,$(SRCS))
.PHONY: clean
.PHONY: clean all links
......@@ -42,6 +42,15 @@ endif
vpath %.c $(SRCDIR)
all: links
links: bin/$(SERVER_PROG) bin/$(CLIENT_PROG)
bin/$(SERVER_PROG): $(SERVER_PROG)
mkdir -p bin
ln -fs $(realpath $(SERVER_PROG)) $@
bin/$(CLIENT_PROG): $(CLIENT_PROG)
mkdir -p bin
ln -fs $(realpath $(CLIENT_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
......@@ -62,7 +71,8 @@ $(CLIENT_PROG): $(CLIENT_OBJS)
-include $(subst .c,.d,$(CLIENT_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))
.PHONY: clean
.PHONY: clean all links
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