1 ################ Change following ########################
2 ## some other parameters exist in opengatemd.h ########
3 ##########################################################
4 CONFIGPATH = /etc/opengate ## directory of config file
5 INSTALLBINPATH = /usr/local/bin ## install dir of executable file
6 MAKEDIR != pwd ## save present directory
8 .if exists(/usr/local/include/mysql)
9 CFLAGSMYSQL = -I/usr/local/include/mysql -pipe -fno-strict-aliasing
10 LIBMYSQL = -L/usr/local/lib/mysql -lmysqlclient -pthread -lz -lm
13 .if exists(/usr/local/include/sqlite3.h)
14 LIBSQLITE = -lsqlite3 -lpthread
17 ## This is memory leak check tool for debugging
18 #LIBCCMALLOC = -lccmalloc -L/usr/local/lib
20 CFLAGS= -g -O3 -Wall -I/usr/local/include ${CFLAGSMYSQL}
22 LIBS = -lezxml -lpcap -L../ezxml -L/usr/local/lib ${LIBSQLITE} ${LIBMYSQL} ${LIBCCMALLOC}
24 OBJS = util.o error.o getparam.o managementdb.o workdb.c ipfw.o pcap.o packetcache.o macdbcache.o session.o ttlcheck.o udpserv.o watchlistcache.o signal.o
27 MDMAINPROGO = opengatemd.o
28 MDMAINPROG = opengatemd
32 CLEANFILES = *.o *.core a.out
34 all: ${MDMAINPROG} ${LIBOPT}
36 opengatemd: ${OBJS} ${MDMAINPROGO} ${LIBOPT}
37 ${CC} ${CFLAGS} -o $@ ${OBJS} ${MDMAINPROGO} ${LIBS}
42 rm -f ${MDMAINPROG} ${CLEANFILES}
43 ${MAKE} clean -C ../ezxml
44 rm -f *~ ../*/*~ ../*~ ../*/*/*~ #remove emacs backup
45 rm -f \#* ../*/\#* ../\#* ../*/*/\#* #remove emacs autosave
49 install: install-md-prg install-conf rm-lockfile
52 rm -f /tmp/opengatemd.lock
53 rm -f /tmp/opengate.lock
55 install-md-prg: ${MDMAINPROG}
56 ## Install program and Set S bit ##
57 .if !exists(${INSTALLBINPATH})
58 mkdir ${INSTALLBINPATH}
60 cp ${MDMAINPROG} ${INSTALLBINPATH}/${MDMAINPROG}
61 chmod 4755 ${INSTALLBINPATH}/${MDMAINPROG}
62 cp ../rc.d/${MDMAINPROG} /etc/rc.d/${MDMAINPROG}
63 chmod 555 /etc/rc.d/${MDMAINPROG}
67 ## Copy Config files ##
68 .if !exists(${CONFIGPATH})
71 cp ../conf/opengatemd.conf.sample ${CONFIGPATH}
72 cp ../conf/rc.firewall.sample ${CONFIGPATH}
73 cp ../conf/ipfwctrlmd.pl.sample ${CONFIGPATH}
75 #------------------------------------------------------#
76 # COPY above x.sample to x and EDIT it. #
77 # Eg. 'cp opengatemd.conf.sample opengatemd.conf' #
78 #------------------------------------------------------#
81 ${CC} ${CFLAGS} -DMAKEDIR='"${MAKEDIR}"' -c $<
85 mamagementdb.o: ${HDRS}
86 .if !exists(/usr/local/include/mysql)
87 ${CC} ${CFLAGS} -DMYSQL_NOT_INSTALLED -c $<
91 .if !exists(/usr/local/include/sqlite3.h)
92 ${CC} ${CFLAGS} -DSQLITE3_NOT_INSTALLED -c $<
103 packetcache.o: ${HDRS}
105 macdbcache.o: ${HDRS}
117 watchlistcache.o: ${HDRS}