1 # Project: Jigdo (Jigsaw download)
3 # |_) /| Copyright (C) 2001-2006 | richard@
4 # | \/¯| Richard Atterer | atterer.net
6 # this Makefile mostly forwards make commands to the other directories
11 exec_prefix = @exec_prefix@
18 INSTALL_EXE = @INSTALL@ -s
19 INSTALL_DATA = @INSTALL@ -m 644
20 INSTALL_SCRIPT = @INSTALL@ -m 755
23 # echo `(echo progress051.xpm;sed -n 's/^.*>\(.*\.xpm\)<.*$/\1/p' jigdo.glade)|sort|uniq`
24 icons = close.png jigdo-logo.png pause.png progress-green.png \
25 restart.png start.png stop.png
28 .PHONY: all all_msg clean distclean mostlyclean maintainer-clean \
29 dep depend doc cvsdist check install test loc deb debrpm \
30 install-jigdo-file install-jigdo-lite install-jigdo \
32 # "gfx" symlink is needed for the pixmaps to be found by jigdo
33 all doc mostlyclean dep depend: Makefile
34 -test -h gfx -o -d gfx || ln -s "$(srcdir)/gfx" gfx
39 -test -h gfx -o -d gfx || ln -s "$(srcdir)/gfx" gfx
45 rm -f mirrors.jigdo mirrors.list mirrors.txt
50 rm -f mirrors.jigdo mirrors.list mirrors.txt
51 rm -f jigdo-*.tar.gz jigdo-*.tar.bz2
53 rm -f Makefile config.h config.cache config.log config.status
54 rm -f deb/*~ deb/\#*\# deb/*.bak deb/changelog
55 rm -f scripts/*~ scripts/\#*\# scripts/*.bak
57 maintainer-clean: Makefile
58 @echo 'This command is intended for maintainers to use; it'
59 @echo 'deletes files that may need special tools to rebuild.'
63 rm -f mirrors.jigdo mirrors.list mirrors.txt
64 rm -f jigdo-*.tar.gz jigdo-*.tar.bz2
66 rm -f Makefile config.h config.cache config.log config.status
68 cd $(srcdir) && autoconf
70 install: install-po install-jigdo-file install-jigdo-lite \
71 install-jigdo-mirror @IF_GUI@ install-jigdo
73 $(INSTALL) -d $(DESTDIR)$(bindir)
74 $(INSTALL_EXE) src/jigdo-file $(DESTDIR)$(bindir)
75 $(INSTALL) -d $(DESTDIR)$(mandir)/man1
76 x="doc/jigdo-file.1"; \
77 test -f "$$x" || x="$(srcdir)/$$x"; \
78 $(INSTALL) "$$x" $(DESTDIR)$(mandir)/man1
80 $(INSTALL) -d "$(DESTDIR)$(bindir)"
81 $(INSTALL) -d "$(DESTDIR)$(datadir)/jigdo"
82 $(INSTALL_SCRIPT) "$(srcdir)/scripts/jigdo-lite" \
84 sed -e 's%"\(mirrors.jigdo"\)%"$(datadir)/jigdo/debian-\1%' \
85 <"$(srcdir)/scripts/jigdo-lite" \
86 >"$(DESTDIR)$(bindir)/jigdo-lite"
87 $(INSTALL_DATA) "$(srcdir)/scripts/debian-mirrors.jigdo" \
88 "$(DESTDIR)$(datadir)/jigdo"
89 $(INSTALL) -d $(DESTDIR)$(mandir)/man1
90 x="doc/jigdo-lite.1"; \
91 test -f "$$x" || x="$(srcdir)/$$x"; \
92 $(INSTALL) "$$x" $(DESTDIR)$(mandir)/man1
94 $(INSTALL) -d "$(DESTDIR)$(bindir)"
95 $(INSTALL_SCRIPT) "$(srcdir)/scripts/jigdo-mirror" \
97 $(INSTALL) -d $(DESTDIR)$(mandir)/man1
98 x="doc/jigdo-mirror.1"; \
99 test -f "$$x" || x="$(srcdir)/$$x"; \
100 $(INSTALL) "$$x" $(DESTDIR)$(mandir)/man1
102 $(INSTALL) -d "$(DESTDIR)$(bindir)"
103 $(INSTALL_EXE) src/jigdo "$(DESTDIR)$(bindir)"
104 $(INSTALL) -d "$(DESTDIR)$(datadir)/jigdo/pixmaps"
105 @for x in $(icons); do \
106 echo "$(INSTALL_DATA) \"$(srcdir)/gfx/$$x\"" \
107 "\"$(DESTDIR)$(datadir)/jigdo/pixmaps\""; \
108 $(INSTALL_DATA) "$(srcdir)/gfx/$$x" \
109 "$(DESTDIR)$(datadir)/jigdo/pixmaps" || exit 1; \
111 $(INSTALL) -d $(DESTDIR)$(mandir)/man1
113 test -f "$$x" || x="$(srcdir)/$$x"; \
114 $(INSTALL) "$$x" $(DESTDIR)$(mandir)/man1
115 $(INSTALL_DATA) "$(srcdir)/COPYING" \
116 "$(DESTDIR)$(datadir)/jigdo/COPYING"
118 if test -n "$(catalogs)"; then for file in $(catalogs); do \
119 lang=`echo $$file | sed -e 's/\.gmo$$//'`; \
120 dir="$(DESTDIR)$(datadir)/locale/$$lang/LC_MESSAGES"; \
121 echo "$(INSTALL) -d \"$$dir\""; \
122 $(INSTALL) -d "$$dir"; \
123 s="$(srcdir)/po/$$file"; \
124 if test -f "po/$$file"; then s="po/$$file"; fi; \
125 echo "$(INSTALL_DATA) $$s \"$$dir/$(PACKAGE).mo\""; \
126 $(INSTALL_DATA) "$$s" "$$dir/$(PACKAGE).mo" \
130 Makefile: Makefile.in configure jigdo.spec
131 sh config.status # update Makefile from Makefile.in
133 configure: configure.ac
134 cd "$(srcdir)" && autoconf
137 # allow "make CXXFLAGS=-O0" while staying compatible with non-GNU-make
138 .EXPORT_ALL_VARIABLES: ;
139 #______________________________________________________________________
141 # Nonstandard targets
145 f=`find $(srcdir)/src \( -name '*.cc' -o -name '*.[hif]h' \) -a ! -name interface.cc` \
146 && printf '%d files, %d lines of code\n' \
147 `echo $$f|wc -w` `cat $$f|wc -l`
149 # Compile and package unofficial Debian package
151 @if test "`pwd`" != "`cd '$(srcdir)' && pwd`"; then \
152 echo " * Building .deb package only possible if you are";\
153 echo " * building in the source dir, i.e. invoked the"; \
154 echo " * configure script as \`./configure'"; \
156 test -e debian || ln -s deb debian
157 dpkg-buildpackage -rfakeroot -us -uc -b
159 # Convert Debian package into RPM format
161 for deb in ../jigdo*.deb; do \
162 fakeroot alien -r "$$deb"; \
165 # Compile and create a tar.bz2 containing the tools and documentation
167 @read tmpa tmpb VERSION <"$(srcdir)/jigdo.spec"; \
168 if test -d "jigdo-bin-$$VERSION"; then \
169 echo "\`jigdo-bin-$$VERSION' exists - delete it first";\
173 cd src && $(MAKE) Y='-static' all-msg jigdo-file strip
174 cd doc && $(MAKE) all
175 jdir=jigdo-bin-`read a b v <"$(srcdir)/jigdo.spec" && echo $$v`; \
177 $(INSTALL_SCRIPT) $(srcdir)/scripts/jigdo-lite "$$jdir";\
178 $(INSTALL_SCRIPT) $(srcdir)/scripts/jigdo-mirror \
180 $(INSTALL_EXE) src/jigdo-file "$$jdir"; \
181 grep -v "^##" $(srcdir)/doc/README-bindist.txt \
183 $(INSTALL_DATA) $(srcdir)/doc/*.html "$$jdir"; \
184 $(INSTALL_DATA) $(srcdir)/doc/*.1 "$$jdir"; \
185 $(INSTALL_DATA) $(srcdir)/COPYING "$$jdir"; \
186 $(INSTALL_DATA) $(srcdir)/scripts/debian-mirrors.jigdo \
187 "$$jdir/mirrors.jigdo"; \
188 tar -cf "$$jdir.tar" "$$jdir"; \
189 bzip2 -f -9 "$$jdir.tar"; \
190 rm -rf "$$jdir" src/jigdo-file
192 debian-mirrors.jigdo: Mirrors.masterlist
193 $(AWK) -f $(srcdir)/scripts/convert-cvsmirrors.awk "$<" >"$@"
195 # Create source tarballs from CVS
197 @read tmpa tmpb VERSION <"$(srcdir)/jigdo.spec"; \
198 if test -d "jigdo-bin-$$VERSION"; then \
199 echo "\`jigdo-bin-$$VERSION' exists - delete it first";\
202 cvs -Q checkout jigdo
204 @f=`find jigdo -name '*.cc' -o -name '*.[hif]h'` \
205 && printf '%d files, %d lines of code\n' \
206 `echo $$f|wc -w` `cat $$f|wc -l`
207 @echo "To update gettext: make -C po update-pot update-po"
208 @read tmpa tmpb VERSION <"$(srcdir)/jigdo.spec"; \
209 cvstag="rel-`echo $$VERSION | sed -e 's/[^0-9a-zA-Z_-]\+/-/g'`"; \
210 printf "Tag this as \`$$cvstag' in CVS? [y/N/force] "; \
212 if test "$$REPLY" = y; then \
213 echo "cd jigdo && cvs tag $$cvstag ."; \
214 cd jigdo && cvs tag $$cvstag .; \
215 elif test "$$REPLY" = force; then \
216 echo "cd jigdo && cvs tag -F $$cvstag ."; \
217 cd jigdo && cvs tag -F $$cvstag .; \
219 cd jigdo/doc && $(MAKE) -f ../../doc/Makefile
221 cd src && $(MAKE) depend gtk/interface.cc
222 cp src/Makedeps jigdo/src
223 cp src/gtk/interface.cc src/gtk/interface.hh jigdo/src/gtk
224 cd jigdo/po && $(MAKE) -f ../../po/Makefile update-gmo
225 v=`read a b v <"$(srcdir)/jigdo.spec" && echo $$v`; \
226 mv jigdo "jigdo-$$v"; \
227 find "jigdo-$$v" -type f | sort \
228 | tar --exclude=CVS --exclude=autom4te.cache -T - -cf \
230 test -d ~/deb/my && gzip -9 -c \
231 <"jigdo-$$v.tar" >~/deb/my/"jigdo_$$v.orig.tar.gz"; \
232 bzip2 -f -9 "jigdo-$$v.tar"; \