diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -19,7 +19,7 @@ LITMUS_KERNEL ?= ../litmus-rt | |||
19 | # Internal configuration. | 19 | # Internal configuration. |
20 | 20 | ||
21 | # compiler flags | 21 | # compiler flags |
22 | flags-debug = -O2 -Wall -Werror -g -Wdeclaration-after-statement | 22 | flags-debug = -O2 -Wall -Wno-error -g -Wdeclaration-after-statement |
23 | flags-api = -D_XOPEN_SOURCE=600 -D_GNU_SOURCE | 23 | flags-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 |
39 | LIBLITMUS ?= . | 39 | LIBLITMUS ?= . |
40 | CUDA ?= /usr/local/cuda/lib64 | ||
40 | 41 | ||
41 | # where to find header files | 42 | # where to find header files |
42 | headers = -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/${include-${ARCH}}/include | 43 | headers = -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 |
52 | liblitmus-flags = -L${LIBLITMUS} -llitmus | 53 | liblitmus-flags = -L${LIBLITMUS} -llitmus |
54 | cuda-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 | ||
68 | all = lib ${rt-apps} | 70 | all = lib gpu-rtspin ${rt-apps} |
69 | rt-apps = cycles base_task rt_launch rtspin release_ts measure_syscall \ | 71 | rt-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 | ||
116 | clean: | 118 | clean: |
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 | |||
218 | obj-rtspin = rtspin.o common.o | 221 | obj-rtspin = rtspin.o common.o |
219 | lib-rtspin = -lrt | 222 | lib-rtspin = -lrt |
220 | 223 | ||
224 | obj-gpu-rtspin = gpu-rtspin.o common.o cuda_loop.o | ||
225 | |||
221 | obj-uncache = uncache.o | 226 | obj-uncache = uncache.o |
222 | lib-uncache = -lrt | 227 | lib-uncache = -lrt |
223 | 228 | ||
@@ -228,6 +233,8 @@ lib-measure_syscall = -lm | |||
228 | 233 | ||
229 | obj-resctl = resctl.o | 234 | obj-resctl = resctl.o |
230 | 235 | ||
236 | cuda_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 | ||
246 | gpu-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 | ||