-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (53 loc) · 1.82 KB
/
Makefile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
#----------------------------------------------
# Example Makefile for compiling a program that uses
# the Matrix and Vector classes
#----------------------------------------------
#
# Programmer: Donald House
# Date: March 8, 1999
#
# Copyright (C) - Donald H. House. 2005
#
CC = g++
C = cpp
H = h
CFLAGS = -g `Magick++-config --cppflags`
LFLAGS = -g `Magick++-config --ldflags`
ifeq ("$(shell uname)", "Darwin")
LDFLAGS = -framework Foundation -framework GLUT -framework OpenGL -lMagick++ -lm
else
ifeq ("$(shell uname)", "Linux")
LDFLAGS = -L /usr/lib64/ -lglut -lGL -lMagick++ -lm
endif
endif
HFILES = Matrix.${H} Vector.${H} Utility.${H} camera.${H} Color.${H} Light.${H} Collision.${H} Ray.${H} Material.${H} Sphere.${H}
OFILES = Matrix.o Vector.o Utility.o camera.o Color.o Light.o Collision.o Ray.o Material.o Sphere.o
PROJECT = raytrace
${PROJECT}: ${PROJECT}.o $(OFILES)
${CC} $(CFLAGS) -o ${PROJECT} ${PROJECT}.o $(OFILES) $(LDFLAGS)
${PROJECT}.o: ${PROJECT}.${C} $(HFILES)
${CC} $(CFLAGS) -c ${PROJECT}.${C}
Matrix.o: Matrix.${C} Matrix.${H} Vector.${H} Utility.${H}
${CC} $(CFLAGS) -c Matrix.${C}
Vector.o: Vector.${C} Vector.${H} Utility.${H}
${CC} $(CFLAGS) -c Vector.${C}
Utility.o: Utility.${C} Utility.${H}
${CC} $(CFLAGS) -c Utility.${C}
camera.o: camera.${C} camera.${H}
${CC} $(CFLAGS) -c camera.${C}
Color.o: Color.${C} Color.${H}
${CC} $(CFLAGS) -c Color.${C}
Light.o: Light.${C} Light.${H}
${CC} $(CFLAGS) -c Light.${C}
Collision.o: Collision.${C} Collision.${H}
${CC} $(CFLAGS) -c Collision.${C}
Ray.o: Ray.${C} Ray.${H}
${CC} $(CFLAGS) -c Ray.${C}
Material.o: Material.${C} Material.${H}
${CC} $(CFLAGS) -c Material.${C}
Sphere.o: Sphere.${C} Sphere.${H}
${CC} $(CFLAGS) -c Sphere.${C}
debug:
make 'DFLAGS = /usr/lib/debug/malloc.o'
clean:
rm *.o *~ ${PROJECT}