Moved on_close commit handler to its own function.
[mp-5.x.git] / makefile.in
blob2ca5dfc11454b9feec0c70038f8a81bc69b551a8
1 # -*- Mode: sh
3 all: $(APPNAME) docs $(BUILDMO)
5 PROJ=mp
7 ADD_DOCS=AUTHORS README COPYING RELEASE_NOTES \
8 mp_templates.sample doc/mp_function_reference.html
9 GRUTATXT_DOCS=doc/mp_index.html doc/mp_cookbook.html doc/mp_internals.html \
10 doc/mp_configuration.html doc/mp_data_model.html \
11 doc/mp_man.html doc/mp_interactive_dialog_boxes.html \
12 doc/mp_actions.html doc/mp_keycodes.html \
13 doc/mp_encoding.html $(APPNAME).1
14 MP_DOCCER_DOCS=doc/mp_api.txt
15 G_AND_MP_DOCS=doc/mp_api.html
17 OBJS=mp_core.o $(DRV_OBJS)
19 DIST_TARGET=/tmp/$(PROJ)-$(VERSION)
21 ##################################################################
23 version:
24 @echo $(VERSION)
26 .c.o:
27 $(CC) $(CFLAGS) -I. `cat config.cflags` -c $<
29 $(MPDM)/libmpdm.a:
30 ( cd $(MPDM); $(MAKE) )
32 $(MPSL)/libmpsl.a: $(MPDM)/libmpdm.a
33 ( cd $(MPSL); $(MAKE) )
35 dep:
36 gcc -MM *.c `cat config.cflags` > makefile.depend
38 $(APPNAME): $(OBJS) $(MPDM)/libmpdm.a $(MPSL)/libmpsl.a
39 $(CCLINK) $(CFLAGS) $(OBJS) `cat config.ldflags` -o $@
41 mpv_kde4.o: mpv_kde4.cpp mpv_kde4.moc
42 $(CPP) $(CFLAGS) -I. `cat config.cflags` -c $<
44 mpv_kde4.moc: mpv_kde4.cpp
45 $(MOC) -o mpv_kde4.moc mpv_kde4.cpp
47 mpv_qt4.o: mpv_qt4.cpp mpv_qt4.moc
48 $(CPP) $(CFLAGS) -I. `cat config.cflags` -c $<
50 mpv_qt4.moc: mpv_qt4.cpp
51 $(MOC) -o mpv_qt4.moc mpv_qt4.cpp
53 mp_res.o: mp_res.rc
54 $(WINDRES) mp_res.rc mp_res.o
56 mp-5.exe: $(OBJS) mp_res.o $(MPDM)/libmpdm.a $(MPSL)/libmpsl.a
57 $(CC) $(CFLAGS) $(OBJS) mp_res.o `cat config.ldflags` -o $@
59 clean:
60 rm -f $(APPNAME) $(LIB) $(OBJS) *.o *.moc tags *.tar.gz *.exe *.zip .installer.c *.1
61 (cd $(MPDM) ; make clean)
62 (cd $(MPSL) ; make clean)
64 distclean: clean
65 rm -f config.h config.cflags config.ldflags \
66 makefile.opts Makefile po/minimum-profit.pot
68 docsclean:
69 rm -f $(MP_DOCCER_DOCS) doc/*.html
71 realclean: distclean
72 (cd $(MPDM) ; make realclean)
73 (cd $(MPSL) ; make realclean)
75 realdistclean: realclean
77 .SUFFIXES: .html .txt .rhtml
79 .txt.html:
80 grutatxt < $< > $@
82 .rhtml.html:
83 cp $< $@
85 doc/mp_man.html: doc/mp_man.txt
86 grutatxt -dl -t "Minimum Profit Man Page" < $< > $@
88 doc/mp_api.txt: *.mpsl
89 mp_doccer *.mpsl -o doc/mp_api -f grutatxt \
90 -t "Minimum Profit API" \
91 -b "This reference documents version $(VERSION) of the MPSL API." \
92 -a 'Angel Ortega - angel@triptico.com'
94 $(APPNAME).1: doc/mp_man.txt
95 grutatxt -m man -t "Minimum Profit" < doc/mp_man.txt > $(APPNAME).1
97 docs: $(DOCS)
98 (cd $(MPDM); $(MAKE) docs)
99 (cd $(MPSL); $(MAKE) docs)
101 distcopy: distclean docs
102 mkdir -p $(DIST_TARGET) ; \
103 tar cf - * | (cd $(DIST_TARGET) ; tar xf -) ; \
104 (cd $(MPDM) ; $(MAKE) distcopy DIST_TARGET=$(DIST_TARGET)/mpdm ) ; \
105 (cd $(MPSL) ; $(MAKE) distcopy DIST_TARGET=$(DIST_TARGET)/mpsl )
107 dist: distcopy po/minimum-profit.pot build-mo
108 (cd /tmp ; tar czf - $(PROJ)-$(VERSION)/* ) > $(PROJ)-$(VERSION).tar.gz ; \
109 rm -rf $(DIST_TARGET)
111 midnight:
112 $(MAKE) distcopy DIST_TARGET=/tmp/mp-midnight
113 (cd /tmp ; tar czf - mp-midnight/* ) > mp-midnight.tar.gz ; \
114 rm -rf /tmp/mp-midnight
116 win32dist: mp-5.exe
117 mkdir -p win32
118 mkdir -p win32/doc
119 i586-mingw32msvc-strip $(APPNAME)
120 install $(APPNAME) win32
121 install mp_*.mpsl win32
122 (DIR=`pwd` ; cd $(MPDM) ; make installdoc DOCDIR=$$DIR/win32/doc)
123 (DIR=`pwd` ; cd $(MPSL) ; make installdoc DOCDIR=$$DIR/win32/doc)
124 install $(DOCS) win32/doc
125 (cd win32 ; aovwinstall mp-5 "Minimum Profit $(VERSION)" * doc/*)
126 i586-mingw32msvc-strip win32/installer.exe
127 mv win32/installer.exe mp-$(VERSION).exe
128 rm -rf win32
130 innosetup: mp-5.exe
131 (DIR=`pwd` ; cd $(MPDM) ; make installdoc DOCDIR=$$DIR/doc)
132 (DIR=`pwd` ; cd $(MPSL) ; make installdoc DOCDIR=$$DIR/doc)
133 iscc /O. /Fmp-$(VERSION) mp.iss
135 install: $(INSTALL_MSG) installdoc $(INSTALLMO)
136 install $(APPNAME) $(PREFIX)/bin/$(APPNAME)
137 ./mkinstalldirs $(PREFIX)/share/$(APPNAME)
138 ./mkinstalldirs $(PREFIX)/share/$(APPNAME)/lang
139 install -m 644 mp_*.mpsl $(PREFIX)/share/$(APPNAME)
140 install -m 644 lang/*.mpsl $(PREFIX)/share/$(APPNAME)/lang
141 ./mkinstalldirs $(PREFIX)/share/man/man1
142 [ -f $(APPNAME).1 ] && install -m 644 $(APPNAME).1 $(PREFIX)/share/man/man1/$(APPNAME).1 || true
143 ( cd $(MPSL) ; [ -x mpsl ] && install mpsl $(PREFIX)/bin || true )
145 installdoc:
146 ./mkinstalldirs $(PREFIX)/share/doc/$(APPNAME)
147 ( cd $(MPDM); $(MAKE) installdoc )
148 ( cd $(MPSL); $(MAKE) installdoc )
149 install -m 644 doc/* $(PREFIX)/share/doc/$(APPNAME)
150 install -m 644 $(ADD_DOCS) $(PREFIX)/share/doc/$(APPNAME)
151 [ -f doc/mp_index.html ] && install -m 644 doc/mp_index.html $(PREFIX)/share/doc/$(APPNAME)/index.html || true
153 uninstall: $(UNINSTALLMO)
154 rm -f $(PREFIX)/bin/$(APPNAME)
155 rm -rf $(PREFIX)/share/$(APPNAME)
156 rm -rf $(PREFIX)/share/doc/$(APPNAME)
157 rm -f $(PREFIX)/share/man/man1/$(APPNAME).1
158 rm -f $(PREFIX)/bin/mpsl
160 po/minimum-profit.pot:
161 xgettext -o $@ --language=C --keyword=L --keyword=LL mp*.c *.mpsl
163 update-po:
164 for a in po/*.po ; do \
165 sed -i -e '/^#/d' $$a ; \
166 xgettext --omit-header -j -o $$a --language=C \
167 --keyword=L --keyword=LL mp*.c *.mpsl ; \
168 done
170 .po.mo:
171 msgfmt -o $@ $<
173 build-mo:
174 for i in po/*.po ; do \
175 B=`basename $$i .po` ; o=po/$$B.mo ; \
176 if [ $$i -nt $$o -o ! -f $$o ] ; then msgfmt -o $$o $$i ; fi ; \
177 done
179 install-mo: build-mo
180 for a in po/*.mo ; do \
181 B=`basename $$a .mo` ; \
182 ./mkinstalldirs $(PREFIX)/share/locale/$$B/LC_MESSAGES ; \
183 install -m 644 $$a $(PREFIX)/share/locale/$$B/LC_MESSAGES/minimum-profit.mo ; \
184 done
186 uninstall-mo:
187 for a in po/*.mo ; do \
188 B=`basename $$a .mo` ; \
189 rm -f $(PREFIX)/share/locale/$$B/LC_MESSAGES/minimum-profit.mo ; \
190 done
192 deb:
193 dpkg-buildpackage -rfakeroot -b -uc -us