forked from chaos/slurm-spank-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (69 loc) · 1.99 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
PACKAGE ?= slurm-spank-plugins
sysconfdir ?= /etc/slurm/
LIBNAME ?= lib$(shell uname -m | grep -q x86_64 && echo 64)
LIBDIR ?= /usr/$(LIBNAME)
BINDIR ?= /usr/bin
SBINDIR ?= /sbin
LIBEXECDIR ?= /usr/libexec
export LIBNAME LIBDIR BINDIR SBINDIR LIBEXECDIR PACKAGE
CFLAGS = -Wall -ggdb
PLUGINS = \
renice.so \
system-safe.so \
iotrace.so \
tmpdir.so \
auto-affinity.so \
mpibind.so \
pty.so \
addr-no-randomize.so \
preserve-env.so \
private-mount.so \
setsched.so
LIBRARIES = \
system-safe-preload.so \
SUBDIRS = \
use-env \
overcommit-memory
ifeq ($(BUILD_CPUSET), 1)
SUBDIRS += cpuset
endif
ifeq ($(WITH_LUA), 1)
SUBDIRS += lua
endif
all: $(PLUGINS) $(LIBRARIES) subdirs
.SUFFIXES: .c .o .so
.c.o:
$(CC) $(CFLAGS) -o $@ -fPIC -c $<
.o.so:
$(CC) -shared -o $*.so $< $(LIBS)
subdirs:
@for d in $(SUBDIRS); do make -C $$d; done
system-safe-preload.so : system-safe-preload.o
$(CC) -shared -o $*.so $< -ldl
auto-affinity.so : auto-affinity.o lib/split.o lib/list.o lib/fd.o
$(CC) -shared -o $*.so auto-affinity.o lib/split.o lib/list.o -lslurm
mpibind.so : mpibind.o lib/split.o lib/list.o lib/fd.o
$(CC) -shared -o $*.so mpibind.o lib/split.o lib/list.o -lslurm -lhwloc
preserve-env.so : preserve-env.o lib/list.o
$(CC) -shared -o $*.so preserve-env.o lib/list.o
private-mount.so : private-mount.o lib/list.o lib/split.o
$(CC) -shared -o $*.so private-mount.o lib/list.o lib/split.o
pty.so : pty.o
$(CC) -shared -o $*.so $< -lutil
clean: subdirs-clean
rm -f *.so *.o lib/*.o
install:
@mkdir -p --mode=0755 $(DESTDIR)$(LIBDIR)/slurm
@for p in $(PLUGINS); do \
echo "Installing $$p in $(LIBDIR)/slurm"; \
install -m0755 $$p $(DESTDIR)$(LIBDIR)/slurm; \
done
@for f in $(LIBRARIES); do \
echo "Installing $$f in $(LIBDIR)"; \
install -m0755 $$f $(DESTDIR)$(LIBDIR); \
done
@for d in $(SUBDIRS); do \
make -C $$d DESTDIR=$(DESTDIR) install; \
done
subdirs-clean:
@for d in $(SUBDIRS); do make -C $$d clean; done