diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..aa59792 --- /dev/null +++ b/Makefile | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | CC = gcc | ||
| 2 | # -fPIC is needed in all cases, as we may be linked into another shared library | ||
| 3 | CFLAGS = -fPIC | ||
| 4 | LDFLAGS = -lcuda -I/usr/local/cuda/include | ||
| 5 | |||
| 6 | .PHONY: clean tests | ||
| 7 | |||
| 8 | libsmctrl.so: libsmctrl.c libsmctrl.h | ||
| 9 | $(CC) $< -shared -o $@ $(CFLAGS) $(LDFLAGS) | ||
| 10 | |||
| 11 | libsmctrl.a: libsmctrl.c libsmctrl.h | ||
| 12 | $(CC) $< -c -o libsmctrl.o $(CFLAGS) $(LDFLAGS) | ||
| 13 | ar rcs $@ libsmctrl.o | ||
| 14 | |||
| 15 | libsmctrl_test_gpc_info: libsmctrl_test_gpc_info.c | ||
| 16 | $(CC) $< -o $@ -L. -lsmctrl $(LDFLAGS) | ||
| 17 | |||
| 18 | tests: libsmctrl_test_gpc_info | ||
| 19 | |||
| 20 | clean: | ||
| 21 | rm -f libsmctrl.so libsmctrl.a | ||
