1 src = $(wildcard src/*.c)
6 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
8 CFLAGS = -pedantic -Wall -g -DNOLOAD
9 LDFLAGS = $(LDFLAGS_$(sys)) -lm
11 LDFLAGS_Linux = -lGL -lGLU -lglut
12 LDFLAGS_mingw = -lmingw32 -mconsole -lfreeglut_static -lopengl32 -lglu32 -lgdi32 -lwinmm
15 obj = $(src:.c=.w32.o)
17 CFLAGS += -DFREEGLUT_STATIC
21 $(CC) -o $@ $(obj) $(LDFLAGS)
26 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
36 # --- cross-compile rules for win32 ---
38 $(CC) -o $@ $(CFLAGS) -c $<
42 $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw
46 $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw clean