Makefile.mk
1.51 KB
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
LIBSTEM = Random
LIBRARY = lib$(LIBSTEM).a
all: $(LIBRARY)
INCLUDEPATH = ../include
MODULES = Random
REQUIREDHEADERS = Random.hpp RandomCanonical.hpp RandomPower2.hpp \
RandomEngine.hpp RandomAlgorithm.hpp RandomMixer.hpp RandomSeed.hpp \
RandomType.hpp
OTHERHEADERS = NormalDistribution.hpp ExponentialDistribution.hpp \
LeadingZeros.hpp ExponentialProb.hpp RandomSelect.hpp \
ExactExponential.hpp ExactNormal.hpp ExactPower.hpp RandomNumber.hpp
HEADERS = $(REQUIREDHEADERS) $(OTHERHEADERS)
SOURCES = $(addsuffix .cpp,$(MODULES))
OBJECTS = $(addsuffix .o,$(MODULES))
CC = g++ -g
CXXFLAGS = -g -Wall -Wextra -O3 \
-funroll-loops -finline-functions -fomit-frame-pointer
CPPFLAGS = -I$(INCLUDEPATH) $(DEFINES)
LDFLAGS = $(LIBRARY)
$(LIBRARY): $(OBJECTS)
$(AR) r $@ $?
VPATH = ../include/RandomLib
INSTALL = install -b
PREFIX = /usr/local
install: $(LIBRARY)
test -f $(PREFIX)/lib || mkdir -p $(PREFIX)/lib
$(INSTALL) -m 644 $^ $(PREFIX)/lib
clean:
rm -f *.o $(LIBRARY)
TAGS: $(HEADERS) $(SOURCES)
etags $^
HAVE_SSE2 = \
$(shell grep "flags\b.*\bsse2\b" /proc/cpuinfo 2> /dev/null | \
tail -1 | wc -l | tr -d ' \t')
HAVE_ALTIVEC = \
$(shell arch 2> /dev/null | grep ppc | tail -1 | wc -l | tr -d ' \t')
ifeq ($(HAVE_SSE2),1)
CXXFLAGS += -msse2
# Include
# #define HAVE_SSE2 1
# in ../include/RandomLib/Config.h
endif
ifeq ($(HAVE_ALTIVEC),1)
CXXFLAGS += -maltivec
# Include
# #define HAVE_ALTIVEC 1
# in ../include/RandomLib/Config.h
endif
Random.o: Config.h $(REQUIREDHEADERS)
.PHONY: all install clean