# integrit - file integrity verification system # Copyright (C) 2006 Ed L. Cashin # # 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 (at your option) 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. # # autoconf stuff for possible future recursive makes prefix = exec_prefix = ${prefix} srcdir = . # we aren't using VPATH # VPATH = . CC = cc LIBRARY = libhashtbl.a SBINDIR = ${exec_prefix}/sbin OBJ = hashtbl.o hfree.o hgrow.o hhash.o hforeach.o CPPFLAGS = -I. -I$(srcdir) CFLAGS = -fno-common -D__FUNCTION__=__FILE__ -D__FUNCTION__=__FILE__ LDFLAGS = -L. DEFS = -DHAVE_CONFIG_H LIBS = -lhashtbl INSTALL = /usr/bin/install -c -o root -g wheel STRIP = -s RANLIB = ranlib AR = /usr/bin/ar RANLIB = ranlib RM = /usr/local/bin/rm .PHONY : clean dep COMPILE = \$${CC} \$${CPPFLAGS} \$${CFLAGS} \$${DEFS} -o \$$@ -c # \$$< $(LIBRARY) : $(OBJ) ${AR} r $(LIBRARY) $(OBJ) ${RANLIB} $@ distready : $(srcdir)/dep.mak dep : $(srcdir)/dep.mak $(srcdir)/dep.mak :: @printf ' >>> recording dependencies for hashtbl: ' cd ${srcdir} \ && echo '# generated by Makefile' > dep.mak \ && hfiles=; hdeps=; for f in *.c; do \ hfiles=`sed -n 's/#include *[<"]\(.*\.h\)[">]/\1/p' $$f | xargs`; \ for h in $$hfiles; do \ if test ! $$h = config.h -a -r $$h; then \ hdeps="$$hdeps \$${srcdir}/$$h"; \ fi; \ done; \ obj=`echo $$f | sed -e 's/\.c\$$/.o/'`; \ printf "%s\n\t%s\n" \ "$$obj : \$${srcdir}/$$f $$hdeps Makefile" \ "${COMPILE} \$${srcdir}/$$f"; \ done >> dep.mak # cd $(srcdir) \ # && > $(srcdir)/dep.mak \ # && $(CC) $(CPPFLAGS) $(DEFS) -MM *.c | $(srcdir)/../trdeps >> dep.mak \ # && for f in *.c; do \ # obj=`echo $$f | sed 's/\.c$$/.o/'`; \ # printf "%s: %s\n\t%s\n" \ # "$$obj" "\$$(srcdir)/$$f Makefile \$$(srcdir)/leakfind.h" \ # "$(COMPILE)" >> $(srcdir)/dep.mak; \ # done hashtest : hashtest.o $(LIBRARY) $(CC) -o $@ hashtest.o $(LDFLAGS) $(LIBS) include $(srcdir)/dep.mak # .c.o : # $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) -o $@ -c $< clean : ${RM} -f $(OBJ) $(LIBRARY) hashtest hashtest.o realclean : clean ${RM} -f *~ core a.out distclean : clean ${RM} -f config.cache config.status config.log config.h ${RM} -f Makefile stdint.h install : $(LIBRARY) @for d in ${exec_prefix}/lib ${prefix}/include; do \ if test ! -d $$d; then \ echo "creating directory $$d"; \ $(INSTALL) -d -m 755 $$d; \ fi \ done $(INSTALL) $(STRIP) -m 644 $< ${exec_prefix}/lib/$< $(INSTALL) hashtbl.h ${prefix}/include/hashtbl.h