3 # Makefile for driftnet.
5 # Copyright (c) 2001 Chris Lightfoot. All rights reserved.
6 # Email: chris@ex-parrot.com; WWW: http://www.ex-parrot.com/~chris/
8 # $Id: Makefile,v 1.34 2002/07/09 17:30:42 chris Exp $
12 # User-serviceable parts:
18 # Basic compiler, linker flags; should not need any changes.
22 # You might need these if libpcap is installed somewhere random.
23 #CFLAGS += -I/usr/include/pcap
24 #LDFLAGS += -L/path/to/libpcap.so
26 # Required on Linux to get BSDish definitions of the TCP/IP structs.
27 CFLAGS += -D_BSD_SOURCE
29 # We always need the pcap and pthread libraries.
30 LDLIBS += -lpcap -lpthread
32 # Optional C compiler and linker flags. Typical driftnet builds have support
33 # for displaying captured images in an X window, and need the following flags:
34 CFLAGS += -I$(STAGING_INCDIR)/glib-2.0 -I$(STAGING_INCDIR)/gtk-2.0 -I$(STAGING_INCDIR)/../lib/gtk-2.0/include -I$(STAGING_INCDIR)/atk-1.0
35 LDLIBS += -ljpeg -lungif -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
37 # Alternatively, you can build a version of driftnet which can only be used
38 # in `adjunct' mode as the back end for some other image-processing program. To
39 # use this, comment out the two preceding CFLAGS and LDLIBS lines and uncomment
41 #CFLAGS += -DNO_DISPLAY_WINDOW
43 # On systems with a C99 compiler, driftnet will use <stdint.h> for the
44 # definitions of types such as uint8_t. On other systems like Solaris, these
45 # are in <sys/types.h>, and you should uncomment this line.
46 #CFLAGS += -DUSE_SYS_TYPES_H
48 # On Solaris, it is necessary to link against -lposix4 for the definition of
49 # nanosleep; uncomment the below.
52 # added 20020604 edobbs
53 # On BSD systems, may need to use /usr/local/include
54 #CFLAGS += -I/usr/local/include
58 # No user-serviceable parts below this point.
63 CFLAGS += -DDRIFTNET_VERSION='"$(VERSION)"'
67 TXTS = README TODO COPYING CHANGES CREDITS driftnet.1 driftnet.1.in endian.c
68 SRCS = audio.c mpeghdr.c gif.c img.c jpeg.c png.c driftnet.c image.c \
69 display.c playaudio.c connection.c media.c
70 HDRS = img.h driftnet.h mpeghdr.h
75 default: driftnet driftnet.1
77 driftnet: depend $(OBJS)
78 $(CC) -o driftnet $(OBJS) $(LDFLAGS) $(LDLIBS)
80 driftnet.1: driftnet.1.in Makefile
81 ( echo '.\" DO NOT EDIT THIS FILE-- edit driftnet.1.in instead' ; sed s/@@@VERSION@@@/$(VERSION)/ ) < driftnet.1.in > driftnet.1
87 $(CC) $(CFLAGS) -o endian endian.c
89 %.o: %.c Makefile endianness
90 $(CC) $(CFLAGS) -DDRIFTNET_LITTLE_ENDIAN -c -o $@ $<
93 rm -f *~ *.bak *.o core $(BINS) TAGS driftnet.1 endian endianness
98 tarball: nodepend $(SRCS) $(HDRS) $(TXTS)
99 mkdir driftnet-$(VERSION)
100 set -e ; for i in Makefile $(SRCS) $(HDRS) $(TXTS) ; do cp $$i driftnet-$(VERSION)/$$i ; done
101 tar cvzf driftnet-$(VERSION).tar.gz driftnet-$(VERSION)
102 rm -rf driftnet-$(VERSION)
103 mv driftnet-$(VERSION).tar.gz ..
106 makedepend -- $(CFLAGS) -DDRIFTNET_LITTLE_ENDIAN -- $(SRCS)
112 rm -f depend Makefile.bak