From ec611074401e20895626ca76c179b38397826aee Mon Sep 17 00:00:00 2001 From: "Donald A. Peterson" Date: Sat, 30 Mar 2002 03:49:19 +0000 Subject: [PATCH] New Makefile structure svn: r881 --- gramps/Makefile.comm.in | 17 ++++++++++ gramps/Makefile.in | 60 ++++++++++++++-------------------- gramps/src/Makefile.in | 26 ++++++++++----- gramps/src/docgen/Makefile.in | 19 +++++++++-- gramps/src/filters/Makefile.in | 28 +++++++++++----- gramps/src/plugins/Makefile.in | 18 ++++++++-- 6 files changed, 110 insertions(+), 58 deletions(-) create mode 100644 gramps/Makefile.comm.in diff --git a/gramps/Makefile.comm.in b/gramps/Makefile.comm.in new file mode 100644 index 000000000..27f70e4cd --- /dev/null +++ b/gramps/Makefile.comm.in @@ -0,0 +1,17 @@ +# Hold variable definitions needed by slave Makefiles +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +datadir = @datadir@/@PACKAGE@ +INSTALL = @INSTALL@ +sharedir = ${prefix}/share/gramps +GNOMEHELP = ${prefix}/share/gnome/help +GM = gramps-manual +EG = extending-gramps +DB2HTML = @DOCBOOKHTML@ + +@SET_MAKE@ + +# Ensure the correct "/bin/sh" for interpreting commands +# in case the user has some other shell environment +SHELL = @BINSH@ diff --git a/gramps/Makefile.in b/gramps/Makefile.in index 49d01e439..555ba8dfa 100644 --- a/gramps/Makefile.in +++ b/gramps/Makefile.in @@ -1,50 +1,40 @@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -datadir = @datadir@/@PACKAGE@ -INSTALL = @INSTALL@ -sharedir = ${prefix}/share/gramps -GNOMEHELP = ${prefix}/share/gnome/help -GM = gramps-manual -EG = extending-gramps +include Makefile.comm -@SET_MAKE@ +ifeq (${DB2HTML},) +DOCS = +else +DOCS = doc/${GM}/C doc/${EG}/C +endif + +# Append ${DOCS} to the next line to generate documentation +DIRS = src src/plugins src/docgen src/filters src/data ${DOCS} all: - (cd src; ${MAKE} all) - (cd src/plugins; ${MAKE} all) - (cd src/docgen; ${MAKE} all) - (cd src/filters; ${MAKE} all) - (cd src/data; ${MAKE} all) + @ for dir in ${DIRS}; do \ + echo "Making all in $$dir"; \ + (cd $$dir; ${MAKE} all); \ + done install: - (cd src; ${MAKE} install) - (cd src/plugins; ${MAKE} install) - (cd src/docgen; ${MAKE} install) - (cd src/filters; ${MAKE} install) - (cd src/data; ${MAKE} install) + @ for dir in ${DIRS}; do \ + echo "Making install in $$dir"; \ + (cd $$dir; ${MAKE} install); \ + done -${INSTALL} -d ${bindir} - -${INSTALL} -d ${GNOMEHELP}/${GM}/C - -${INSTALL} -d ${GNOMEHELP}/${EG}/C - -${INSTALL} doc/${GM}/C/${GM}/*.html ${GNOMEHELP}/${GM}/C - -${INSTALL} doc/${GM}/C/${GM}/*.png ${GNOMEHELP}/${GM}/C - -${INSTALL} doc/${EG}/C/${EG}/*.html ${GNOMEHELP}/${EG}/C ${INSTALL} gramps.sh ${bindir}/gramps ${INSTALL} doc/gramps.dtd ${sharedir} chmod +x ${bindir}/gramps uninstall: - (cd src; ${MAKE} uninstall) - (cd src/plugins; ${MAKE} uninstall) - (cd src/docgen; ${MAKE} uninstall) - (cd src/filters; ${MAKE} uninstall) - (cd src/data; ${MAKE} uninstall) + @ for dir in ${DIRS}; do \ + echo "Making uninstall in $$dir"; \ + (cd $$dir; ${MAKE} uninstall); \ + done rm ${bindir}/gramps clean: - (cd src; ${MAKE} clean) - (cd src/plugins; ${MAKE} clean) - (cd src/docgen; ${MAKE} clean) - (cd src/filters; ${MAKE} clean) - (cd src/data; ${MAKE} clean) + @ for dir in ${DIRS}; do \ + echo "Making clean in $$dir"; \ + (cd $$dir; ${MAKE} clean); \ + done rm -f core *~ config.cache config.log config.status diff --git a/gramps/src/Makefile.in b/gramps/src/Makefile.in index c974028b7..cc574b9e9 100644 --- a/gramps/src/Makefile.in +++ b/gramps/src/Makefile.in @@ -1,8 +1,5 @@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -datadir = @datadir@/@PACKAGE@ -INSTALL = @INSTALL@ +include @top_srcdir@/Makefile.comm + srcdir = @top_srcdir@ intl_libs = @INTLLIBS@ p15_inc = @P15_INCLUDES@ @@ -14,11 +11,13 @@ CFLAGS = -fPIC -shared -O @CFLAGS@ @CPPFLAGS@ -I@includedir@ LDFLAGS = @LDFLAGS@ -L@libdir@ @LIBS@ LANG = sv de fr es it pt_BR -@SET_MAKE@ +# Use GNU make's ':=' syntax for nice wildcard use. +# If not using GNU make, then list all .py files individually +PYSRCS := ${wildcard *.py} -all: ${intl_libs} - chmod +x ${pycomp} - ${pycomp} *.py +PYOBJS = ${PYSRCS:.py=.pyo} + +all: ${intl_libs} ${PYOBJS} intl15.so: intl.c $(CC) $(CFLAGS) $(LDFLAGS) $(p15_inc) -DVER15 -o $@ intl.c @@ -57,3 +56,12 @@ po/template.po: *.py *.glade */*.py */*.glade clean: -rm -f core *.pyo *.pyc *.bak *~ + +# Add PYTHON suffix rules to make's vocabulary +.SUFFIXES: .py .pyo + +# How do we properly compile a python module? +.py.pyo: + chmod +x ${pycomp} + ${pycomp} $< + diff --git a/gramps/src/docgen/Makefile.in b/gramps/src/docgen/Makefile.in index 1bf45ce26..b8222d5a1 100644 --- a/gramps/src/docgen/Makefile.in +++ b/gramps/src/docgen/Makefile.in @@ -1,3 +1,5 @@ +include @top_srcdir@/Makefile.comm + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -7,10 +9,13 @@ docgen = ${datadir}/docgen srcdir = @top_srcdir@ pycomp = ${srcdir}/py-compile -@SET_MAKE@ +# Use GNU make's ':=' syntax for nice wildcard use. +# If not using GNU make, then list all .py files individually +PYSRCS := ${wildcard *.py} -all: - ${pycomp} *.py +PYOBJS = ${PYSRCS:.py=.pyo} + +all: ${PYOBJS} install: ${INSTALL} -d ${docgen} @@ -22,3 +27,11 @@ uninstall: clean: -rm -f core *.pyo *.pyc *.bak *~ + +# Add PYTHON suffix rules to make's vocabulary +.SUFFIXES: .py .pyo + +# How do we properly compile a python module? +.py.pyo: + chmod +x ${pycomp} + ${pycomp} $< diff --git a/gramps/src/filters/Makefile.in b/gramps/src/filters/Makefile.in index 65d3a32ce..04e469fdb 100644 --- a/gramps/src/filters/Makefile.in +++ b/gramps/src/filters/Makefile.in @@ -1,24 +1,36 @@ +include @top_srcdir@/Makefile.comm + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datadir = @datadir@/@PACKAGE@ INSTALL = @INSTALL@ -filters = ${datadir}/filters +plugins = ${datadir}/plugins srcdir = @top_srcdir@ pycomp = ${srcdir}/py-compile -@SET_MAKE@ +# Use GNU make's ':=' syntax for nice wildcard use. +# If not using GNU make, then list all .py files individually +PYSRCS := ${wildcard *.py} -all: - ${pycomp} *.py +PYOBJS = ${PYSRCS:.py=.pyo} + +all: ${PYOBJS} install: - ${INSTALL} -d ${filters} - ${INSTALL} *.py *.pyo ${datadir}/filters + ${INSTALL} -d ${plugins} + ${INSTALL} *.py *.pyo *.glade ${plugins} uninstall: - rm ${filters}/*.py ${filters}/*.pyo - -rmdir ${filters} + rm ${plugins}/*.py ${plugins}/*.pyo ${plugins}/*.glade + -rmdir ${plugins} clean: -rm -f core *.pyo *.pyc *.bak *~ + +# Add PYTHON suffix rules to make's vocabulary +.SUFFIXES: .py .pyo + +# How do we properly compile a python module? +.py.pyo: + ${pycomp} $< diff --git a/gramps/src/plugins/Makefile.in b/gramps/src/plugins/Makefile.in index 0e2ecd7d7..04e469fdb 100644 --- a/gramps/src/plugins/Makefile.in +++ b/gramps/src/plugins/Makefile.in @@ -1,3 +1,5 @@ +include @top_srcdir@/Makefile.comm + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -7,10 +9,13 @@ plugins = ${datadir}/plugins srcdir = @top_srcdir@ pycomp = ${srcdir}/py-compile -@SET_MAKE@ +# Use GNU make's ':=' syntax for nice wildcard use. +# If not using GNU make, then list all .py files individually +PYSRCS := ${wildcard *.py} -all: - ${pycomp} *.py +PYOBJS = ${PYSRCS:.py=.pyo} + +all: ${PYOBJS} install: ${INSTALL} -d ${plugins} @@ -22,3 +27,10 @@ uninstall: clean: -rm -f core *.pyo *.pyc *.bak *~ + +# Add PYTHON suffix rules to make's vocabulary +.SUFFIXES: .py .pyo + +# How do we properly compile a python module? +.py.pyo: + ${pycomp} $<