File: Makefile

package info (click to toggle)
numad 0.5%2B20150602-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 604 kB
  • sloc: ansic: 8,967; sh: 235; makefile: 172
file content (66 lines) | stat: -rw-r--r-- 1,705 bytes parent folder | download | duplicates (3)
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
# 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 := $(DESTDIR)/usr
docdir := ${prefix}/share/doc

all: numad

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 ${prefix}/bin
	mkdir -p ${prefix}/share/man/man8
	install -m 0755 numad ${prefix}/bin
	install -m 0644 numad.8 ${prefix}/share/man/man8

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