8 CFLAGS = -pedantic -Wall -g
10 isx86 ?= $(shell uname -m | sed 's/x86_64/x86/; s/i.86/x86/')
12 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
16 alib = libminiglut-w32.a
19 LDFLAGS = -mconsole -lopengl32 -lgdi32 -lwinmm
20 else ifeq ($(sys)-$(isx86), Linux-x86)
23 # for other UNIX or non-x86 where sys_ and trig functions are not
24 # implemented, just use libc
25 CFLAGS += -DMINIGLUT_USE_LIBC
26 LDFLAGS = -lX11 -lGL -lm
32 $(bin): $(otest) $(alib)
33 $(CC) -o $@ $(otest) $(alib) $(LDFLAGS)
39 $(CC) -o $@ $(CFLAGS) -c $<
43 rm -f $(alib) $(olib) $(otest) $(bin)
47 mkdir -p $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
48 cp miniglut.h $(DESTDIR)$(PREFIX)/include/miniglut.h
49 cp $(alib) $(DESTDIR)$(PREFIX)/lib/libminiglut.a
53 rm -f $(DESTDIR)$(PREFIX)/include/miniglut.h
54 rm -f $(DESTDIR)$(PREFIX)/lib/libminiglut.a
58 $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw
62 $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw clean