-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
48 lines (33 loc) · 940 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Copyright (c) Microsoft Corporation.
## Licensed under the MIT License.
TARGET=inspector-topo
OBJECTS=inspector-topo.o Options.o Endpoint.o Loopback.o probe_latency.o LoopbackFlow.o probe_gpu_bandwidth.o
# Uncomment to enable verbose debug logging
###DEBUG_LOG=-DDEBUG_LOG
NVCC=nvcc
CXXFLAGS+=-std=c++14 -g -MMD -O3 $(DEBUG_LOG)
# Use nvcc for linking. I replaced -pthread with
# -Xcompiler="-pthread" to get it to work, but I'm not really using
# pthreads so it's probably unnecessary.
LD=nvcc
LDFLAGS+= -L/usr/local/lib \
-Xcompiler="-pthread" \
-lnuma \
-libverbs
$(TARGET): $(OBJECTS)
$(LD) -o $@ $^ $(LDFLAGS)
%.o: %.cpp Makefile
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o: %.cu Makefile
$(NVCC) $(CXXFLAGS) -c -o $@ $<
install:: $(TARGET)
sudo cp $(TARGET) /usr/local/bin/$(TARGET)
clean::
rm -f $(TARGET) $(OBJECTS) *.o
#
# automatic dependence stuff
#
realclean:: clean
rm -rf *.d
deps:: $(OBJECTS)
-include *.d