From 9129b7ff505f7b296462dcd9e027c892a9c75c52 Mon Sep 17 00:00:00 2001 From: Kyle K Date: Fri, 1 Jul 2011 19:37:08 -0500 Subject: Makefile: touch up the makefiles The mingw32 for sdl gets fancy templates and automatic dependency generation. --- glut/Makefile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'glut/Makefile') 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 -- cgit v1.2.3