diff --git a/.cvsignore b/.cvsignore index 3c54fde04f..58ff9004c0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,5 @@ Makefile +Makefile.init config.cache config.log config.status diff --git a/Makefile.common b/Makefile.common index 72002cad63..2aa4309d36 100644 --- a/Makefile.common +++ b/Makefile.common @@ -64,19 +64,21 @@ obj/qt/%.o: %.cpp $(CC) -Wp,-MD,$(basename $@).d.tmp -c $(CFLAGS) ${QT_CFLAGS} -DKDE -o $@ $< ${cleanupdeps} -clean: - $(foreach dir,${CLEAN_SUBDIRS},(cd ${dir} && $(MAKE) clean);) +clean-files: rm -f *~ *.bak \#* $(TRASH) rm -rf obj -rm -rf ${TRASH} -distclean: clean +clean: clean-files + $(foreach dir,${CLEAN_SUBDIRS},(cd ${dir} && $(MAKE) clean);) + +distclean: clean-files $(foreach dir,${CLEAN_SUBDIRS},(cd ${dir} && $(MAKE) distclean);) rm -f Makefile.bak - rm -f $(foreach f,$(wildcard *.in),$(f:.in=)) - rm -f ${DIST_TRASH} + rm -f $(foreach f,$(wildcard *.in),$(filter-out configure,$(f:.in=))) + -rm -rf ${DIST_TRASH} -.PHONY: clean distclean +.PHONY: clean clean-files distclean # Get dependencies (if existent). diff --git a/Makefile.in b/Makefile.in index d6b8eac398..e52d4860d0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,5 @@ # Makefile -- makefile for gnucash +# @configure_input@ # Copyright (C) 1997 Robin Clark # Copyright (C) 1998 Rob Browning # @@ -21,30 +22,7 @@ # Address: 609 8th Street # Huntington Beach, CA 92648-4632 -SHELL=/bin/bash -export SHELL - -srcdir = @srcdir@ -VPATH = @srcdir@ - -prefix=@prefix@ -datadir=@datadir@ - # i.e. /usr/share -localstatedir=@localstatedir@ - # i.e. /var/ -sysconfdir=@sysconfdir@ - # i.e. /etc/ - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -CPU = @target_cpu@ - -LIBS=@LIBS@ - -GNC_DOCDIR := @GNC_DOCDIR@ -GNC_BINDIR := @GNC_BINDIR@ -GNC_CONFIGDIR := @GNC_CONFIGDIR@ -GNC_SHAREDIR := @GNC_SHAREDIR@ +include @top_srcdir@/Makefile.init ###################################################################### # Description of targets: @@ -65,6 +43,10 @@ default: @echo "qt kde/qt version" @echo " " +# This inclusion must come after the first target, and after the +# definitions of *_SRCS, etc., but before the usage of *_OBJS. +include @top_srcdir@/Makefile.common + # Aliases motif-static: motif.static gnome-static: gnome.static @@ -94,18 +76,13 @@ qt: depend: @echo make depend is now superfluous. -clean: - rm -f *~ *.o *.bak - @cd lib; $(MAKE) clean - @cd src; $(MAKE) clean - -distclean: clean - rm -f Makefile *~ *.o *.bak share/scm gnucash.bin - rm -f gnucash.motif gnucash.motif.static \ - gnucash.gnome gnucash.gnome.static gnucash.qt gnucash-shell - rm -f config.cache config.log config.status config.h - @cd lib; $(MAKE) distclean - @cd src; $(MAKE) distclean +CLEAN_SUBDIRS += lib src +TRASH += *~ *.o *.bak + +DIST_TRASH += Makefile *~ *.o *.bak share/scm gnucash.bin +DIST_TRASH += gnucash.motif gnucash.motif.static +DIST_TRASH += gnucash.gnome gnucash.gnome.static gnucash.qt gnucash-shell +DIST_TRASH += config.cache config.log config.status config.h tagsfiles := $(shell find -name "*.[ch]") diff --git a/Makefile.init.in b/Makefile.init.in new file mode 100644 index 0000000000..6eb0c50820 --- /dev/null +++ b/Makefile.init.in @@ -0,0 +1,34 @@ +# -*-makefile-*- + +@SET_MAKE@ + +export SHELL=/bin/bash + +srcdir = @srcdir@ +VPATH = @srcdir@ + +prefix=@prefix@ +datadir=@datadir@ + # i.e. /usr/share +localstatedir=@localstatedir@ + # i.e. /var/ +sysconfdir=@sysconfdir@ + # i.e. /etc/ +includedir=@includedir@ + +CC = @CC@ +INSTALL = @INSTALL@ +RANLIB = @RANLIB@ +INSTALL_DATA = @INSTALL_DATA@ + +CPU = @target_cpu@ + +OPT_STYLE_INSTALL=@OPT_STYLE_INSTALL@ + +# These are *only* to be used at *install* time. +GNC_DOCDIR=@GNC_DOCDIR@ +GNC_BINDIR=@GNC_BINDIR@ +GNC_CONFIGDIR=@GNC_CONFIGDIR@ +GNC_SHAREDIR=@GNC_SHAREDIR@ + +HAVE_PLOTUTILS=@HAVE_PLOTUTILS@ diff --git a/configure b/configure index 6ac2aa3995..2fa4311c75 100755 --- a/configure +++ b/configure @@ -2476,16 +2476,15 @@ fi if test ${OPT_STYLE_INSTALL} = 1 then - GNC_DOCDIR=${prefix}/doc - GNC_BINDIR=${prefix}/bin + GNC_DOCDIR='${prefix}/doc' + GNC_BINDIR='${prefix}/bin' GNC_CONFIGDIR=${sysconfdir} GNC_SHAREDIR=${datadir} else - GNC_DOCDIR=${prefix}/doc/gnucash - GNC_BINDIR=${prefix}/bin + GNC_DOCDIR='${prefix}/doc/gnucash' + GNC_BINDIR='${prefix}/bin' GNC_CONFIGDIR=${sysconfdir}/gnucash GNC_SHAREDIR=${datadir}/gnucash - GNC_STARTUP_FILE=`eval echo ${datadir}/startup.scm` fi @@ -2493,7 +2492,7 @@ fi -# We have to eval these because they are the *runtime* (not install +# We have to handle these here because they are the *runtime* (not install # time) defaults, and they're substituted into startup.scm and gnucash.h # directly, so: # 1) We don't want them to change if you do @@ -2501,15 +2500,9 @@ fi # 2) They are normally defined in terms of $prefix so we need to expand # that before substituting into those source files. I wish I knew how # to force a recursive expansion... -# -GNC_STARTUP_FILE=`eval echo ${GNC_SHAREDIR}/scm/startup.scm` -GNC_DOC_DIR_DEFAULT=`eval echo ${GNC_DOCDIR}` -GNC_HTML_DIR_DEFAULT=`eval echo ${GNC_SHAREDIR}/Docs` -GNC_REPORT_DIR_DEFAULT=`eval echo ${GNC_SHAREDIR}/Reports` -GNC_SHARE_DIR_DEFAULT=`eval echo ${GNC_SHAREDIR}` -GNC_CONFIG_DIR_DEFAULT=`eval echo ${GNC_CONFIGDIR}` - +GNC_RUNTIME_SHAREDIR=`eval echo ${GNC_SHAREDIR}` +GNC_RUNTIME_CONFIGDIR=`eval echo ${GNC_CONFIGDIR}` @@ -2618,7 +2611,25 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/guile/gnucash.h src/scm/startup.scm src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile src/swig/Makefile src/swig/guile/Makefile lib/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile + Makefile.init + src/Makefile + src/engine/Makefile + src/guile/Makefile + src/guile/gnucash.h + src/scm/Makefile + src/scm/startup.scm + src/gnome/Makefile + src/motif/Makefile + src/qt/Makefile + src/register/Makefile + src/reports/Makefile + src/swig/Makefile + src/swig/guile/Makefile + lib/Makefile + lib/Xbae-4.6.2-linas/Makefile + lib/Xbae-4.6.2-linas/src/Makefile + lib/ComboBox-1.33/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/configure.in b/configure.in index c5e022b880..2114df61ed 100644 --- a/configure.in +++ b/configure.in @@ -192,26 +192,23 @@ AC_SUBST(MOTIF_LIBS) if test ${OPT_STYLE_INSTALL} = 1 then - GNC_DOCDIR=${prefix}/doc - GNC_BINDIR=${prefix}/bin + GNC_DOCDIR='${prefix}/doc' + GNC_BINDIR='${prefix}/bin' GNC_CONFIGDIR=${sysconfdir} GNC_SHAREDIR=${datadir} - GNC_STARTUP_FILE=`eval echo ${datadir}/startup.scm` else - GNC_DOCDIR=${prefix}/doc/gnucash - GNC_BINDIR=${prefix}/bin + GNC_DOCDIR='${prefix}/doc/gnucash' + GNC_BINDIR='${prefix}/bin' GNC_CONFIGDIR=${sysconfdir}/gnucash GNC_SHAREDIR=${datadir}/gnucash - GNC_STARTUP_FILE=`eval echo ${datadir}/scm/startup.scm` fi - AC_SUBST(GNC_DOCDIR) AC_SUBST(GNC_BINDIR) AC_SUBST(GNC_CONFIGDIR) AC_SUBST(GNC_SHAREDIR) -# We have to eval these because they are the *runtime* (not install +# We have to handle these here because they are the *runtime* (not install # time) defaults, and they're substituted into startup.scm and gnucash.h # directly, so: # 1) We don't want them to change if you do @@ -219,22 +216,34 @@ AC_SUBST(GNC_SHAREDIR) # 2) They are normally defined in terms of $prefix so we need to expand # that before substituting into those source files. I wish I knew how # to force a recursive expansion... -# -# GNC_STARTUP_FILE=`eval echo ${GNC_SHAREDIR}/scm/startup.scm` -GNC_DOC_DIR_DEFAULT=`eval echo ${GNC_DOCDIR}` -GNC_HTML_DIR_DEFAULT=`eval echo ${GNC_SHAREDIR}/Docs` -GNC_REPORT_DIR_DEFAULT=`eval echo ${GNC_SHAREDIR}/Reports` -GNC_SHARE_DIR_DEFAULT=`eval echo ${GNC_SHAREDIR}` -GNC_CONFIG_DIR_DEFAULT=`eval echo ${GNC_CONFIGDIR}` - -AC_SUBST(GNC_STARTUP_FILE) -AC_SUBST(GNC_DOC_DIR_DEFAULT) -AC_SUBST(GNC_SHARE_DIR_DEFAULT) -AC_SUBST(GNC_CONFIG_DIR_DEFAULT) + +GNC_RUNTIME_SHAREDIR=`eval echo ${GNC_SHAREDIR}` +GNC_RUNTIME_CONFIGDIR=`eval echo ${GNC_CONFIGDIR}` + +AC_SUBST(GNC_RUNTIME_SHAREDIR) +AC_SUBST(GNC_RUNTIME_CONFIGDIR) # ******************************************* AC_CONFIG_HEADER(config.h) -AC_OUTPUT(Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/guile/gnucash.h src/scm/startup.scm src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile src/swig/Makefile src/swig/guile/Makefile lib/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile) +AC_OUTPUT(Makefile + Makefile.init + src/Makefile + src/engine/Makefile + src/guile/Makefile + src/guile/gnucash.h + src/scm/Makefile + src/scm/startup.scm + src/gnome/Makefile + src/motif/Makefile + src/qt/Makefile + src/register/Makefile + src/reports/Makefile + src/swig/Makefile + src/swig/guile/Makefile + lib/Makefile + lib/Xbae-4.6.2-linas/Makefile + lib/Xbae-4.6.2-linas/src/Makefile + lib/ComboBox-1.33/Makefile) chmod +x gnucash diff --git a/lib/Makefile.in b/lib/Makefile.in index 5b9780c765..bec8f8683f 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -21,11 +21,7 @@ # Address: 609 8th Street # Huntington Beach, CA 92648-4632 -# These three lines are suggested defs for autoconf (see the info pages). -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ +include @top_srcdir@/Makefile.init ###################################################################### # Description of targets: @@ -51,7 +47,7 @@ all: # This inclusion must come after the first target, and after the # definitions of *_SRCS, etc., but before the usage of *_OBJS. -include $(top_srcdir)/Makefile.common +include @top_srcdir@/Makefile.common motif: @cd ComboBox-1.33; $(MAKE) default diff --git a/src/Makefile.in b/src/Makefile.in index a8f6767a1b..f0981b371b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -21,12 +21,8 @@ # Address: 609 8th Street # Huntington Beach, CA 92648-4632 -# These three lines are suggested defs for autoconf (see the info pages). -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ +include @top_srcdir@/Makefile.init -CC = @CC@ INCLPATH = -I.. -I./engine -I./register -Ireports -I@srcdir@/../include -I@prefix@/include CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} @@ -34,14 +30,14 @@ CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} ###################################################################### # See Makefile.common for information about these variables. COMMON_SRCS := MultiLedger.c SplitLedger.c -CLEAN_SUBDIRS := engine gnome motif register guile reports swig qt +CLEAN_SUBDIRS := engine gnome motif register guile reports swig qt scm ###################################################################### all: default # This inclusion must come after the first target, and after the # definitions of *_SRCS, etc., but before the usage of *_OBJS. -include ../Makefile.common +include @top_srcdir@/Makefile.common default: $(OBJS) diff --git a/src/engine/Makefile.in b/src/engine/Makefile.in index 1cbe9a5e53..4ba72cd5c8 100644 --- a/src/engine/Makefile.in +++ b/src/engine/Makefile.in @@ -22,13 +22,8 @@ # Address: 609 8th Street # Huntington Beach, CA 92648-4632 -# These three lines are suggested defs for autoconf (see the info pages). -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ +include @top_srcdir@/Makefile.init -CC = @CC@ -RANLIB = @RANLIB@ INCLPATH = -I@srcdir@/../../include -I@srcdir@/../.. CFLAGS = @CFLAGS@ ${INCLPATH} @@ -42,7 +37,7 @@ all: default # This inclusion must come after the first target, and after the # definitions of *_SRCS, etc., but before the usage of *_OBJS. -include ../../Makefile.common +include @top_srcdir@/Makefile.common default: ../libengine.a diff --git a/src/gnome/Makefile.in b/src/gnome/Makefile.in index 85c9d17f40..5b0ea164c1 100644 --- a/src/gnome/Makefile.in +++ b/src/gnome/Makefile.in @@ -22,15 +22,7 @@ # Address: 609 8th Street # Huntington Beach, CA 92648-4632 -# These three lines are suggested defs for autoconf (see the info pages). -@SET_MAKE@ -prefix = @prefix@ -srcdir = @srcdir@ -VPATH = @srcdir@ -includedir=@includedir@ - - -CC = @CC@ +include @top_srcdir@/Makefile.init INCLPATH = -I.. -I../.. -I../engine -I../register -I../guile \ -I@srcdir@/../../include \ @@ -62,7 +54,7 @@ default: $(TARGET) # This inclusion must come after the first target, and after the # definitions of *_SRCS, etc., but before the usage of *_OBJS. -include ../../Makefile.common +include @top_srcdir@/Makefile.common gnome: default diff --git a/src/register/Makefile.in b/src/register/Makefile.in index 7e09b78f14..576bc2ecb5 100644 --- a/src/register/Makefile.in +++ b/src/register/Makefile.in @@ -21,10 +21,8 @@ # Address: 609 8th Street # Huntington Beach, CA 92648-4632 -srcdir = @srcdir@ -VPATH = @srcdir@ -CC = @CC@ -RANLIB = @RANLIB@ +include @top_srcdir@/Makefile.init + INCLPATH = -I@srcdir@/../.. \ -I@srcdir@/../../include \ -I@srcdir@/../engine \ @@ -56,7 +54,7 @@ all: # This inclusion must come after the first target, and after the # definitions of *_SRCS, etc., but before the usage of *_OBJS. -include ../../Makefile.common +include @top_srcdir@/Makefile.common motif: ${MOTIF_OBJS} diff --git a/src/scm/Makefile.in b/src/scm/Makefile.in new file mode 100644 index 0000000000..9319ae2c05 --- /dev/null +++ b/src/scm/Makefile.in @@ -0,0 +1,38 @@ +# Makefile -- makefile for gnucash/scm +# Copyright (C) 1998 Rob Browning +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +include @top_srcdir@/Makefile.init + +###################################################################### +# See Makefile.common for information about these variables. +# +###################################################################### + +all: default + +# This inclusion must come after the first target, and after the +# definitions of *_SRCS, etc., but before the usage of *_OBJS. +include @top_srcdir@/Makefile.common + +default: + @echo Nothing to do. + +.PHONY: default + +# Local Variables: +# tab-width: 2 +# End: diff --git a/src/scm/startup.scm.in b/src/scm/startup.scm.in index 68ac58882f..5bb4caa2b1 100644 --- a/src/scm/startup.scm.in +++ b/src/scm/startup.scm.in @@ -16,10 +16,8 @@ (primitive-load boot-file)) ;; Automatically generated defaults... -(define gnc:_config-dir-default_ "@GNC_CONFIG_DIR_DEFAULT@") -(define gnc:_share-dir-default_ "@GNC_SHARE_DIR_DEFAULT@") -(define gnc:_doc-dir-default_ "@GNC_SHARE_DIR_DEFAULT@/Docs - @GNC_SHARE_DIR_DEFAULT@/Reports") +(define gnc:_config-dir-default_ "@GNC_RUNTIME_CONFIGDIR@") +(define gnc:_share-dir-default_ "@GNC_RUNTIME_SHAREDIR@") (define gnc:*command-line-files* #f) @@ -368,10 +366,10 @@ default directory. i.e. (gnc:config-var-value-set! gnc:*doc-path* (list result) #f)))) equal? - (list - (string-append "(" (getenv "HOME") "/.gnucash/doc)") - (string-append "(" gnc:_doc-dir-default_ ")")))) - + (list + (string-append "(" (getenv "HOME") "/.gnucash/doc)") + (string-append "(" gnc:_share-dir-default_ "/Docs)") + (string-append "(" gnc:_share-dir-default_ "/Reports)")))) (define gnc:*prefs* (list diff --git a/src/swig/Makefile.in b/src/swig/Makefile.in index 42b6d54391..13d08f2628 100644 --- a/src/swig/Makefile.in +++ b/src/swig/Makefile.in @@ -16,11 +16,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # These three lines are suggested defs for autoconf (see the info pages). -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -HAVE_PLOTUTILS=@HAVE_PLOTUTILS@ +include @top_srcdir@/Makefile.init ###################################################################### # See Makefile.common for information about these variables. diff --git a/src/swig/guile/Makefile.in b/src/swig/guile/Makefile.in index 101ad446d9..8e4cc1fbf2 100644 --- a/src/swig/guile/Makefile.in +++ b/src/swig/guile/Makefile.in @@ -17,12 +17,8 @@ # These three lines are suggested defs for autoconf (see the info pages). -@SET_MAKE@ -srcdir = @top_srcdir@ -prefix = @prefix@ -VPATH = @top_srcdir@ +include @top_srcdir@/Makefile.init -CC = @CC@ INCLPATH = \ -I. \ -I@top_srcdir@/src \ @@ -38,8 +34,6 @@ INCLPATH = \ CFLAGS = @CFLAGS@ @X_CFLAGS@ -DCELL_WIDGETS=1 ${INCLPATH} -HAVE_PLOTUTILS=@HAVE_PLOTUTILS@ - ###################################################################### # SEE Makefile.common for information about these variables. INDEP_SRCS = gnucash-all-guile_wrap.c gnucash-engine-guile_wrap.c