aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2b615b5..4aa6c3a 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ LITMUS_KERNEL ?= ../litmus-rt
19# Internal configuration. 19# Internal configuration.
20 20
21# compiler flags 21# compiler flags
22flags-debug = -O2 -Wall -Werror -g -Wdeclaration-after-statement 22flags-debug = -O2 -Wall -Wno-error -g -Wdeclaration-after-statement
23flags-api = -D_XOPEN_SOURCE=600 -D_GNU_SOURCE 23flags-api = -D_XOPEN_SOURCE=600 -D_GNU_SOURCE
24 24
25# architecture-specific flags 25# architecture-specific flags
@@ -37,6 +37,7 @@ include-${ARCH} ?= ${ARCH}
37 37
38# by default we use the local version 38# by default we use the local version
39LIBLITMUS ?= . 39LIBLITMUS ?= .
40CUDA ?= /usr/local/cuda/lib64
40 41
41# where to find header files 42# where to find header files
42headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include 43headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include
@@ -50,6 +51,7 @@ LDFLAGS = ${flags-${ARCH}}
50 51
51# how to link against liblitmus 52# how to link against liblitmus
52liblitmus-flags = -L${LIBLITMUS} -llitmus 53liblitmus-flags = -L${LIBLITMUS} -llitmus
54cuda-flags = -L${CUDA} -lcudart
53 55
54# Force gcc instead of cc, but let the user specify a more specific version if 56# Force gcc instead of cc, but let the user specify a more specific version if
55# desired. 57# desired.
@@ -65,7 +67,7 @@ AR := ${CROSS_COMPILE}${AR}
65# ############################################################################## 67# ##############################################################################
66# Targets 68# Targets
67 69
68all = lib ${rt-apps} 70all = lib gpu-rtspin ${rt-apps}
69rt-apps = cycles base_task rt_launch rtspin release_ts measure_syscall \ 71rt-apps = cycles base_task rt_launch rtspin release_ts measure_syscall \
70 base_mt_task uncache runtests resctl 72 base_mt_task uncache runtests resctl
71 73
@@ -115,6 +117,7 @@ doc:
115 117
116clean: 118clean:
117 rm -f ${rt-apps} 119 rm -f ${rt-apps}
120 rm -f gpu-rtspin
118 rm -f *.o *.d *.a test_catalog.inc 121 rm -f *.o *.d *.a test_catalog.inc
119 rm -f ${imported-headers} 122 rm -f ${imported-headers}
120 rm -f inc/config.makefile 123 rm -f inc/config.makefile
@@ -218,6 +221,8 @@ obj-rt_launch = rt_launch.o common.o
218obj-rtspin = rtspin.o common.o 221obj-rtspin = rtspin.o common.o
219lib-rtspin = -lrt 222lib-rtspin = -lrt
220 223
224obj-gpu-rtspin = gpu-rtspin.o common.o cuda_loop.o
225
221obj-uncache = uncache.o 226obj-uncache = uncache.o
222lib-uncache = -lrt 227lib-uncache = -lrt
223 228
@@ -228,6 +233,8 @@ lib-measure_syscall = -lm
228 233
229obj-resctl = resctl.o 234obj-resctl = resctl.o
230 235
236cuda_loop.o: bin/cuda_loop.cu
237 nvcc -c bin/cuda_loop.cu
231 238
232# ############################################################################## 239# ##############################################################################
233# Build everything that depends on liblitmus. 240# Build everything that depends on liblitmus.
@@ -236,6 +243,9 @@ obj-resctl = resctl.o
236${rt-apps}: $${obj-$$@} liblitmus.a 243${rt-apps}: $${obj-$$@} liblitmus.a
237 $(CC) -o $@ $(LDFLAGS) ${ldf-$@} $(filter-out liblitmus.a,$+) $(LOADLIBS) $(LDLIBS) ${liblitmus-flags} ${lib-$@} 244 $(CC) -o $@ $(LDFLAGS) ${ldf-$@} $(filter-out liblitmus.a,$+) $(LOADLIBS) $(LDLIBS) ${liblitmus-flags} ${lib-$@}
238 245
246gpu-rtspin: ${obj-gpu-rtspin} liblitmus.a
247 g++ -o gpu-rtspin $(LDFLAGS) ${ldf-gpu-rtspin} $(filter-out liblitmus.a,$+) $(LOADLIBS) $(LDLIBS) ${liblitmus-flags} ${lib-gpu-rtspin} ${cuda-flags}
248
239# ############################################################################## 249# ##############################################################################
240# Dependency resolution. 250# Dependency resolution.
241 251