stop appending repeat keys to the input buffer
[retroray] / GNUmakefile
1 -include config.mk
2
3 # --- default build option values ---
4 build_gfx ?= gl
5 build_opt ?= false
6 build_dbg ?= true
7 # -----------------------------------
8
9 gawsrc_gl = src/gaw/gaw_gl.c
10 gawsrc_sw = src/gaw/gaw_sw.c src/gaw/gawswtnl.c src/gaw/polyfill.c src/gaw/polyclip.c
11
12 gawdef_gl = -DGFX_GL
13 gawdef_sw = -DGFX_SW
14
15 src = $(wildcard src/*.c) $(wildcard src/modern/*.c) $(gawsrc_$(build_gfx))
16 obj = $(src:.c=.o)
17 dep = $(src:.c=.d)
18 bin = retroray
19
20 warn = -pedantic -Wall
21 dbg = -g
22 #opt = -O3
23 def = -DMINIGLUT_USE_LIBC $(gawdef_$(build_gfx))
24 inc = -Isrc -Isrc/modern -Ilibs -Ilibs/imago/src -Ilibs/treestor/include -Ilibs/drawtext
25 libs = libs/unix/imago.a libs/unix/treestor.a libs/unix/drawtext.a
26
27 CFLAGS = $(warn) $(dbg) $(opt) $(inc) $(def) $(cflags_$(rend)) -MMD
28 LDFLAGS = $(ldsys_pre) $(libs) $(ldsys)
29
30 sys := $(shell uname -s | sed 's/MINGW.*/mingw/')
31 ifeq ($(sys), mingw)
32         bin = game.exe
33
34         ldsys = -lopengl32 -lglu32 -lgdi32 -lwinmm
35         ldsys_pre = -static-libgcc -lmingw32 -mconsole
36 else
37         ldsys = -lGL -lGLU -lX11 -lm
38 endif
39
40 $(bin): $(obj) libs
41         $(CC) -o $@ $(obj) $(LDFLAGS)
42
43 -include $(dep)
44
45 .c.o:
46         $(CC) $(CFLAGS) -c $< -o $@
47
48 .PHONY: clean
49 clean:
50         rm -f $(obj) $(bin)
51
52 .PHONY: cleandep
53 cleandep:
54         rm -f $(dep)
55
56 .PHONY: libs
57 libs:
58         $(MAKE) -C libs
59
60 .PHONY: clean-libs
61 clean-libs:
62         $(MAKE) -C libs clean
63
64 .PHONY: data
65 data:
66         tools/procdata
67
68 .PHONY: crosswin
69 crosswin:
70         $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw
71
72 .PHONY: crosswin-clean
73 crosswin-clean:
74         $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw clean
75
76 .PHONY: crosswin-cleandep
77 crosswin-cleandep:
78         $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw cleandep