# CDB Generation makefile by Marc MERLIN # If you have large index files, you'll want to use cdb and regenerate the # files with make every time you change the source text file. VDIR=virtualsrc OVDIR=virtualoverlaysrc VCDBDIR=virtualcdb OVCDBDIR=virtualoverlaycdb VZONES=$(wildcard $(VDIR)/*) OVZONES=$(wildcard $(OVDIR)/*) CDBVZONES=$(shell echo $(VZONES) | sed "s/src\//cdb\//g") CDBOVZONES=$(shell echo $(OVZONES) | sed "s/src\//cdb\//g") all: $(CDBVZONES) $(CDBOVZONES) # With exim4's dsearch, no need to build an index of all the files # Left behind just in case you wanted to use with exim 3 # #all: virtualdomainlist virtualdomainlist_overlay $(CDBVZONES) $(CDBOVZONES) # #virtualdomainlist: $(VZONES) # @echo -e '# Domains listed here need to have a mapping for every single address for\n# that domain (including root and postmaster). Any Email not listed in the\n# mapping file will bounce.\n\n# **** FILE IS AUTOGENERATED ****\n' > virtualdomainlist # @ls -1 $(VDIR) >> virtualdomainlist # #virtualdomainlist_overlay: $(OVZONES) # @echo -e '# Domains listed here have an Email "overlay". The virtualuser table is looked\n# up first, but if the lookup fails and the account exists locally, mail is\n# accepted too.\n\n#**** FILE IS AUTOGENERATED ****\n' > virtualdomainlist_overlay # @ls -1 $(OVDIR) >> virtualdomainlist_overlay $(VCDBDIR)/%: $(VDIR)/% @echo "Rebuilding cdb file for $@" @cat $? | ./aliastocdbsrc | cdbmake $@ $@.tmp $(OVCDBDIR)/%: $(OVDIR)/% @echo "Rebuilding cdb file for $@" @cat $? | ./aliastocdbsrc | cdbmake $@ $@.tmp