]> git.decadent.org.uk Git - videolink.git/blob - Makefile
Replaced auto_temp_file with temp_file, which handles creation as well as deletion.
[videolink.git] / Makefile
1 prefix := /usr/local
2
3 webdvd_lib_dir := $(prefix)/lib/webdvd
4
5 moz_include_dir := \
6     $(shell pkg-config --variable=prefix mozilla-gtkmozembed)/include/mozilla
7 moz_lib_dir := \
8     $(shell pkg-config --variable=prefix mozilla-gtkmozembed)/lib/mozilla
9
10 CFLAGS := -Wall
11 CPPFLAGS := -D_REENTRANT
12 # Non-virtual destructors are fine in XPCOM interface classes since
13 # instances are only ever called by the Release function which is virtual.
14 CXXFLAGS := -Wall -Wno-non-virtual-dtor
15 LDFLAGS := -lpthread $(shell pkg-config --libs gtkmm-2.0 mozilla-gtkmozembed) \
16            -Wl,-rpath -Wl,$(moz_lib_dir)
17
18 ifdef NDEBUG
19     CPPFLAGS += -DNDEBUG
20 else
21     CFLAGS += -g
22     CXXFLAGS += -g
23     LDFLAGS += -g
24 endif
25
26 cxxsources := \
27     auto_proc.cpp browserwidget.cpp childiterator.cpp framebuffer.cpp \
28     linkiterator.cpp pixbufs.cpp stylesheets.cpp webdvd.cpp xpcom_support.cpp
29 csources := jquant2.c
30
31 webdvd : $(cxxsources:.cpp=.o) $(csources:.c=.o)
32         $(CXX) $(LDFLAGS) -o $@ $^
33
34 clean :
35         rm -f webdvd *.d *.o *~ .\#* *.orig *.rej svn-commit*.tmp *.dvdauthor *.png *.vob *.spumux
36
37 distclean : clean
38         rm -rf .svn
39
40 install :
41         mkdir -p -m 755 $(prefix)/bin $(prefix)/lib/webdvd
42         install -m 755 -s webdvd $(prefix)/bin
43         install -m 644 webdvd.css $(prefix)/lib/webdvd
44
45 .PHONY : clean distclean install
46
47 browserwidget.% : CPPFLAGS += -DMOZ_LIB_DIR='"$(moz_lib_dir)"'
48
49 webdvd.% : CPPFLAGS += -DWEBDVD_LIB_DIR='"$(webdvd_lib_dir)"'
50
51 browserwidget.% pixbufs.% webdvd.% \
52     : CPPFLAGS += $(shell pkg-config --cflags gtkmm-2.0)
53
54 browserwidget.% childiterator.o linkiterator.% stylesheets.% webdvd.% \
55 xpcom_support.%                                                       \
56     : CPPFLAGS += $(shell pkg-config --cflags mozilla-gtkmozembed)
57
58 # These dig a bit deeper into Mozilla
59 linkiterator.% stylesheets.% webdvd.%                                        \
60     : CPPFLAGS += $(addprefix -I$(moz_include_dir)/,                         \
61                     content docshell dom gfx layout necko webshell widget)
62
63 %.d : %.cpp
64         $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM -MF $@ $<
65
66 %.d : %.c
67         $(CC) $(CFLAGS) $(CPPFLAGS) -MM -MF $@ $<
68
69 ifneq ($(MAKECMDGOALS),clean)
70     include $(cxxsources:.cpp=.d) $(csources:.c=.d)
71 endif
72
73 # Temporary rule for testing output files.
74
75 %.vob : %_back.png %.spumux %_links.png
76         pngtopnm $*_back.png                                   \
77         | ppmtoy4m -v0 -n 1 -F 25:1 -A 59:54 -I p -S 420_mpeg2 \
78         | mpeg2enc -v0 -f 8 -a 2 -o /dev/stdout                \
79         | mplex -v0 -f 8 -o /dev/stdout /dev/stdin             \
80         | spumux -v0 -m dvd $*.spumux > $@