Arithmetic exception flag and a plethora of tests.
[xonotic/gmqcc.git] / include.mk
1 # default directories and paths
2 DESTDIR :=
3 PREFIX  := /usr/local
4 BINDIR  := $(PREFIX)/bin
5 DATADIR := $(PREFIX)/share
6 MANDIR  := $(DATADIR)/man
7
8 # compiler
9 CC      ?= clang
10
11 # linker flags and optional additional libraries if required
12 LDFLAGS +=
13 LIBS    += -lm
14
15 #common objects
16 COMMON   = ansi.o util.o hash.o stat.o fs.o opts.o conout.o
17
18 #optional flags
19 OPTIONAL_CFLAGS  :=
20 OPTIONAL_LDFLAGS :=
21
22 #objects
23 OBJ_C = $(COMMON) main.o lexer.o parser.o code.o ast.o ir.o ftepp.o utf8.o correct.o fold.o intrin.o
24 OBJ_P = $(COMMON) pak.o
25 OBJ_T = $(COMMON) test.o
26 OBJ_X = $(COMMON) exec.o
27
28 #gource flags
29 GOURCEFLAGS =                 \
30     --date-format "%d %B, %Y" \
31     --seconds-per-day 0.01    \
32     --auto-skip-seconds 1     \
33     --title "GMQCC"           \
34     --key                     \
35     --camera-mode overview    \
36     --highlight-all-users     \
37     --file-idle-time 0        \
38     --hide progress,mouse     \
39     --stop-at-end             \
40     --max-files 99999999999   \
41     --max-file-lag 0.000001   \
42     --bloom-multiplier 1.3    \
43     --logo doc/html/gmqcc.png \
44     -1280x720
45
46 #ffmpeg flags for gource
47 FFMPEGFLAGS=                  \
48     -y                        \
49     -r 60                     \
50     -f image2pipe             \
51     -vcodec ppm               \
52     -i -                      \
53     -vcodec libx264           \
54     -preset ultrafast         \
55     -crf 1                    \
56     -threads 0                \
57     -bf 0
58
59 #splint flags
60 SPLINTFLAGS =                 \
61     -preproc                  \
62     -redef                    \
63     -noeffect                 \
64     -nullderef                \
65     -usedef                   \
66     -type                     \
67     -mustfreeonly             \
68     -nullstate                \
69     -varuse                   \
70     -mustfreefresh            \
71     -compdestroy              \
72     -compmempass              \
73     -nullpass                 \
74     -onlytrans                \
75     -predboolint              \
76     -boolops                  \
77     -incondefs                \
78     -macroredef               \
79     -retvalint                \
80     -nullret                  \
81     -predboolothers           \
82     -globstate                \
83     -dependenttrans           \
84     -branchstate              \
85     -compdef                  \
86     -temptrans                \
87     -usereleased              \
88     -warnposix                \
89     +charindex                \
90     -kepttrans                \
91     -unqualifiedtrans         \
92     +matchanyintegral         \
93     +voidabstract             \
94     -nullassign               \
95     -unrecog                  \
96     -casebreak                \
97     -retvalbool               \
98     -retvalother              \
99     -mayaliasunique           \
100     -realcompare              \
101     -observertrans            \
102     -abstract                 \
103     -statictrans              \
104     -castfcnptr
105
106 #always the right rule
107 default: all
108
109 #uninstall rule
110 uninstall:
111         rm -f $(DESTDIR)$(BINDIR)/gmqcc
112         rm -f $(DESTDIR)$(BINDIR)/qcvm
113         rm -f $(DESTDIR)$(BINDIR)/gmqpak
114         rm -f $(DESTDIR)$(MANDIR)/man1/doc/gmqcc.1
115         rm -f $(DESTDIR)$(MANDIR)/man1/doc/qcvm.1
116         rm -f $(DESTDIR)$(MANDIR)/man1/doc/gmqpak.1
117
118 #style rule
119 STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \)
120
121 style:
122         find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
123         find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';'
124         find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/    /g' '{}' ';'
125
126 splint:
127         @splint $(SPLINTFLAGS) *.c *.h
128
129 gource:
130         @gource $(GOURCEFLAGS)
131
132 gource-record:
133         @gource $(GOURCEFLAGS) -o - | ffmpeg $(FFMPEGFLAGS) gource.mp4