#
# * Copyright (c) 2011 QUALCOMM Incorporated. All rights reserved.
# *
# * File        : mmangle/Makefile.in
# * Project     : Qpopper Server
# * Comments    : 
# *
# *
# * Revisions   :
# *
# * 06/21/08    [rcg]
# *       - Add 'tags' target for ctags call (note: assumes 'ctags' is
# *         installed in /usr/local/bin, so it isn't portable)
# *
# * 02/03/03    [rcg]
# *       -  Pick up LDFLAGS.
# *
# *  06/30/00   [rcg]
# *        - Updated includes.
# *        - Moved utils to common.
# *        - Fixed gperf stuff for systems w/o gperf.
# *
# *  12/09/99   [rcg]
# *        - Modified for SunOS4 stuff.
# *
# *  05/05/98   [py]
# *         - File added.
# *
#
SHELL           =   /bin/sh
CC              =   gcc
GPERF           =   
GPERFCMD        =   touch etags.c
MAKEFILE        =   Makefile



top_srcdir      =   ..
srcdir          =   .

prefix          =   /usr/pkg
exec_prefix     =   ${prefix}
installdir      =   ${exec_prefix}/bin

common_srcdir   =   ${top_srcdir}/common
popper_srcdir   =   ${top_srcdir}/popper
qd_srcdir       =   ${top_srcdir}/qd
sievead_srcdir  =   ${top_srcdir}/sievead
mmangle_srcdir  =   ${top_srcdir}/mmangle

base_dir        =   ..
common_dir      =   ${base_dir}/common
popper_dir      =   ${base_dir}/popper
qd_dir          =   ${base_dir}/qd
sievead_dir     =   ${base_dir}/sievead
mmangle_dir     =   ${base_dir}/mmangle

INCLUDES	=   ${srcdir}/mime.h ${srcdir}/mangle.h \
		    ${srcdir}/enriched.h ${srcdir}/striphtml.h \
		    ${srcdir}/charmangle.h \
		    ${popper_srcdir}/popper.h \
		    ${base_dir}/config.h \
		    ${top_srcdir}/conf.h \
		    ${common_dir}/logit.h \
		    ${common_dir}/string_util.h \
		    ${common_dir}/utils.h

CFLAGS          =   -O2 -D_FORTIFY_SOURCE=2 -I/usr/include
CDEFS           =   
LDFLAGS         =   -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib
DEFS            =   -DHAVE_CONFIG_H
OS_DEFS         =    -DNETBSD -DUNIX
TARGET          =   @TARGET@
NETWORK_LIBS    =    -lresolv
KERBEROS_LIBS   =   
DBM_LIBS        =   
LIBS            =    -lresolv   -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -lcrypt
AR_FLAG         =    -r 
RANLIB          =   ranlib

OBJS		    = 	mime.o mangle.o enriched.o striphtml.o \
			        lineend.o etags.o charmangle.o

SRCS		    = 	mime.c mangle.c enriched.c striphtml.c \
			        lineend.c etags.c charmangle.c

all: libmangle.a

libmangle.a: ${OBJS}
	ar ${AR_FLAG} $@ ${OBJS} 


.c.o: 
	${CC} -c -I${base_dir} -I${srcdir} -I${top_srcdir} -I${popper_srcdir} \
	    -I${common_srcdir} ${CFLAGS} ${DEFS} ${CDEFS} ${OS_DEFS} $< -o $@

etags.c: etags.gperf
	${GPERFCMD}

${OBJS}: ${INCLUDES}

${SRCS}:

clean:
	rm -f core 
	rm -f ${OBJS} 

realclean: clean
	rm -f libmangle.a
	rm -f Makefile
	rm -f tags TAGS
	rm -f *~

install:
	

tags:
# make tags file per BBEdit recommendation
	/usr/local/bin/ctags --excmd=number --tag-relative=no \
	                     --fields=+a+m+n+S -R `pwd`









