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