summaryrefslogtreecommitdiff
path: root/test/raytracer/Makefile
blob: db359b13a1303b373d6899742577d6b27127ae92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
include ../../Makefile.config

CC=../../ccomp 
CFLAGS=-stdlib ../../runtime -dparse -dclight -dasm -fstruct-passing -fstruct-assign
LIBS=$(LIBMATH)
TIME=xtime -mintime 2.0

OBJS=memory.o gmllexer.o gmlparser.o eval.o \
  arrays.o vector.o matrix.o object.o intersect.o surface.o light.o \
  simplify.o render.o main.o

all: render

render: $(OBJS)
	$(CC) $(CFLAGS) -o render $(OBJS) $(LIBS)

clean:
	rm -f *.o *.parsed.c *.light.c *.s *.ppm render

include .depend

depend:
	gcc -MM *.c > .depend

gcc0:
	$(MAKE) clean
	$(MAKE) CC=gcc CFLAGS="-O0 -Wall"
	mv render render.gcc0
	$(MAKE) clean

gcc1:
	$(MAKE) clean
	$(MAKE) CC=gcc CFLAGS="-O1 -Wall"
	mv render render.gcc1
	$(MAKE) clean

gcc2:
	$(MAKE) clean
	$(MAKE) CC=gcc CFLAGS="-O2 -Wall"
	mv render render.gcc2
	$(MAKE) clean

gcc3:
	$(MAKE) clean
	$(MAKE) CC=gcc CFLAGS="-O3 -Wall"
	mv render render.gcc3
	$(MAKE) clean

test:
	./render < kal.gml
	@if cmp kal.ppm Results/kal.ppm; \
        then echo "raytracer: passed"; \
        else echo "raytracer: FAILED"; \
        fi

bench:
	@echo -n "raytracer: "; $(TIME) ./render < kal.gml