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 +++++++++++++++--------- glut/mingw32 | 24 ------------------------ 2 files changed, 15 insertions(+), 33 deletions(-) delete mode 100644 glut/mingw32 (limited to 'glut') 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 diff --git a/glut/mingw32 b/glut/mingw32 deleted file mode 100644 index c6bbc65..0000000 --- a/glut/mingw32 +++ /dev/null @@ -1,24 +0,0 @@ -PROG = pyramid -OBJS = $(PROG).o math3d.o -CC = gcc -DBGFLAGS = -g -O0 -ifdef DEBUG - CFLAGS = $(DBGFLAGS) -Wall -std=c99 -else - CFLAGS = -Wall -std=c99 -O2 -march=native -mtune=native -endif -LDFLAGS = -lglew32 -lopengl32 -lglu32 -lm -lfreeglut - -$(PROG): $(OBJS) - $(CC) -o $(PROG) $(OBJS) $(LDFLAGS) - -$(PROG).o: $(PROG).c math3d.h - $(CC) -c $(CFLAGS) $(PROG).c - -math3d.o: math3d.c math3d.h - $(CC) -c $(CFLAGS) math3d.c - -.PHONY: clean - -clean: - rm -f *.o ./$(PROG).exe -- cgit v1.2.3