-
Notifications
You must be signed in to change notification settings - Fork 5
/
makefile.in
194 lines (148 loc) · 5.35 KB
/
makefile.in
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# -*- Mode: sh
all: $(APPNAME) docs $(BUILDMO)
PROJ=mp
ADD_DOCS=AUTHORS README COPYING RELEASE_NOTES \
mp_templates.sample doc/mp_function_reference.html
GRUTATXT_DOCS=doc/mp_index.html doc/mp_cookbook.html doc/mp_internals.html \
doc/mp_configuration.html doc/mp_data_model.html \
doc/mp_man.html doc/mp_interactive_dialog_boxes.html \
doc/mp_actions.html doc/mp_keycodes.html \
doc/mp_encoding.html $(APPNAME).1
MP_DOCCER_DOCS=doc/mp_api.txt
G_AND_MP_DOCS=doc/mp_api.html
OBJS=mp_core.o $(DRV_OBJS)
DIST_TARGET=/tmp/$(PROJ)-$(VERSION)
##################################################################
version:
@echo $(VERSION)
.c.o:
$(CC) $(CFLAGS) -I. `cat config.cflags` -c $<
$(MPDM)/libmpdm.a:
( cd $(MPDM); $(MAKE) )
$(MPSL)/libmpsl.a: $(MPDM)/libmpdm.a
( cd $(MPSL); $(MAKE) )
dep:
gcc -MM *.c `cat config.cflags` > makefile.depend
$(APPNAME): $(OBJS) $(MPDM)/libmpdm.a $(MPSL)/libmpsl.a
$(CCLINK) $(CFLAGS) $(OBJS) `cat config.ldflags` -o $@
mpv_kde4.o: mpv_kde4.cpp mpv_kde4.moc
$(CPP) $(CFLAGS) -I. `cat config.cflags` -c $<
mpv_kde4.moc: mpv_kde4.cpp
$(MOC) -o mpv_kde4.moc mpv_kde4.cpp
mpv_qt4.o: mpv_qt4.cpp mpv_qt4.moc
$(CPP) $(CFLAGS) -I. `cat config.cflags` -c $<
mpv_qt4.moc: mpv_qt4.cpp
$(MOC) -o mpv_qt4.moc mpv_qt4.cpp
mp_res.o: mp_res.rc
$(WINDRES) mp_res.rc mp_res.o
mp-5.exe: $(OBJS) mp_res.o $(MPDM)/libmpdm.a $(MPSL)/libmpsl.a
$(CC) $(CFLAGS) $(OBJS) mp_res.o `cat config.ldflags` -o $@
clean:
rm -f $(APPNAME) $(LIB) $(OBJS) *.o *.moc tags *.tar.gz *.exe *.zip .installer.c *.1 *.asc
(cd $(MPDM) ; make clean)
(cd $(MPSL) ; make clean)
distclean: clean
rm -f config.h config.cflags config.ldflags \
makefile.opts Makefile po/minimum-profit.pot
docsclean:
rm -f $(MP_DOCCER_DOCS) doc/*.html
realclean: distclean
(cd $(MPDM) ; make realclean)
(cd $(MPSL) ; make realclean)
realdistclean: realclean
.SUFFIXES: .html .txt .rhtml
.txt.html:
grutatxt < $< > $@
.rhtml.html:
cp $< $@
doc/mp_man.html: doc/mp_man.txt
grutatxt -dl -t "Minimum Profit Man Page" < $< > $@
doc/mp_api.txt: *.mpsl
mp_doccer *.mpsl -o doc/mp_api -f grutatxt \
-t "Minimum Profit API" \
-b "This reference documents version $(VERSION) of the MPSL API." \
-a 'Angel Ortega - angel@triptico.com'
$(APPNAME).1: doc/mp_man.txt
grutatxt -m man -t "Minimum Profit" < doc/mp_man.txt > $(APPNAME).1
docs: $(DOCS)
(cd $(MPDM); $(MAKE) docs)
(cd $(MPSL); $(MAKE) docs)
distcopy: distclean docs
mkdir -p $(DIST_TARGET) ; \
tar cf - * | (cd $(DIST_TARGET) ; tar xf -) ; \
(cd $(MPDM) ; $(MAKE) distcopy DIST_TARGET=$(DIST_TARGET)/mpdm ) ; \
(cd $(MPSL) ; $(MAKE) distcopy DIST_TARGET=$(DIST_TARGET)/mpsl )
dist: distcopy po/minimum-profit.pot build-mo
(cd /tmp ; tar czf - $(PROJ)-$(VERSION)/* ) > $(PROJ)-$(VERSION).tar.gz ; \
rm -rf $(DIST_TARGET)
midnight:
$(MAKE) distcopy DIST_TARGET=/tmp/mp-midnight
(cd /tmp ; tar czf - mp-midnight/* ) > mp-midnight.tar.gz ; \
rm -rf /tmp/mp-midnight
win32dist: mp-5.exe
mkdir -p win32
mkdir -p win32/doc
i586-mingw32msvc-strip $(APPNAME)
install $(APPNAME) win32
install mp_*.mpsl win32
(DIR=`pwd` ; cd $(MPDM) ; make installdoc DOCDIR=$$DIR/win32/doc)
(DIR=`pwd` ; cd $(MPSL) ; make installdoc DOCDIR=$$DIR/win32/doc)
install $(DOCS) win32/doc
(cd win32 ; aovwinstall mp-5 "Minimum Profit $(VERSION)" * doc/*)
i586-mingw32msvc-strip win32/installer.exe
mv win32/installer.exe mp-$(VERSION).exe
rm -rf win32
innosetup: mp-5.exe
(DIR=`pwd` ; cd $(MPDM) ; make installdoc DOCDIR=$$DIR/doc)
(DIR=`pwd` ; cd $(MPSL) ; make installdoc DOCDIR=$$DIR/doc)
iscc /O. /Fmp-$(VERSION) mp.iss
install: $(INSTALL_MSG) installdoc $(INSTALLMO)
install $(APPNAME) $(PREFIX)/bin/$(APPNAME)
./mkinstalldirs $(PREFIX)/share/$(APPNAME)
./mkinstalldirs $(PREFIX)/share/$(APPNAME)/lang
install -m 644 mp_*.mpsl $(PREFIX)/share/$(APPNAME)
install -m 644 lang/*.mpsl $(PREFIX)/share/$(APPNAME)/lang
./mkinstalldirs $(PREFIX)/share/man/man1
[ -f $(APPNAME).1 ] && install -m 644 $(APPNAME).1 $(PREFIX)/share/man/man1/$(APPNAME).1 || true
( cd $(MPSL) ; make install )
installdoc:
./mkinstalldirs $(PREFIX)/share/doc/$(APPNAME)
( cd $(MPDM); $(MAKE) installdoc )
( cd $(MPSL); $(MAKE) installdoc )
install -m 644 doc/* $(PREFIX)/share/doc/$(APPNAME)
install -m 644 $(ADD_DOCS) $(PREFIX)/share/doc/$(APPNAME)
[ -f doc/mp_index.html ] && install -m 644 doc/mp_index.html $(PREFIX)/share/doc/$(APPNAME)/index.html || true
uninstall: $(UNINSTALLMO)
rm -f $(PREFIX)/bin/$(APPNAME)
rm -rf $(PREFIX)/share/$(APPNAME)
rm -rf $(PREFIX)/share/doc/$(APPNAME)
rm -f $(PREFIX)/share/man/man1/$(APPNAME).1
rm -f $(PREFIX)/bin/mpsl
po/minimum-profit.pot:
xgettext -o $@ --language=C --keyword=L --keyword=LL mp*.c *.mpsl
update-po:
for a in po/*.po ; do \
sed -i -e '/^#/d' $$a ; \
xgettext --omit-header -j -o $$a --language=C \
--keyword=L --keyword=LL mp*.c *.mpsl ; \
done
.po.mo:
msgfmt -o $@ $<
build-mo:
for i in po/*.po ; do \
B=`basename $$i .po` ; o=po/$$B.mo ; \
if [ $$i -nt $$o -o ! -f $$o ] ; then msgfmt -o $$o $$i ; fi ; \
done
install-mo: build-mo
for a in po/*.mo ; do \
B=`basename $$a .mo` ; \
./mkinstalldirs $(PREFIX)/share/locale/$$B/LC_MESSAGES ; \
install -m 644 $$a $(PREFIX)/share/locale/$$B/LC_MESSAGES/minimum-profit.mo ; \
done
uninstall-mo:
for a in po/*.mo ; do \
B=`basename $$a .mo` ; \
rm -f $(PREFIX)/share/locale/$$B/LC_MESSAGES/minimum-profit.mo ; \
done
deb:
dpkg-buildpackage -rfakeroot -b -uc -us