~ubuntu-branches/ubuntu/saucy/numactl/saucy-proposed

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Ian Wienand
  • Date: 2006-01-04 10:25:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104102527-1seu1f5eafl9iuoc
Tags: 0.9-1
* New upstream
* Most patches accepted into upstream; see upstream changelog or
  debian/patches/README in source package for history

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
CFLAGS := -g -Wall -I. -O2
 
1
# these can (and should) be overridden on the make command line for production
 
2
# use
 
3
CFLAGS :=  -g -Wall -O0
 
4
# these are used for the benchmarks in addition to the normal CFLAGS. 
 
5
# Normally no need to overwrite unless you find a new magic flag to make
 
6
# STREAM run faster.
 
7
BENCH_CFLAGS := -O2 -ffast-math -funroll-loops
 
8
# for compatibility with old releases
 
9
CFLAGS += ${OPT_CFLAGS}
 
10
override CFLAGS += -I.
2
11
 
3
 
CLEANFILES := libnuma.a numactl.o libnuma.o numactl numademo numademo.o \
 
12
CLEANFILES := numactl.o libnuma.o numactl numademo numademo.o distance.o \
4
13
              memhog libnuma.so libnuma.so.1 numamon numamon.o syscall.o bitops.o \
5
 
              memhog.o stream util.o stream_main.o stream_lib.o shm.o \
6
 
              test/pagesize test/tshared test/mynode.o test/tshared.o \
7
 
              test/tshm test/mynode test/ftok test/prefered test/randmap \
8
 
                  .depend .depend.X test/nodemap
 
14
              memhog.o util.o stream_main.o stream_lib.o shm.o stream \
 
15
              test/pagesize test/tshared test/mynode.o test/tshared.o mt.o \
 
16
              test/mynode test/ftok test/prefered test/randmap \
 
17
              .depend .depend.X test/nodemap test/distance \
 
18
                test/after test/before
9
19
 
10
 
SOURCES := bitops.c libnuma.c memhog.c numactl.c numademo.c \
11
 
        numamon.c shm.c stream_lib.c stream_main.c syscall.c util.c \
 
20
SOURCES := bitops.c libnuma.c distance.c memhog.c numactl.c numademo.c \
 
21
        numamon.c shm.c stream_lib.c stream_main.c syscall.c util.c mt.c \
12
22
        test/*.c
13
23
 
14
24
prefix := /usr
15
25
libdir := ${prefix}$(shell if [ -d /usr/lib64 ] ; then echo "/lib64" ; else echo "/lib"  ; fi)
16
26
docdir := ${prefix}/share/doc
17
27
 
18
 
all: numactl libnuma.so numademo numamon memhog stream test/tshared \
 
28
all: numactl libnuma.so numademo numamon memhog test/tshared stream \
19
29
     test/mynode test/pagesize test/ftok test/prefered test/randmap \
20
 
         test/nodemap
 
30
         test/nodemap test/distance
21
31
 
22
32
numactl: numactl.o util.o shm.o bitops.o libnuma.so
23
33
 
24
 
util.o: util.c util.h numa.h
25
 
 
26
 
shm.o: shm.h util.h bitops.h
 
34
util.o: util.c
27
35
 
28
36
memhog: util.o memhog.o libnuma.so
29
37
 
30
 
stream: util.o stream_lib.o stream_main.o libnuma.so
31
 
 
32
 
numactl.o: numactl.c numa.h numaif.h util.h
 
38
numactl.o: numactl.c
33
39
 
34
40
numademo: LDFLAGS += -lm
35
 
 
36
 
numademo: numademo.o util.o stream_lib.o libnuma.so
37
 
 
38
 
numademo.o: numa.h numademo.c libnuma.so        
 
41
# GNU make 3.80 appends BENCH_CFLAGS twice. Bug? It's harmless though.
 
42
numademo: CFLAGS += -DHAVE_STREAM_LIB -DHAVE_MT ${BENCH_CFLAGS} 
 
43
stream_lib.o: CFLAGS += ${BENCH_CFLAGS}
 
44
mt.o: CFLAGS += ${BENCH_CFLAGS} 
 
45
mt.o: mt.c
 
46
numademo: numademo.o stream_lib.o mt.o libnuma.so
 
47
 
 
48
numademo.o: numademo.c libnuma.so       
39
49
 
40
50
numamon: numamon.o
41
51
 
42
 
libnuma.so.1: libnuma.o syscall.o
 
52
stream: stream_lib.o stream_main.o  libnuma.so util.o
 
53
        ${CC} -o stream ${CFLAGS} stream_lib.o stream_main.o util.o -L. -lnuma -lm
 
54
 
 
55
stream_main.o: stream_main.c
 
56
 
 
57
libnuma.so.1: libnuma.o syscall.o distance.o
43
58
        ${CC} -shared -Wl,-soname=libnuma.so.1 -o libnuma.so.1 $^
44
59
 
45
60
libnuma.so: libnuma.so.1
47
62
 
48
63
libnuma.o : CFLAGS += -fPIC
49
64
 
 
65
distance.o : CFLAGS += -fPIC
 
66
 
50
67
syscall.o : CFLAGS += -fPIC
51
68
 
52
69
test/tshared: test/tshared.o libnuma.so
63
80
 
64
81
test/nodemap: test/nodemap.c libnuma.so
65
82
 
 
83
test/distance: test/distance.c libnuma.so
 
84
 
66
85
.PHONY: install all clean html depend
67
86
 
68
87
MANLINKS := \
72
91
no_nodes node_size node_to_cpus police_memory preferred run_on_node \
73
92
run_on_node_mask set_bind_policy  set_interleave_mask set_localalloc \
74
93
set_membind set_preferred set_strict setlocal_memory tonode_memory \
75
 
tonodemask_memory 
 
94
tonodemask_memory distance
76
95
 
77
 
MANPAGES := numa.3 numactl.8 mbind.2 set_mempolicy.2 get_mempolicy.2     
 
96
MANPAGES := numa.3 numactl.8 mbind.2 set_mempolicy.2 get_mempolicy.2 \
 
97
            numastat.8
78
98
 
79
99
install: numactl numademo.c numamon memhog libnuma.so.1 numa.h numaif.h numastat ${MANPAGES}
80
100
        cp numactl ${prefix}/bin
81
101
        cp numademo ${prefix}/bin
82
102
        cp memhog ${prefix}/bin
83
103
        cp set_mempolicy.2 ${prefix}/share/man/man2
 
104
        cp get_mempolicy.2 ${prefix}/share/man/man2
84
105
        cp mbind.2 ${prefix}/share/man/man2
85
106
        cp numactl.8 ${prefix}/share/man/man8
86
107
        cp numa.3 ${prefix}/share/man/man3
100
121
        rm -f ${CLEANFILES}
101
122
        @rm -rf html
102
123
 
 
124
distclean: clean
 
125
        rm -f .[^.]* */.[^.]*
 
126
        rm -f *~ */*~
 
127
 
103
128
html: ${HTML} 
104
129
 
105
130
html/numactl.html: numactl.8
125
150
depend: .depend
126
151
 
127
152
.depend:
128
 
        ${CC} -MM -I. ${SOURCES} > .depend.X && mv .depend.X .depend
 
153
        ${CC} -MM -DDEPS_RUN -I. ${SOURCES} > .depend.X && mv .depend.X .depend
129
154
 
130
155
include .depend
131
156