-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
99 lines (79 loc) · 1.83 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# -*- Makefile -*-
# $Id: Makefile,v 1.1 2008-04-10 09:49:21 guni4317 Exp $
default: targets
UNAME := $(shell uname -s)
prefix =.
include $(prefix)/defines.mk
CXXINCLUDE +=-I$(prefix)/include -I/opt/local/include
ifeq ($(UNAME), Darwin)
LIBS +=-framework OpenGL -framework GLUT -lboost_thread-mt -lUnitTest++
else
LIBS +=-lglut -lGL -lboost_thread -lUnitTest++
endif
EXTRA_LIBS +=-L$(prefix)/ -Wl,-rpath,. -L/opt/local/lib
MOVE =mv
HEADER =\
include/glutwindow.hpp \
include/pixel.hpp \
include/ppmwriter.hpp \
include/color.hpp \
include/vector.hpp \
include/matrix.hpp \
include/material.hpp \
include/material_map.hpp \
include/triangle.hpp \
include/box.hpp \
include/point3d.hpp \
include/ray.hpp \
include/shape.hpp \
include/sphere.hpp \
include/tube.hpp \
include/cone.hpp \
include/scene.hpp \
include/camera.hpp \
include/light.hpp \
$(NULL)
SOURCE =\
src/glutwindow.cpp \
src/pixel.cpp \
src/ppmwriter.cpp \
src/color.cpp \
src/vector.cpp \
src/matrix.cpp \
src/material.cpp \
src/material_map.cpp \
src/main.cpp \
src/triangle.cpp \
src/box.cpp \
src/point3d.cpp \
src/ray.cpp \
src/shape.cpp \
src/sphere.cpp \
src/tube.cpp \
src/cone.cpp \
src/scene.cpp \
src/camera.cpp \
src/light.cpp \
$(NULL)
PROGRAMSOURCE =\
src/main.cpp \
$(NULL)
OBJECTS =$(SOURCE:.cpp=.o)
PROGRAMOBJECT =$(PROGRAMSOURCE:.cpp=.o)
PROGRAMS = $(PROGRAMOBJECT:.o=)
targets: $(PROGRAMS)
$(PROGRAMS): $(OBJECTS)
-$(RM) $@
$(CXX) -o $(prefix)/$@ $(LIBS) $(EXTRA_LIBS) $(LDXXFLAGS) $(OBJECTS)
$(MOVE) $(prefix)/$@ .
realclean:: clean
-$(RM) $(prefix)/$(OBJECTS)
-$(RM) $(prefix)/$(PROGRAMOBJECTS)
-$(RM) $(prefix)/$(PROGRAMS)
include $(prefix)/rules.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),realclean)
#-include $(OBJECTS:.o=.d)
endif
endif
# $Id: Makefile,v 1.1 2008-04-10 09:49:21 guni4317 Exp $