$(MAKE) -C deity $@
$(MAKE) -C gui $@
$(MAKE) -C doc $@
+
+.PHONY: maintainer-clean dist-clean distclean pristine sanity
+maintainer-clean dist-clean distclean pristine sanity: veryclean
--- /dev/null
+The Make System
+~~~ ~~~~ ~~~~~~
+To compile this program you require GNU Make. In fact you probably need
+GNU Make 3.76.1 or newer. The makefiles contained make use of many
+GNU Make specific features and will not run on other makes.
+
+The make system has a number of interesting properties that are not found
+in other systems such as automake or the GNU makefile standards. In
+general some semblance of expectedness is kept so as not to be too
+surprising. Basically the following will work as expected:
+
+ ./configure
+ make
+ or
+ cd build
+ ../configure
+ make
+
+There are a number of other things that are possible that may make software
+development and software packaging simpler. The first of these is the
+environment.mak file. When configure is run it creates an environment.mak
+file in the build directory. This contains -all- configurable parameters
+for all of the make files in all of the subdirectories. Changing one
+of these parameters will have an immediate effect. The use of makefile.in
+and configure substitutions across build makefiles is not used at all.
+
+Furthermore, the make system runs with a current directory equal to the
+source directory irregardless of the destination directory. This means
+#include "" and #include <> work as epected and more importantly
+running 'make' in the source directory will work as expected. The
+environment variable or make parameter 'BUILD' sets the build directory.
+It may be an absolute path or a path relative to the top level directory.
+By default build/ will be used with a fall back to ./ This means
+you can get all the advantages of a build directory without having to
+cd into it to edit your source code!
+
+The make system also performs dependency generation on the fly as the
+compiler runs. This is extremely fast and accurate. There is however
+one failure condition that occures when a header file is erased. In
+this case you should run make clean to purge the .o and .d files to
+rebuild.
+
+The final significant deviation from normal make practicies is
+in how the build directory is managed. It is not mearly a mirror of
+the source directory but is logically divided in the following manner
+ bin/
+ methods/
+ doc/
+ examples/
+ include/
+ apt-pkg/
+ deity/
+ obj/
+ apt-pkg/
+ deity/
+ cmndline/
+ [...]
+Only .o and .d files are placed in the obj/ subdirectory. The final compiled
+binaries are placed in bin, published headers for inter-component linking
+are placed in include/ and documentation is generated into doc/. This means
+all runnable programs are within the bin/ directory a huge benifit for
+debugging inter-program relationships. The .so files are also placed in
+bin/ for simplicity.
+
+Using the makefiles
+~~~~~ ~~~ ~~~~~~~~~
+The makefiles for the components are really simple. The complexity is hidden
+within the buildlib/ directory. Each makefile defines a set of make variables
+for the bit it is going to make then includes a makefile fragment from
+the buildlib/. This fragment generates the necessary rules based on the
+originally defined variables. This process can be repeated as many times as
+necessary for as many programs or libraries as are in the directory.
+
+Many of the make fragments have some useful properties involving sub
+directories and other interesting features. They are more completely
+described in the fragment code in buildlib. Some tips on writing fragments
+are included in buildlib/defaults.mak
+
+Jason
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-worker.cc,v 1.2 1998/10/20 02:39:13 jgg Exp $
+// $Id: acquire-worker.cc,v 1.3 1998/10/20 04:33:12 jgg Exp $
/* ######################################################################
Acquire Worker
#include <unistd.h>
#include <signal.h>
+#include <wait.h>
/*}}}*/
// Worker::Worker - Constructor for Queue startup /*{{{*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: algorithms.cc,v 1.6 1998/10/20 02:39:17 jgg Exp $
+// $Id: algorithms.cc,v 1.7 1998/10/20 04:33:13 jgg Exp $
/* ######################################################################
Algorithms - A set of misc algorithms
// Look at all the possible provides on this package
pkgCache::Version **VList = End.AllTargets();
- bool Done = false;
for (pkgCache::Version **V = VList; *V != 0; V++)
{
pkgCache::VerIterator Ver(Cache,*V);
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: fileutl.cc,v 1.9 1998/10/20 02:39:28 jgg Exp $
+// $Id: fileutl.cc,v 1.10 1998/10/20 04:33:16 jgg Exp $
/* ######################################################################
File Utilities
void SetNonBlock(int Fd,bool Block)
{
int Flags = fcntl(Fd,F_GETFL);
- if (fcntl(Fd,F_SETFL,(Block == false)?0:O_NONBLOCK) != 0)
+ if (fcntl(Fd,F_SETFL,(Flags & ~O_NONBLOCK) | (Block == false)?0:O_NONBLOCK) != 0)
{
cerr << "FATAL -> Could not set non-blocking flag " << strerror(errno) << endl;
exit(100);
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcache.cc,v 1.11 1998/10/08 05:05:05 jgg Exp $
+// $Id: pkgcache.cc,v 1.12 1998/10/20 04:33:14 jgg Exp $
/* ######################################################################
Package Cache - Accessor code for the cache
const char *pkgCache::DepIterator::CompType()
{
const char *Ops[] = {"","<=",">=","<",">","=","!="};
- if ((Dep->CompareOp & 0xF) < sizeof(Ops))
+ if ((unsigned)(Dep->CompareOp & 0xF) < sizeof(Ops))
return Ops[Dep->CompareOp & 0xF];
return "";
}
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: sourcelist.cc,v 1.7 1998/10/20 02:39:24 jgg Exp $
+// $Id: sourcelist.cc,v 1.8 1998/10/20 04:33:15 jgg Exp $
/* ######################################################################
List of Sources
debugging. */
ostream &operator <<(ostream &O,pkgSourceList::Item &Itm)
{
- O << Itm.Type << ' ' << Itm.URI << ' ' << Itm.Dist << ' ' << Itm.Section;
+ O << (int)Itm.Type << ' ' << Itm.URI << ' ' << Itm.Dist << ' ' << Itm.Section;
return O;
}
/*}}}*/
# Search for the build directory
ifdef BUILD
-BUILD_POSSIBLE = $(BUILD)
+BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
else
-BUILD_POSSIBLE = $(BASE) $(BASE)/build
+BUILD_POSSIBLE := $(BASE) $(BASE)/build
endif
-BUILD:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak))
-BUILD:= $(patsubst %/,%,$(firstword $(dir $(BUILD))))
+BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
+BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
-ifeq ($(words $(BUILD)),0)
+ifeq ($(words $(BUILDX)),0)
error-all:
echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
endif
+override BUILD := $(BUILDX)
+
# Base definitions
INCLUDE := $(BUILD)/include
BIN := $(BUILD)/bin
# Phony rules. Other things hook these by appending to the dependency
# list
.PHONY: headers library clean veryclean all binary program doc
+.PHONY: maintainer-clean dist-clean distclean pristine sanity
all: binary doc
binary: library program
maintainer-clean dist-clean distclean pristine sanity: veryclean
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.3 1998/10/19 23:45:36 jgg Exp $
+// $Id: apt-get.cc,v 1.4 1998/10/20 04:33:18 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
pkgCache::PkgIterator I = Dep.PkgBegin();
string List;
bool *Added = new bool[Dep.HeaderP->PackageCount];
- for (int I = 0; I != Dep.HeaderP->PackageCount; I++)
+ for (unsigned int I = 0; I != Dep.HeaderP->PackageCount; I++)
Added[I] = false;
for (;I.end() != true; I++)
return false;
// Do the upgrade
- pkgProblemResolver Resolve(Cache);
if (pkgAllUpgrade(Cache) == false)
{
ShowBroken(c1out,Cache);