# imapd/Makefile # This file is part of Decimail; see http://decimail.org # (C) 2004 Philip Endecott # 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 # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. default_target: all include ../libpbe.mk EXECUTABLE=dmimapd CC_SRCS=$(wildcard *.cc) CC_SRCS+=parse_imap_command.tab.c scan_imap_command.c OBJS=$(addsuffix .o,$(basename $(CC_SRCS))) DEPENDS=$(addsuffix .d,$(basename $(CC_SRCS))) -include $(DEPENDS) WARN_FLAGS=-W -Wall OPTIMISE_FLAGS=-O DEBUG_FLAGS=-g PG_INC_FLAGS=-I$(shell pg_config --includedir) INC_FLAGS=-I../common $(LIBPBE_INC) $(PG_INC_FLAGS) CPP_FLAGS=-D_REENTRANT $(INC_FLAGS) COMPILE=g++ COMPILE_FLAGS=$(WARN_FLAGS) $(OPTIMISE_FLAGS) $(DEBUG_FLAGS) $(CPP_FLAGS) LINK=g++ PG_LINK_FLAGS=-L$(shell pg_config --libdir) LINK_FLAGS=-pthread -L$(LIBPBE_LIBDIR) $(PG_LINK_FLAGS) -lboost_system COMMON_LIB=../common/common.a $(COMMON_LIB): FORCE cd $(dir $(COMMON_LIB)); $(MAKE) $(notdir $(COMMON_LIB)) LIBS=-lpq -lmimetic -lpbe -lrecode $(EXECUTABLE): $(OBJS) $(COMMON_LIB) $(LINK) $(LINK_FLAGS) -o $(EXECUTABLE) $(OBJS) $(COMMON_LIB) $(LIBS) %.o: %.cc $(COMPILE) $(COMPILE_FLAGS) -c $< %.o: %.c $(COMPILE) $(COMPILE_FLAGS) -c $< %.d: %.cc g++ -MM -MT $@ -MT $(<:%.cc=%.o) $(CPP_FLAGS) -o $@ $< %.d: %.c -g++ -MM -MT $@ -MT $(<:%.c=%.o) $(CPP_FLAGS) -o $@ $< all: $(EXECUTABLE) clean: rm -f *.o \ parse_imap_command.tab.c parse_imap_command.tab.h \ scan_imap_command.c scan_imap_command.h veryclean: clean rm -f *.d $(EXECUTABLE) FORCE: parse_imap_command.tab.c parse_imap_command.tab.h: parse_imap_command.y bison parse_imap_command.y scan_imap_command.c scan_imap_command.h: scan_imap_command.i flex scan_imap_command.i install: install $(EXECUTABLE) /usr/local/sbin