summaryrefslogtreecommitdiffstats
path: root/glut/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'glut/Makefile')
-rw-r--r--glut/Makefile24
1 files changed, 15 insertions, 9 deletions
diff --git a/glut/Makefile b/glut/Makefile
index fabc6e0..6378bff 100644
--- a/glut/Makefile
+++ b/glut/Makefile
@@ -1,24 +1,30 @@
PROG = pyramid
OBJS = $(PROG).o math3d.o
CC = gcc
+CFLAGS = -Wall -std=c99
DBGFLAGS = -g -O0
+LDFLAGS = -lm
ifdef DEBUG
- CFLAGS = $(DBGFLAGS) -Wall -std=c99
+ CFLAGS += $(DBGFLAGS)
else
- CFLAGS = -Wall -std=c99 -O2 -march=native -mtune=native
+ CFLAGS += -O2 -march=native -mtune=native
+endif
+ifdef MINGW
+ LDFLAGS += -lglew32 -lopengl32 -lglu32 -lfreeglut
+else
+ LDFLAGS += -lGLEW -lGL -lGLU -lglut
endif
-LDFLAGS = -lGLEW -lGL -lGLU -lm -lglut
$(PROG): $(OBJS)
- $(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
-$(PROG).o: $(PROG).c math3d.h
- $(CC) -c $(CFLAGS) $(PROG).c
+$(PROG).o: %.o: %.c math3d.h
+ $(CC) -c $(CFLAGS) $<
-math3d.o: math3d.c math3d.h
- $(CC) -c $(CFLAGS) math3d.c
+math3d.o: %.o: %.c %.h
+ $(CC) -c $(CFLAGS) $<
.PHONY: clean
clean:
- rm -f *.o ./$(PROG)
+ rm -f *.o ./$(PROG) ./$(PROG).exe