-ECHO_CMD=@
+c+ECHO_CMD=@
DIRS= dll \
cats \
exit 1; \
fi ; \
$(ECHO_CMD)BUILDDIR=`(pwd)`; \
+ $(ECHO_CMD)MAINDIR=`(cd ../..;pwd)`; \
sed \
-e "s^@BUILDDIR@^$${BUILDDIR}^" \
+ -e "s^@MAINDIR@^$${MAINDIR}^" \
-e "s^@TOPDIR@^$${TOPDIR}^" \
-e "s^@BINDIR@^$${BINDIR}^" \
-e "s^@INCDIR@^$${INCDIR}^" \
# Using MinGW cross-compiler on GNU/Linux
#
# Written by Robert Nelson, June 2006
+# Absolute paths used in place of relative paths
+# Kern Sibbald, October 2008
#
# Global Configuration
ECHO_CMD = @
+# Main Bacula source dir
+MAINDIR := @MAINDIR@
+#
+# Build dir -- i.e. normally src/win32
BUILDDIR := @BUILDDIR@
+#
+# Dir above Bacula where we find depkgs
TOPDIR := @TOPDIR@
+#
+# where we find depkgs
DEPKGS := $(TOPDIR)/depkgs-mingw32
DOCDIR := $(TOPDIR)/docs
-BINDIR := ../release
-LIBDIR := ../release
+BINDIR := $(BUILDDIR)/release
+LIBDIR := $(BUILDDIR)/release
OBJDIR := .
MINGW_BIN := @BINDIR@
LDFLAGS := -g -Wall -mno-cygwin -Wl,--disable-auto-import
INCLUDE_DDK := -I$(MINGW_INCLUDE)/ddk
-INCLUDE_BACULA := -I../.. -I../compat
+INCLUDE_BACULA := -I$(MAINDIR)/src -I$(BUILDDIR)/compat
INCLUDE_PTHREADS := -I$(DEPKGS)/include/pthreads
INCLUDE_ZLIB := -I$(DEPKGS)/include
INCLUDE_VSS := -I$(DEPKGS)/vss
$(HAVES)
# Replace MODULE with the directory in the main Bacula tree containing the source
-VPATH = ../../MODULE
+VPATH = $(MAINDIR)
##########################################################################
DEFINES = \
$(HAVES)
-vpath %.c ../../cats
-vpath %.cpp ../../cats
+vpath %.c $(MAINDIR)/src/cats
+vpath %.cpp $(MAINDIR)/src/cats
######################################################################
$(eval $(call Link_Dll,cats_postgresql,POSTGRESQL))
$(eval $(call Link_Dll,cats_sqlite3,SQLITE3))
-
-DUSING_DLL \
$(HAVES)
-vpath %.c ../../console
-vpath %.cpp ../../console
+vpath %.c $(MAINDIR)/src/console
+vpath %.cpp $(MAINDIR)/src/console
##########################################################################
-DWINVER=0x500 \
$(HAVES)
-vpath %.c ../../dird ../libwin32
-vpath %.cpp ../../dird ../libwin32
+vpath %.c $(MAINDIR)/src/dird $(BUILDDIR)/libwin32
+vpath %.cpp $(MAINDIR)/src/dird $(BUILDDIR)/libwin32
##########################################################################
DEFINES = \
$(HAVES)
-vpath %.c ../compat ../../findlib ../../lib
-vpath %.cpp ../compat ../../findlib ../../lib
+vpath %.c $(BUILDDIR)/compat $(MAINDIR)/src/findlib $(MAINDIR)/src/lib
+vpath %.cpp $(BUILDDIR)/compat $(MAINDIR)/src/findlib $(MAINDIR)/src/lib
######################################################################
-DWINVER=0x500 \
$(HAVES)
-vpath %.c ../../filed ../libwin32
-vpath %.cpp ../../filed ../libwin32
+vpath %.c $(MAINDIR)/src/filed $(BUILDDIR)/libwin32
+vpath %.cpp $(MAINDIR)/src/filed $(BUILDDIR)/libwin32
##########################################################################
INCLUDES = \
-I. \
- -I../../stored \
+ -I$(MAINDIR)/src/stored \
$(INCLUDE_DDK) \
$(INCLUDE_PTHREADS) \
$(INCLUDE_BACULA) \
-DWINVER=0x500 \
$(HAVES)
-vpath %.c ../../stored ../libwin32
-vpath %.cpp ../../stored ../libwin32
+vpath %.c $(MAINDIR)/src/stored $(BUILDDIR)/libwin32
+vpath %.cpp $(MAINDIR)/src/stored $(BUILDDIR)/libwin32
##########################################################################
LDFLAGS:=$(LDFLAGS) -lstdc++
-vpath %.c ../../tools ../../dird
-vpath %.cpp ../../tools ../../dird
+vpath %.c $(MAINDIR)/src/tools $(MAINDIR)/src/dird
+vpath %.cpp $(MAINDIR)/src/tools $(MAINDIR)/src/dird
##########################################################################
-D_STAT_DEFINED \
$(HAVES)
-vpath %.c ../../wx-console
-vpath %.cpp ../../wx-console
-vpath %.rc ../../wx-console
+vpath %.c $(MAINDIR)/src/wx-console
+vpath %.cpp $(MAINDIR)/src/wx-console
+vpath %.rc $(MAINDIR)/src/wx-console
##########################################################################
-# Files in ../../wx-console
+# Files in $(MAINDIR)/src/wx-console
CONSOLE_OBJS = \
$(OBJDIR)/authenticate.o \
$(OBJDIR)/wx-console_private.res: wx-console_private.rc
@echo "Compiling $@"
$(call checkdir,$@)
- $(ECHO_CMD)$(WINDRES) $(INCLUDE_ICONS) -I../../wx-console -O coff $< -o $@
+ $(ECHO_CMD)$(WINDRES) $(INCLUDE_ICONS) -I$(MAINDIR)/src/wx-console -O coff $< -o $@
include ../Makefile.rules
General:
+22Oct08
+kes Modify win32 Makefiles to use full paths in most cases.
+ In particular add MAINDIR environment variable that points
+ to the main Bacula source directory.
21Oct08
kes Add read volume list code to SD -- not yet used.
kes Add James' binutils patch