2005-12-29 04:49:57 +01:00
|
|
|
VERSION ?= 0.10
|
2005-06-25 16:05:49 +02:00
|
|
|
|
|
|
|
GAJIM_AP = 0 # do we build Autopackage?
|
2004-11-25 20:27:09 +01:00
|
|
|
|
2005-04-25 09:56:44 +02:00
|
|
|
MODULES = src src/common po
|
2005-06-19 00:45:58 +02:00
|
|
|
PREFIX = /usr/local
|
2006-04-13 21:32:22 +02:00
|
|
|
PYTHON = python
|
2005-07-07 20:13:43 +02:00
|
|
|
DESTDIR =
|
2005-09-05 23:38:18 +02:00
|
|
|
OPTFLAGS =
|
|
|
|
export OPTFLAGS
|
2005-06-15 20:04:33 +02:00
|
|
|
LIBDIR = /lib
|
2005-09-05 21:42:43 +02:00
|
|
|
export LIBDIR
|
2005-06-25 16:05:49 +02:00
|
|
|
MANDIR = $(DESTDIR)$(PREFIX)/share/man
|
2005-03-08 11:43:25 +01:00
|
|
|
|
2005-10-17 12:01:06 +02:00
|
|
|
FIND = find . \( -name '*.glade' -o -name '*.py' -o -name '*.xpm' -o -name '*.gif' -o -name '*.png' -o -name '*.wav' -o -name '*.xml' \)
|
2005-06-02 20:05:01 +02:00
|
|
|
|
2005-03-08 11:43:25 +01:00
|
|
|
FILES = `$(FIND)`
|
|
|
|
DIRS = `$(FIND) -exec dirname {} \; | sort -u`
|
2005-09-05 17:32:26 +02:00
|
|
|
FIND_PO = find ./po \( -name '*.mo' \)
|
|
|
|
FILES_PO = `$(FIND_PO) | sed -e 's/^\.\/po/\./g'`
|
|
|
|
DIRS_PO = `$(FIND_PO) -exec dirname {} \; | sort -u | sed -e 's/^\.\/po/\./g'`
|
2005-06-02 20:05:01 +02:00
|
|
|
FIND_LIB = find . -name '*.so'
|
2005-03-08 11:43:25 +01:00
|
|
|
FILES_LIB = `$(FIND_LIB)`
|
2004-11-25 20:27:09 +01:00
|
|
|
|
2005-09-04 22:13:56 +02:00
|
|
|
SCRIPTS = \
|
2005-09-05 02:58:50 +02:00
|
|
|
scripts/gajim \
|
2005-11-24 01:41:04 +01:00
|
|
|
scripts/gajim-remote \
|
2004-06-09 16:22:27 +02:00
|
|
|
|
2005-09-09 21:25:00 +02:00
|
|
|
all: translation trayicon gtkspell idle gajim.desktop
|
2005-03-23 12:52:25 +01:00
|
|
|
|
|
|
|
translation:
|
2005-06-02 20:05:01 +02:00
|
|
|
${MAKE} -C po all
|
2005-03-23 12:52:25 +01:00
|
|
|
|
|
|
|
trayicon:
|
2005-06-02 20:05:01 +02:00
|
|
|
${MAKE} -C src trayicon.so;
|
2005-05-30 21:17:28 +02:00
|
|
|
|
|
|
|
gtkspell:
|
2005-06-02 20:05:01 +02:00
|
|
|
${MAKE} -C src gtkspell.so;
|
2005-03-23 12:52:25 +01:00
|
|
|
|
|
|
|
idle:
|
2005-06-02 20:05:01 +02:00
|
|
|
${MAKE} -C src/common all;
|
2004-06-09 16:22:27 +02:00
|
|
|
|
2006-02-08 04:21:09 +01:00
|
|
|
distclean: clean
|
|
|
|
-rm ./tags
|
|
|
|
|
2004-06-09 16:22:27 +02:00
|
|
|
clean:
|
2005-07-19 11:35:26 +02:00
|
|
|
find . -name '*.pyc' -exec rm {} \;
|
|
|
|
find . -name '*.pyo' -exec rm {} \;
|
2006-05-10 21:20:16 +02:00
|
|
|
${MAKE} -C po clean
|
|
|
|
rm -f gajim.desktop
|
2005-06-02 20:05:01 +02:00
|
|
|
$(foreach sdir, $(MODULES), ${MAKE} -C $(sdir) clean;)
|
2005-03-08 11:44:31 +01:00
|
|
|
dist:
|
2005-06-02 20:05:01 +02:00
|
|
|
rm -rf gajim-$(VERSION)
|
2005-03-08 11:44:31 +01:00
|
|
|
mkdir gajim-$(VERSION)
|
2005-07-01 17:44:08 +02:00
|
|
|
cp -r data src po gajim-$(VERSION)/
|
2005-12-09 18:57:09 +01:00
|
|
|
cp AUTHORS gajim.1 gajim-remote.1 gajim.desktop.in COPYING THANKS Makefile Changelog README launch.sh gajim-$(VERSION)
|
2005-06-04 17:42:37 +02:00
|
|
|
mkdir gajim-$(VERSION)/scripts
|
2005-08-10 10:15:44 +02:00
|
|
|
for s in $(SCRIPTS) ; do \
|
|
|
|
cp $$s gajim-$(VERSION)/scripts/; \
|
|
|
|
done
|
2005-12-11 22:12:30 +01:00
|
|
|
find gajim-$(VERSION) -name '.svn' -type d | xargs rm -rf
|
2005-03-08 11:44:31 +01:00
|
|
|
find gajim-$(VERSION) -name '*.pyc' -exec rm {} \;
|
|
|
|
find gajim-$(VERSION) -name '*.pyo' -exec rm {} \;
|
|
|
|
find gajim-$(VERSION) -name '.*' -exec rm {} \;
|
|
|
|
@echo tarring gajim-$(VERSION) ...
|
2005-04-17 13:49:53 +02:00
|
|
|
@tar czf gajim-$(VERSION).tar.gz gajim-$(VERSION)/
|
2005-05-15 23:40:42 +02:00
|
|
|
@tar cjf gajim-$(VERSION).tar.bz2 gajim-$(VERSION)/
|
2005-03-08 11:44:31 +01:00
|
|
|
rm -rf gajim-$(VERSION)
|
|
|
|
|
2006-03-01 19:31:04 +01:00
|
|
|
install:
|
2005-09-05 17:32:26 +02:00
|
|
|
# Remove the old po folder if it exists
|
|
|
|
if [ -d $(DESTDIR)$(PREFIX)/share/gajim/po ] ; then \
|
|
|
|
rm -rf $(DESTDIR)$(PREFIX)/share/gajim/po; \
|
|
|
|
fi
|
2004-11-25 20:27:09 +01:00
|
|
|
for d in $(DIRS) ; do \
|
2004-12-19 22:31:25 +01:00
|
|
|
if [ ! -d $(DESTDIR)$(PREFIX)/share/gajim/$$d ] ; then \
|
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/share/gajim/$$d"; \
|
2004-11-25 20:27:09 +01:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
for f in $(FILES) ; do \
|
|
|
|
DST=`dirname "$$f"`; \
|
2004-12-19 22:31:25 +01:00
|
|
|
cp "$$f" "$(DESTDIR)$(PREFIX)/share/gajim/$$DST/"; \
|
2004-11-25 20:27:09 +01:00
|
|
|
done
|
2005-09-06 11:10:26 +02:00
|
|
|
rm "$(DESTDIR)$(PREFIX)/share/gajim/src/systraywin32.py"
|
2005-09-05 17:32:26 +02:00
|
|
|
for d in $(DIRS_PO) ; do \
|
|
|
|
if [ ! -d $(DESTDIR)$(PREFIX)/share/locale/$$d ] ; then \
|
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/share/locale/$$d"; \
|
|
|
|
fi; \
|
|
|
|
done
|
2006-06-13 11:58:21 +02:00
|
|
|
if [[ -n $$(find po -name *.mo) ]]; then \
|
2006-06-12 11:24:14 +02:00
|
|
|
${MAKE} -C po install PREFIX=$(PREFIX) ; \
|
|
|
|
fi
|
2005-03-23 00:26:08 +01:00
|
|
|
cp COPYING "$(DESTDIR)$(PREFIX)/share/gajim/";
|
2005-12-09 18:57:09 +01:00
|
|
|
cp THANKS "$(DESTDIR)$(PREFIX)/share/gajim/";
|
2005-06-04 17:20:55 +02:00
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/share/pixmaps";
|
|
|
|
cp data/pixmaps/gajim.png "$(DESTDIR)$(PREFIX)/share/pixmaps/";
|
2005-06-10 01:28:07 +02:00
|
|
|
cp data/pixmaps/gajim_about.png "$(DESTDIR)$(PREFIX)/share/pixmaps/";
|
2005-05-18 18:04:58 +02:00
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/share/applications";
|
2006-03-24 10:10:33 +01:00
|
|
|
if [ -f gajim.desktop ]; then \
|
|
|
|
cp gajim.desktop "$(DESTDIR)$(PREFIX)/share/applications/"; \
|
|
|
|
fi;
|
2005-06-25 16:05:49 +02:00
|
|
|
mkdir -p "$(MANDIR)/man1";
|
|
|
|
cp gajim.1 "$(MANDIR)/man1";
|
2005-08-19 09:44:08 +02:00
|
|
|
cp gajim-remote.1 "$(MANDIR)/man1";
|
2005-06-15 20:04:33 +02:00
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)$(LIBDIR)/gajim";
|
2005-01-26 11:45:33 +01:00
|
|
|
for f in $(FILES_LIB) ; do \
|
2005-06-15 20:04:33 +02:00
|
|
|
cp "$$f" "$(DESTDIR)$(PREFIX)$(LIBDIR)/gajim/"; \
|
2005-01-26 11:45:33 +01:00
|
|
|
done
|
2005-03-22 18:50:46 +01:00
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/bin";
|
2004-11-25 20:27:09 +01:00
|
|
|
for s in $(SCRIPTS) ; do \
|
|
|
|
BASE=`basename "$$s"`; \
|
2005-06-09 13:34:32 +02:00
|
|
|
if [ $(GAJIM_AP) -ne 0 ] ; then \
|
2006-04-13 21:32:22 +02:00
|
|
|
F=`cat "$$s" | sed -e 's!LIB!$(LIBDIR)!g' -e 's!PYTHON_EXEC!$(PYTHON)!g'`; \
|
2005-06-09 13:34:32 +02:00
|
|
|
else \
|
2006-04-13 21:32:22 +02:00
|
|
|
F=`cat "$$s" | sed -e 's!PREFIX!$(PREFIX)!g' -e 's!LIB!$(LIBDIR)!g' -e 's!PYTHON_EXEC!$(PYTHON)!g'`; \
|
2005-06-09 13:34:32 +02:00
|
|
|
fi; \
|
2004-12-19 22:31:25 +01:00
|
|
|
echo "$$F" > "$(DESTDIR)$(PREFIX)/bin/$$BASE"; \
|
|
|
|
chmod +x "$(DESTDIR)$(PREFIX)/bin/$$BASE"; \
|
2004-11-25 20:27:09 +01:00
|
|
|
done
|
2005-06-25 16:05:49 +02:00
|
|
|
|
2005-09-20 03:58:58 +02:00
|
|
|
gajim.desktop: gajim.desktop.in
|
2005-09-09 21:25:00 +02:00
|
|
|
intltool-merge -d po gajim.desktop.in gajim.desktop
|
|
|
|
|
2005-06-25 16:05:49 +02:00
|
|
|
#
|
|
|
|
# show make params we accept
|
|
|
|
#
|
|
|
|
help:
|
|
|
|
@echo Usage:
|
2006-02-08 04:21:09 +01:00
|
|
|
@echo make - builds all modules
|
|
|
|
@echo make clean - delete built modules and object files
|
2006-02-08 04:26:19 +01:00
|
|
|
@echo make distclean - clean plus deletion of all other non-repository files
|
2005-12-26 15:21:42 +01:00
|
|
|
@echo make install - install binaries into the official directories
|
|
|
|
@echo make uninstall - uninstall binaries from the official directories
|
|
|
|
@echo make help - prints this help
|
2005-09-20 03:58:58 +02:00
|
|
|
@echo
|
2005-12-26 15:21:42 +01:00
|
|
|
@echo make trayicon - makes only trayicon module
|
|
|
|
@echo make idle - makes only idle detection module
|
2006-02-08 04:21:09 +01:00
|
|
|
@echo make translation - makes only translation \(mo files\)
|
2005-12-26 15:21:42 +01:00
|
|
|
@echo make gtkspell - makes only gtkspell detection module
|
|
|
|
@echo make tags - makes 'tags' file for use with ctags
|
2005-06-25 16:05:49 +02:00
|
|
|
@echo
|
|
|
|
|
|
|
|
#
|
|
|
|
# uninstall application from official directories
|
|
|
|
#
|
|
|
|
uninstall:
|
|
|
|
rm -rf "$(DESTDIR)$(PREFIX)/share/gajim" # the main files are here
|
|
|
|
rm -rf "$(DESTDIR)$(PREFIX)/lib/gajim" # the .so files are here
|
2005-09-04 13:33:14 +02:00
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/bin/gajim" # the bash script
|
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/bin/gajim-remote" # remote-control script
|
2005-09-07 07:51:29 +02:00
|
|
|
rm -f "$(MANDIR)/man1/gajim.1" # the man page
|
|
|
|
rm -f "$(MANDIR)/man1/gajim-remote.1" # the man page
|
2005-09-04 13:33:14 +02:00
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/share/pixmaps/gajim.png" # the icon
|
2005-09-07 07:51:29 +02:00
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/share/pixmaps/gajim_about.png" # the icon
|
2005-09-04 13:33:14 +02:00
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/share/applications/gajim.desktop" #the desktop
|
2005-09-07 07:51:29 +02:00
|
|
|
find "$(DESTDIR)$(PREFIX)/share/locale" -name 'gajim.mo' -exec rm {} \; #the .mo files
|
2005-06-25 16:05:49 +02:00
|
|
|
@echo done uninstalling
|
2005-09-20 03:58:58 +02:00
|
|
|
|
|
|
|
tags:
|
|
|
|
-rm tags
|
|
|
|
exuberant-ctags -R
|
|
|
|
|
2006-02-08 04:21:09 +01:00
|
|
|
.PHONY: all translation trayicon gtkspell idle clean dist distclean install help\
|
2006-01-11 02:26:50 +01:00
|
|
|
uninstall tags
|