-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (60 loc) · 1.42 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
# -*- 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
else
LIBS +=-lglut -lGL -lboost_thread
endif
EXTRA_LIBS +=-L$(prefix)/ -Wl,-rpath,. -L/opt/local/lib
MOVE =mv
HEADER =\
include/glutwindow.hpp \
include/pixel.hpp \
include/ppmwriter.hpp \
include/rgb.hpp \
include/vector.hpp \
include/point.hpp \
include/matrix.hpp \
include/sphere.hpp \
include/ray.hpp \
include/camera.hpp \
$(NULL)
SOURCE =\
src/glutwindow.cpp \
src/pixel.cpp \
src/ppmwriter.cpp \
src/rgb.cpp \
src/point.cpp \
src/vector.cpp \
src/matrix.cpp \
src/camera.cpp \
src/sphere.cpp \
src/main.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 $