-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
77 lines (58 loc) · 2.06 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
# these can (and should) be overridden on the make command line for production
CFLAGS := -std=gnu99
# these are used for the benchmarks in addition to the normal CFLAGS.
# Normally no need to overwrite unless you find a new magic flag to make
# STREAM run faster.
BENCH_CFLAGS := -O3 -ffast-math -funroll-loops
# for compatibility with old releases
CFLAGS += ${OPT_CFLAGS}
override CFLAGS += -I.
# find out if compiler supports __thread
THREAD_SUPPORT := $(shell if $(CC) $(CFLAGS) threadtest.c -o threadtest \
>/dev/null 2>/dev/null ; then echo "yes" ; else echo "no"; fi)
ifeq ($(THREAD_SUPPORT),no)
override CFLAGS += -D__thread=""
endif
# find out if compiler supports -ftree-vectorize
THREAD_SUPPORT := $(shell touch empty.c ; if $(CC) $(CFLAGS) -c -ftree-vectorize empty.c -o empty.o \
>/dev/null 2>/dev/null ; then echo "yes" ; else echo "no"; fi)
ifeq ($(THREAD_SUPPORT),yes)
BENCH_CFLAGS += -ftree-vectorize
endif
CLEANFILES := numad.o numad .depend .depend.X empty.c empty.o
SOURCES := numad.c
prefix := /usr
docdir := ${prefix}/share/doc
all: numad
cgroups:
apt-get install cgroup-lite
LDLIBS := -lpthread -lrt -lm
numad: numad.o
AR ?= ar
RANLIB ?= ranlib
.PHONY: install all clean html depend
# BB_FIXME MANPAGES := numa.3 numactl.8 numastat.8 migratepages.8 migspeed.8
install: numad
mkdir -p $(DESTDIR)/etc/default
mkdir -p $(DESTDIR)/etc/logrotate.d
mkdir -p $(DESTDIR)/etc/init.d
mkdir -p $(DESTDIR)${prefix}/bin
mkdir -p $(DESTDIR)${prefix}/share/man/man8
install -m 0755 numad $(DESTDIR)${prefix}/bin
install -m 0644 numad.8 $(DESTDIR)${prefix}/share/man/man8
install -m 0644 numad.conf $(DESTDIR)/etc/default/numad
install -m 0755 numad.init $(DESTDIR)/etc/init.d/numad
install -m 0644 numad.logrotate $(DESTDIR)/etc/logrotate.d/numad
update-rc.d numad defaults
service numad restart
clean:
rm -f ${CLEANFILES}
@rm -rf html
distclean: clean
rm -f .[^.]* */.[^.]*
rm -f *~ */*~ *.orig */*.orig */*.rej *.rej
depend: .depend
.depend:
${CC} -MM -DDEPS_RUN -I. ${SOURCES} > .depend.X && mv .depend.X .depend
include .depend
Makefile: .depend