X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Frasterize;a=blobdiff_plain;f=Makefile;h=024bb482ab202cc43adbc2ad0baff74d6fb4ac6d;hp=b3e118f57f6faadb104bbb4f92ee613f6944f09b;hb=db44364a1fabda81d3f6c842c4e4778eac6495a5;hpb=0f2508a4f227523a6b7e54798487af19d06a6ce9 diff --git a/Makefile b/Makefile index b3e118f..024bb48 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,33 @@ -PROJECT = project1 -SRCS = main.c common.c list.c pixmap.c scene.c tri.c +PROJECT = project2 +IUSE = CLIPPING DEPTH_TEST SMOOTH_COLOR \ + EXTRA_INLINE NDEBUG RASTER_STATS RENDER_PROGRESS RENDER_TIMER + + +# BACKFACE_CULLING prevent drawing triangles that are not facing forward +# CLIPPING turn on clipping (you really always want this) +# DEPTH_TEST enable the z buffer for depth testing +# EXPORT_BMP save scene as bitmap (enabled by default) +# EXPORT_PPM save scene as a PPM file (also enabled by default) +# EXTRA_INLINE allow the compiler to inline even more aggressively +# LIGHTING turn the lights on (experimental) +# NDEBUG disable assertions and other nonessential checks +# PRE_NORMALS[=n] pre-compute mesh normals at scene-loading time; +# set to 1 for per-face normals, 2 for averaged normals, +# or 3 to also enable caching the computed normals +# RASTER_STATS print triangle count and optimization savings at the end +# RENDER_PROGRESS print progress while drawing the scene +# RENDER_TIMER add a timer to see how long the renderer takes +# SMOOTH_COLOR interpolate colors smoothly between triangle vertices VIEWER = feh CC = gcc -CFLAGS = -std=c99 -O0 -ggdb -CPPFLAGS= -MMD -DDEBUG +CFLAGS = -std=c99 -O2 -g -pg +CPPFLAGS= -MMD $(IUSE:%=-D%) LDLIBS = -lm +SRCS = main.c common.c list.c raster.c rbtree.c scene.c OBJS = $(SRCS:%.c=%.o) DEPS = $(OBJS:%.o=%.d) @@ -21,7 +40,10 @@ clean: rm -f $(PROJECT) $(OBJS) $(DEPS) distclean: clean - rm -f scene.ppm scene.bmp + rm -f tags gmon.out scene.ppm scene.bmp + +dist: + git archive $(PROJECT) --prefix=$(PROJECT)/ --output=$(PROJECT).zip run: $(PROJECT) ./$< && $(VIEWER) scene.ppm @@ -30,4 +52,7 @@ debug: $(PROJECT) gdb ./$< -include $(DEPS) +$(OBJS): Makefile + +.PHONY: all clean distclean run debug