diff --git a/gramps2/Makefile.am b/gramps2/Makefile.am index e3c455ce0..7afda56cb 100644 --- a/gramps2/Makefile.am +++ b/gramps2/Makefile.am @@ -11,3 +11,10 @@ gramps: gramps.sh dist-hook: gramps.spec cp gramps.spec $(distdir) + +.PHONY: pycheck trans + +pycheck: + (cd src; make pycheck) +trans: + (cd src; make trans) diff --git a/gramps2/src/Makefile.am b/gramps2/src/Makefile.am index 83f8fb606..4367aa2ee 100644 --- a/gramps2/src/Makefile.am +++ b/gramps2/src/Makefile.am @@ -5,7 +5,7 @@ SUBDIRS = docgen filters plugins data po calendars GVFSINC = @GPREF@ CFLAGS = -fPIC -shared -O @GNOMEINC@ @CFLAGS@ @CPPFLAGS@ -I@includedir@ LDFLAGS = @GNOMELIB@ @LDFLAGS@ -L@libdir@ @LIBS@ -CLEANFILES = ${INTLLIBS} grampslib.so +CLEANFILES = $(INTLLIBS) grampslib.so MOSTLYCLEANFILES = INTLLIBS= intl22.so @@ -93,8 +93,9 @@ pkgpython_PYTHON = \ Witness.py\ WriteXML.py -# Use GNU make's ':=' syntax for nice wildcard use. +# Could use GNU make's ':=' syntax for nice wildcard use. # If not using GNU make, then list all files individually +# The latter is more portable and POSIX-friendly :) GLADEFILES = \ config.glade\ dialog.glade\ @@ -130,39 +131,42 @@ GRAPHICS = \ splash.jpg # Other stuff that we need to install -pkgdata_DATA = ${INTLLIBS} ${GLADEFILES} ${GRAPHICS} gramps.desktop grampslib.so +dist_pkgdata_DATA = $(GLADEFILES) $(GRAPHICS) gramps.desktop +nodist_pkgdata_DATA = grampslib.so $(INTLLIBS) -EXTRA_DIST = grampslib.i +EXTRA_DIST = grampslib.i intl.c grampslib_wrap.c -all: ${INTLLIBS} grampslib.so +all-local: $(INTLLIBS) grampslib.so -DIST_SOURCES = intl.c grampslib_wrap.c -dist_pkgdata_DATA = ${pkgdata_DATA} - -# These can prbably be done in a better or more elegant/generic way +# These can probably be done in a better or more elegant/generic way # eventually (libtool?), but this works. -intl22.so: intl.c - $(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ intl.c +intl22.so: $(srcdir)/intl.c + $(CC) $(CFLAGS) $(LDFLAGS) @P22_INCLUDES@ -DVER22 -o $@ $(srcdir)/intl.c -grampslib.so: grampslib_wrap.c - $(CC) $(CFLAGS) @P22_INCLUDES@ -o $@ grampslib_wrap.c $(LDFLAGS) +grampslib.so: $(srcdir)/grampslib_wrap.c + $(CC) $(CFLAGS) @P22_INCLUDES@ -o $@ $(srcdir)/grampslib_wrap.c $(LDFLAGS) # In principle the following rule slightly violates the automake/autoconf # spirit of keeping each subdirectory as a separate entity unto itself. # But, since the template depends on everything from here, we allow this # one exception. -trans: po/template.po +# Build po/template.po. +.PHONY: trans +trans: ./build_po -check: +pycheck: + for d in $(SUBDIRS) ; do \ + (cd $$d; make pycheck); \ + done; pychecker $(pkgpython_PYTHON) - + install-data-local: - ${INSTALL} -d ${prefix}/share/pixmaps - ${INSTALL_DATA} gramps.png ${prefix}/share/pixmaps - ${INSTALL} -d ${prefix}/share/gnome/apps/Applications - ${INSTALL_DATA} gramps.desktop ${prefix}/share/gnome/apps/Applications + $(INSTALL) -d $(DESTDIR)$(prefix)/share/pixmaps + $(INSTALL_DATA) $(srcdir)/gramps.png $(DESTDIR)$(prefix)/share/pixmaps + $(INSTALL) -d $(DESTDIR)$(prefix)/share/gnome/apps/Applications + $(INSTALL_DATA) $(srcdir)/gramps.desktop $(DESTDIR)$(prefix)/share/gnome/apps/Applications uninstall-local: - -rm ${prefix}/share/pixmaps/gramps.png - -rm ${prefix}/share/gnome/apps/Applications/gramps.desktop + -rm $(DESTDIR)$(prefix)/share/pixmaps/gramps.png + -rm $(DESTDIR)$(prefix)/share/gnome/apps/Applications/gramps.desktop diff --git a/gramps2/src/calendars/Makefile.am b/gramps2/src/calendars/Makefile.am index fe871885a..97052dbf7 100644 --- a/gramps2/src/calendars/Makefile.am +++ b/gramps2/src/calendars/Makefile.am @@ -1,4 +1,4 @@ -# This is the src/plugins level Makefile for Gramps +# This is the src/calendars level Makefile for Gramps # Use GNU make's ':=' syntax for nice wildcard use. # If not using GNU make, then list all .py files individually @@ -9,4 +9,10 @@ pkgpython_PYTHON = \ pkgpyexecdir = @pkgpyexecdir@/plugins pkgpythondir = @pkgpythondir@/plugins -pkgdatadir = ${datadir}/@PACKAGE@/calendars +pkgdatadir = $(datadir)/@PACKAGE@/calendars + +GRAMPS_PY_MODPATH = "../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgpython_PYTHON)); diff --git a/gramps2/src/data/Makefile.am b/gramps2/src/data/Makefile.am index 94f1c99ff..22fe33411 100644 --- a/gramps2/src/data/Makefile.am +++ b/gramps2/src/data/Makefile.am @@ -1,7 +1,8 @@ # This is the src/data level Makefile SUBDIRS = templates -pkgdatadir = ${datadir}/@PACKAGE@/data +pkgdatadir = $(datadir)/@PACKAGE@/data pkgdata_DATA = gedcom.xml -EXTRA_DIST = ${pkgdata_DATA} +EXTRA_DIST = $(pkgdata_DATA) + diff --git a/gramps2/src/data/templates/Makefile.am b/gramps2/src/data/templates/Makefile.am index 6ea47c126..7733c636c 100644 --- a/gramps2/src/data/templates/Makefile.am +++ b/gramps2/src/data/templates/Makefile.am @@ -1,5 +1,9 @@ # This is the src/data/templates level Makefile -pkgdata_DATA := ${wildcard *.tpkg} templates.xml - -pkgdatadir = ${datadir}/@PACKAGE@/data/templates -EXTRA_DIST = ${pkgdata_DATA} +pkgdata_DATA = marble.tpkg \ + pink_marble.tpkg \ + sepia.tpkg \ + sky_border.tpkg \ + templates.xml + +pkgdatadir = $(datadir)/@PACKAGE@/data/templates +EXTRA_DIST = $(pkgdata_DATA) diff --git a/gramps2/src/docgen/Makefile.am b/gramps2/src/docgen/Makefile.am index 677cac05c..f3d6b4804 100644 --- a/gramps2/src/docgen/Makefile.am +++ b/gramps2/src/docgen/Makefile.am @@ -18,3 +18,9 @@ pkgpython_PYTHON = \ pkgpyexecdir = @pkgpyexecdir@/docgen pkgpythondir = @pkgpythondir@/docgen + +GRAMPS_PY_MODPATH = "../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgpython_PYTHON)); diff --git a/gramps2/src/filters/Makefile.am b/gramps2/src/filters/Makefile.am index 8a0b0c1e6..180825c60 100644 --- a/gramps2/src/filters/Makefile.am +++ b/gramps2/src/filters/Makefile.am @@ -23,3 +23,9 @@ pkgpython_PYTHON = \ pkgpyexecdir = @pkgpyexecdir@/filters pkgpythondir = @pkgpythondir@/filters + +GRAMPS_PY_MODPATH = "../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgpython_PYTHON)); diff --git a/gramps2/src/plugins/Makefile.am b/gramps2/src/plugins/Makefile.am index 05c96466b..2a8923026 100644 --- a/gramps2/src/plugins/Makefile.am +++ b/gramps2/src/plugins/Makefile.am @@ -1,7 +1,7 @@ # This is the src/plugins level Makefile for Gramps -# Use GNU make's ':=' syntax for nice wildcard use. +# We could use GNU make's ':=' syntax for nice wildcard use, +# but that is not necessarily portable. # If not using GNU make, then list all .py files individually - pkgpython_PYTHON = \ AncestorChart.py\ AncestorReport.py\ @@ -51,8 +51,12 @@ GLADEFILES = \ summary.glade\ verify.glade -pkgdatadir = ${datadir}/@PACKAGE@/plugins +pkgdatadir = $(datadir)/@PACKAGE@/plugins -pkgdata_DATA = ${GLADEFILES} -dist_pkgdata_DATA = ${pkgdata_DATA} +dist_pkgdata_DATA = $(GLADEFILES) +GRAMPS_PY_MODPATH = "../:../docgen" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgpython_PYTHON)); diff --git a/gramps2/src/po/Makefile.am b/gramps2/src/po/Makefile.am index 975145e5b..0f59832ed 100644 --- a/gramps2/src/po/Makefile.am +++ b/gramps2/src/po/Makefile.am @@ -1,23 +1,23 @@ # This is the src/po level Makefile configuration -EXTRA_DIST = ${POFILES} -CLEANFILES = ${MOFILES} +EXTRA_DIST = $(POFILES) template.po +CLEANFILES = $(MOFILES) -all: ${MOFILES} +all-local: $(MOFILES) -install-data-local: - for lang in ${LANGUAGES}; do \ - ${INSTALL} -d ${prefix}/share/locale/$$lang; \ - ${INSTALL} -d ${prefix}/share/locale/$$lang/LC_MESSAGES; \ - ${INSTALL_DATA} $$lang.mo ${prefix}/share/locale/$$lang/LC_MESSAGES/${PACKAGE}.mo; \ +install-data-local: + for lang in $(LANGUAGES); do \ + $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$lang; \ + $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES; \ + $(INSTALL_DATA) $$lang.mo $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ done uninstall-local: - for lang in ${LANGUAGES}; do \ - rm -f ${prefix}/share/locale/$$lang/LC_MESSAGES/gramps.mo; \ + for lang in $(LANGUAGES); do \ + rm -f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/gramps.mo; \ done SUFFIXES = .po .mo .po.mo: - ${MSGFMT} -v $< -o $@ + $(MSGFMT) -v $< -o $@