summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 49dc440179263fba38bba5d8363ec361cc118233 (plain)
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
#########################
# Configure project     
#########################
PROGRAM=mqtc
INCLUDE=


#########################
# Configure build      
#########################

COMPILER=gcc
#
#  optimize   enable all  include
#  level 3    warnings	  paths     see note 
#         \    |           |         /
CC_FLAGS=-O3 -Wall $(INCLUDE) #-ffast-math 
LD_FLAGS=-lm		
#	  /		
#      math	 
#
#
# NOTE on -ffast-math
#
# First, breaks strict IEEE compliance, e.g. allows re-ordering of 
# instructions to a mathematical equivalent, which may not be IEEE
# floating-point equivalent. 
#
# Second, disables setting errno after single-instruction math functions, 
# avoiding a write to a thread-local variable (can produce 100% speedup on
# certain architectures). 
#
# Third, assumes finite math only, meaning no checks for NaN (or 0) are 
# made where they would normally be. It is assumed these values will never 
# appear. 
#
# Fourth, enables reciprocal approximations for division and reciprocal 
# square root.
#
# Fifth, disables signed zero (even if the compile target supports it) 
# and rounding math, which enables optimizations e.g. constant folding.
#
# Sixth, generates code assuming no hardware interrupts occur in math
# due to signal()/trap(). If these cannot be disabled on the compile
# target and consequently occur, they will not be handled.
#

#########################
# Configure files 
#########################

SOURCES=main.c			\
	input.c			\
	logs.c			\
	util/list.c		\
	util/math.c 		\
	prng/mersenne.c		\
	prng/prng.c		\
	prng/coin.c		\
	prng/dice.c		\
	prng/alias.c		\
	tree/pnode.c		\
	tree/ptree.c		\
	tree/print.c		

STATICS=
OBJECTS=$(SOURCES:.c=.o)


#########################
# Configure rules 
#########################
all: $(SOURCES)
	$(COMPILER) $(CC_FLAGS) $(SOURCES) $(STATICS) -o $(PROGRAM) $(LD_FLAGS)

clean:
	rm -f $(OBJECTS) $(PROGRAM) gmon.out