makefile and build fixes and corrections from Rob Browning

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1141 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-09-11 06:19:26 +00:00
parent b7c20b1354
commit 9b2ee34cf9
8 changed files with 127 additions and 73 deletions

View File

@ -1,4 +1,4 @@
# Makefile -- makefile for xacc
# Makefile -- makefile for gnucash
# Copyright (C) 1997 Robin Clark
# Copyright (C) 1998 Rob Browning <rlb@cs.utexas.edu>
#
@ -26,13 +26,14 @@ VPATH = @srcdir@
prefix=@prefix@
datadir=@datadir@
VARDIR=@localstatedir@
CONFIGDIR=@sysconfdir@
# i.e. /usr/share
localstatedir=@localstatedir@
# i.e. /var/
sysconfdir=@sysconfdir@
# i.e. /etc/
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
TARGET = xacc
DOCDIR = ${datadir}/Docs
CPU = @target_cpu@
LIBS=@LIBS@
@ -52,29 +53,37 @@ default:
@echo "motif dynamically linked motif version"
@echo "motif-static statically linked motif version"
@echo "gnome gnome/gtk version"
@echo "gnome-static gnome/gtk statically linked version"
@echo "qt kde/qt version"
@echo " "
motif:
@cd lib; $(MAKE) motif
@cd src; $(MAKE) motif
# Aliases
motif-static: motif.static
gnome-static: gnome.static
# link in motif libs statically
motif-static:
@cd lib; $(MAKE) motif
@cd src; $(MAKE) motif-static
build-flavor:
@cd lib; $(MAKE) ${FLAVOR}
@cd src; $(MAKE) ${FLAVOR}
ln -sf gnucash.${FLAVOR} gnucash.bin
(cd share && ln -sf ../src/scm scm)
motif:
${MAKE} FLAVOR=motif build-flavor
motif.static:
${MAKE} FLAVOR=motif.static build-flavor
gnome:
@cd lib; $(MAKE) gnome
@cd src; $(MAKE) gnome
${MAKE} FLAVOR=gnome build-flavor
gnome.static:
${MAKE} FLAVOR=gnome.static build-flavor
qt:
@cd lib; $(MAKE) qt
@cd src; $(MAKE) qt
${MAKE} FLAVOR=qt build-flavor
depend:
@cd lib; $(MAKE) depend
@cd src; $(MAKE) depend
@echo make depend is now superfluous.
clean:
rm -f *~ *.o *.bak
@ -82,8 +91,9 @@ clean:
@cd src; $(MAKE) clean
distclean: clean
rm -f *~ *.o *.bak Makefile
rm -f xacc xacc.bin xacc.gtk.bin xacc.qt.bin xacc.static.bin
rm -f *~ *.o *.bak Makefile share/scm gnucash.bin
rm -f gnucash gnucash.motif gnucash.motif.static \
gnucash.gnome gnucash.gnome.static gnucash.qt
rm -f config.cache config.log config.status config.h
@cd lib; $(MAKE) distclean
@cd src; $(MAKE) distclean
@ -93,27 +103,73 @@ tagsfiles := $(shell find -name "*.[ch]")
TAGS: ${tagsfiles}
etags ${tagsfiles}
install: $(TARGET)
@mkdir -p $(prefix)/bin
$(INSTALL) $(TARGET) $(prefix)/bin/$(TARGET)
-$(INSTALL) $(TARGET).bin $(prefix)/bin/$(TARGET).bin
-$(INSTALL) $(TARGET).gtk.bin $(prefix)/bin/$(TARGET).gtk.bin
-$(INSTALL) $(TARGET).qt.bin $(prefix)/bin/$(TARGET).qt.bin
-$(INSTALL) $(TARGET).static.bin $(prefix)/bin/$(TARGET).static.bin
install:
${MAKE} \
DOCDIR=${prefix}/doc/gnucash \
BINDIR=${prefix}/bin \
CONFIGDIR=${sysconfdir}/gnucash \
SHAREDIR=${datadir}/gnucash \
install-private
install-opt:
${MAKE} \
DOCDIR=${prefix}/doc \
BINDIR=${prefix}/bin \
CONFIGDIR=${sysconfdir} \
SHAREDIR=${datadir} \
install-private
# We have to re-build the binary here to pick up any modifications to
# the ./configure configuration and to accomodate install vs
# install-opt. The other option would be to always use a wrapper
# script, even in the install tree, but that's IMO uglier.
# We could get rid of some redundant rebuilds with a
# stamp-install-opt-build, but that's somewhat messy too.
gnucash.motif gnucash.motif.static gnucash.gnome gnucash.gnome.static:
@echo Rebuilding binary to handle install site specific dependencies.
rm -f gnucash.${FLAVOR}
${MAKE} DOCDIR=${DOCDIR} BINDIR=${BINDIR} CONFIGDIR=${CONFIGDIR} \
SHAREDIR=${SHAREDIR} ${FLAVOR}
.PHONY: gnucash.motif gnucash.motif.static gnucash.gnome gnucash.gnome.static
install-bin: gnucash.${FLAVOR}
$(INSTALL) gnucash.${FLAVOR} ${BINDIR}/gnucash.${FLAVOR}
(cd ${BINDIR} && ln -sf gnucash.${FLAVOR} gnucash)
install-private:
@mkdir -p ${BINDIR}
# Put these in the opposite order of precedence. Final bin/gnucash link will
# point to the last one that exists...
-[ -e gnucash.qt ] && ${MAKE} FLAVOR=qt BINDIR=${BINDIR} install-bin
-[ -e gnucash.gnome.static ] && \
${MAKE} FLAVOR=gnome.static BINDIR=${BINDIR} install-bin
-[ -e gnucash.gnome ] && ${MAKE} FLAVOR=gnome BINDIR=${BINDIR} install-bin
-[ -e gnucash.motif.static ] && \
${MAKE} FLAVOR=motif.static BINDIR=${BINDIR} install-bin
-[ -e gnucash.motif ] && ${MAKE} FLAVOR=motif BINDIR=${BINDIR} install-bin
# Make sure at least one succeeded
[ -e ${TARGET}.bin -o -${TARGET}.gtk.bin -o -${TARGET}.qt.bin \
-o -${TARGET}.static.bin ]
[ \
-e ${BINDIR}/gnucash.motif -o \
-e ${BINDIR}/gnucash.motif.static -o \
-e ${BINDIR}/gnucash.gnome -o \
-e ${BINDIR}/gnucash.gnome.static -o \
-e ${BINDIR}/gnucash.qt \
]
# @mkdir -p $(prefix)/toolbar
# $(INSTALL_DATA) toolbar/*.xpm $(prefix)/toolbar
@mkdir -p $(DOCDIR)
$(INSTALL_DATA) Docs/*.html $(DOCDIR)
$(INSTALL_DATA) Docs/*.gif $(DOCDIR)
# $(INSTALL_DATA) Docs/*.jpg $(DOCDIR)
$(INSTALL_DATA) Docs/*.xpm $(DOCDIR)
@mkdir -p $(DOCDIR)/logos
$(INSTALL_DATA) Docs/logos/*.* $(DOCDIR)/logos
@mkdir -p ${DOCDIR}
$(INSTALL_DATA) Docs/*.html ${DOCDIR}
$(INSTALL_DATA) Docs/*.gif ${DOCDIR}
# $(INSTALL_DATA) Docs/*.jpg ${DOCDIR}
$(INSTALL_DATA) Docs/*.xpm ${DOCDIR}
@mkdir -p ${DOCDIR}/logos
$(INSTALL_DATA) Docs/logos/*.* ${DOCDIR}/logos
# Config directory
@mkdir -p ${CONFIGDIR}
@ -132,21 +188,24 @@ install: $(TARGET)
done
# Share directory
@mkdir -p ${datadir}
@mkdir -p ${SHAREDIR}
# Try to do this in a platform independent way...
# Directories
for dir in `find share/scm/ -type d`; do \
dest=`echo $$dir | cut -c 11-` \
mkdir -p ${datadir}/scm/$$dest; \
mkdir -p ${SHAREDIR}/scm/$$dest; \
done
# Files
for file in `find share/scm/ -name "*.scm"`; do \
dest=`echo $$file | cut -c 11-` \
${INSTALL_DATA} $$file ${datadir}/scm/$$dest; \
${INSTALL_DATA} $$file ${SHAREDIR}/scm/$$dest; \
done
.PHONY: default install-private install motif motif-static gnome gnome-static qt
.PHONY: depend clean distclean
# Local Variables:
# tab-width: 2
# End:

View File

@ -97,6 +97,6 @@ AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
# *******************************************
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(xacc Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile)
AC_OUTPUT(gnucash Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile)
chmod +x xacc
chmod +x gnucash

14
gnucash.in Normal file
View File

@ -0,0 +1,14 @@
#! /bin/sh
# @configure_input@
GNC_ARGS="${GNC_ARGS} --debug"
GNC_ARGS="${GNC_ARGS} --startup-file ./share/scm/startup.scm"
GNC_ARGS="${GNC_ARGS} --share-dir ./share"
GNC_ARGS="${GNC_ARGS} --config-dir ./etc"
GNC_ARGS="${GNC_ARGS} --load-path (\"(./share/scm)\")"
XACC_HELP=${XACC_HELP}:./doc
export XACC_HELP
# Run whichever one was built last.
exec gnucash.bin ${GNC_ARGS} $@

View File

@ -1,4 +1,4 @@
# Makefile -- makefile for xacc/src
# Makefile -- makefile for gnucash/src
# Copyright (C) 1997 Robin Clark
# Copyright (C) 1998 Rob Browning <rlb@cs.utexas.edu>
#

View File

@ -46,11 +46,11 @@ include ../../Makefile.common
default: ../libengine.a
../libengine.a: ${OBJS}
ar vru libengine.a ${OBJS}
cp -p libengine.a ..
(cd .. && ln -sf engine/libengine.a .)
TRASH += ../libengine.a libengine.a
.PHONY: all default

View File

@ -1,4 +1,4 @@
# Makefile -- makefile for xacc/src/gnome
# Makefile -- makefile for gnucash/src/gnome
# Copyright (C) 1997 Robin Clark
# Copyright (C) 1998 Linas Vepstas
# Copyright (C) 1998 Rob Browning <rlb@cs.utexas.edu>
@ -34,21 +34,21 @@ CC = @CC@
INCLPATH = -I.. -I../.. -I../engine -I../register -I../guile \
-I@srcdir@/../../include \
-I$(includedir) -I$(prefix)/lib/gnome-libs/include
CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH}
LDFLAGS = @LDFLAGS@
LIBS = -L$(prefix)/lib @LIBS@ @X_PRE_LIBS@ @X_LIBS@ \
$(shell gtk-config --libs) @X_EXTRA_LIBS@ -lgnomeui -lgnome \
-lgnomesupport -lgdk_imlib -ltiff -lgif \
-lguile -lreadline -lintl
-lgnomesupport -lgdk_imlib -ltiff \
-lguile -lqthreads -lreadline -lintl
TARGET = ../../xacc.gtk.bin
STATIC = ../../xacc-static.gtk.bin
TARGET = ../../gnucash.gnome
STATIC = ../../gnucash.gnome.static
OTHER_OBJS := ../obj/gnome/*.o ../engine/obj/*.o ../register/obj/gnome/*.o \
../guile/obj/*.o
../guile/obj/*.o ../swig/guile/gnucash-guile_wrap.o
######################################################################
# See Makefile.common for information about these variables.
@ -64,7 +64,7 @@ include ../../Makefile.common
gnome: default
static: $(STATIC)
gnome.static: $(STATIC)
$(TARGET): ${GNOME_OBJS} ${OTHER_OBJS}
$(CC) $(LDFLAGS) $(LIBS) -o $@ $^

View File

@ -35,10 +35,11 @@
#include "util.h"
#include "MainWindow.h"
#include "../guile/path-defaults.h"
/** HELP STUFF: *****************************************************/
#define HELP_VAR "XACC_HELP"
#define HELP_ROOT "./Docs/"
#define HELP_ROOT GNC_DOC_DIR_DEFAULT
#define HH_ABOUT "xacc-about.html"
#define HH_ACC "xacc-accwin.html"
#define HH_REGWIN "xacc-regwin.html"

20
xacc.in
View File

@ -1,20 +0,0 @@
#! /bin/sh
# @configure_input@
GNC_ARGS="${GNC_ARGS} --debug"
GNC_ARGS="${GNC_ARGS} --startup-file ./share/scm/startup.scm"
GNC_ARGS="${GNC_ARGS} --share-dir ./share"
GNC_ARGS="${GNC_ARGS} --config-dir ./etc"
GNC_ARGS="${GNC_ARGS} --load-path (\"(./share/scm)\")"
XACC_HELP=${XACC_HELP}:./Docs:@prefix@/share/xacc/Docs
export XACC_HELP
# hack alert -- we should really be using ldconfig to look for
# the motif library. We should also do something to auto-detect
# and load the gtk version.
if [ -f /usr/X11R6/lib/libXm.so -o -L /usr/X11R6/lib/libXm.so ]; then
exec xacc.bin ${GNC_ARGS} $@
else
exec xacc-static.bin ${GNC_ARGS} $@
fi