1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#
# ----------------------------------------------------
# httpry - HTTP logging and information retrieval tool
# ----------------------------------------------------
#
# Copyright (c) 2005-2014 Jason Bittel <jason.bittel@gmail.com>
#
DESTDIR?=/usr/local
CC = gcc
CCFLAGS = -Wall -g -DDEBUG -O3 -funroll-loops -I/usr/include/pcap -I/usr/local/include/pcap
DEBUGFLAGS = -Wall -g -DDEBUG -I/usr/include/pcap -I/usr/local/include/pcap
LIBS = -lpcap -lm -pthread
PROG = httpry
FILES = httpry.c format.c methods.c utility.c rate.c
.PHONY: all debug profile install uninstall clean
all: $(PROG)
$(PROG): $(FILES)
$(CC) $(CCFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PROG) $(FILES) $(LIBS)
debug: $(FILES)
@echo "--------------------------------------------------"
@echo "Compiling $(PROG) in debug mode"
@echo ""
@echo "This will cause the program to run slightly"
@echo "slower, but enables additional data verification"
@echo "and sanity checks; recommended for testing, not"
@echo "production usage"
@echo "--------------------------------------------------"
@echo ""
$(CC) $(DEBUGFLAGS) -o $(PROG) $(FILES) $(LIBS)
profile: $(FILES)
@echo "--------------------------------------------------"
@echo "Compiling $(PROG) in profile mode"
@echo ""
@echo "This enables profiling so gprof can be used for"
@echo "code analysis"
@echo "--------------------------------------------------"
@echo ""
$(CC) $(CCFLAGS) -pg -o $(PROG) $(FILES) $(LIBS)
install: $(PROG)
@echo "--------------------------------------------------"
@echo "Installing $(PROG) into /usr/sbin/"
@echo ""
@echo "You can move the Perl scripts and other tools to"
@echo "a location of your choosing manually"
@echo "--------------------------------------------------"
@echo ""
mkdir -p $(DESTDIR)/usr/sbin/
cp -f $(PROG) $(DESTDIR)/usr/sbin/
# cp -f $(PROG).1 /usr/man/man1/ || cp -f $(PROG).1 /usr/local/man/man1/
uninstall:
rm -f $(DESTDIR)/sbin/$(PROG)
# rm -f /usr/man/man1/$(PROG).1 || rm -f /usr/local/man/man1/$(PROG).1
clean:
rm -f $(PROG)
|