diff options
author | Kyle K <kylek389@gmail.com> | 2011-07-01 19:37:08 -0500 |
---|---|---|
committer | Kamil Kaminski <kamilkss@gmail.com> | 2011-07-01 19:37:08 -0500 |
commit | 9129b7ff505f7b296462dcd9e027c892a9c75c52 (patch) | |
tree | 1e63277bd3925c43bd17a8441d5e8fdc45ffb0ef /glut | |
parent | 34609d64dd1298b77351267ff9763b53de8eecf9 (diff) | |
download | GLPyramid-9129b7ff505f7b296462dcd9e027c892a9c75c52.tar.gz GLPyramid-9129b7ff505f7b296462dcd9e027c892a9c75c52.tar.bz2 GLPyramid-9129b7ff505f7b296462dcd9e027c892a9c75c52.zip |
Makefile: touch up the makefiles
The mingw32 for sdl gets fancy templates and automatic
dependency generation.
Diffstat (limited to 'glut')
-rw-r--r-- | glut/Makefile | 24 | ||||
-rw-r--r-- | glut/mingw32 | 24 |
2 files changed, 15 insertions, 33 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 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 |