-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
52 lines (38 loc) · 1.41 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
# to add audio:
# 1. you need to install some packages. on my machine this worked:
# sudo apt-get install phonon-backend-gstreamer libphonon-dev
# 2. run 'make fresh audio=y' and use audio=y every time you run make
# 3. see if ./earth works
# 4. if you get error about .mid files, more packages needed. I used:
# sudo apt-get install ubuntu-restricted-extras vlc-plugin-fluidsynth
# (use tab and space to navigate the weird dialogs)
# or just don't use .mid files
CXX = compile
# if needed, install from http://bits.usc.edu/cs103/compile/ or use g++ or clang++
MOCQT4 = moc-qt4
# tries later to check if it's the course VM, and changes CXX to 'compile'
EXAMPLES = pulse bounce earth polygon iterpoints htree nestedcircles
all: draw.o $(EXAMPLES)
clean:
rm -f draw.o polygon.png bull $(EXAMPLES)
fresh: clean all
INCL = -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui
OFLAGS = $(INCL) -Wall -Wno-unreachable-code -Wno-return-type
FLAGS = -g -Wall -lQtCore -lQtGui
ifdef audio
OFLAGS += -DDRAW_UNMUTE -I/usr/include/phonon
FLAGS += -lphonon
endif
ifdef stub
FLAGS =
endif
draw.o: draw.cpp draw.h
$(MOCQT4) draw.cpp | $(CXX) $(OFLAGS) -c -x c++ - -include draw.cpp -o draw.o
%: %.cpp draw.o draw.h
$(CXX) [email protected] draw.o $(FLAGS) -o $@
# prepare a zip that people not using git can use
zip:
rm -f draw.zip
zip -r draw.zip *.cpp draw.h Makefile media README
stub:
$(CXX) -c drawstub.cpp -o draw.o