hide the cursor in fullscreen
[censuslogo] / Makefile
1 src = $(wildcard src/*.c)
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
4 bin = censuslogo
5
6 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
7
8 CFLAGS = -pedantic -Wall -g -DNOLOAD
9 LDFLAGS = $(LDFLAGS_$(sys)) -lm
10
11 LDFLAGS_Linux = -lGL -lGLU -lglut
12 LDFLAGS_mingw = -lmingw32 -mconsole -lfreeglut_static -lopengl32 -lglu32 -lgdi32 -lwinmm
13
14 ifeq ($(sys), mingw)
15         obj = $(src:.c=.w32.o)
16         bin = censuslogo.exe
17         CFLAGS += -DFREEGLUT_STATIC
18 endif
19
20 $(bin): $(obj)
21         $(CC) -o $@ $(obj) $(LDFLAGS)
22
23 -include $(dep)
24
25 %.d: %.c
26         @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
27
28 .PHONY: clean
29 clean:
30         rm -f $(obj) $(bin)
31
32 .PHONY: cleandep
33 cleandep:
34         rm -f $(dep)
35
36 # --- cross-compile rules for win32 ---
37 %.w32.o: %.c
38         $(CC) -o $@ $(CFLAGS) -c $<
39
40 .PHONY: cross
41 cross:
42         $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw
43
44 .PHONY: cross-clean
45 cross-clean:
46         $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw clean