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