| •1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
prefix ?= /usr/local |
| 4 |
|
| 5 |
# Seems that RedHat keeps the pcap headers elsewhere... |
| 6 |
# Uncomment the below line for RH systems. |
| 7 |
#CFLAGS=-Wall -ggdb -lpcap -I/usr/include/pcap |
| 8 |
|
| 9 |
# Standard build with pcap installed on the system |
| •10 |
#CFLAGS = -Wall -W -O2 |
| 11 |
#CFLAGS = -Wall -W -ggdb |
| 12 |
|
| 13 |
# Build for the Zaurus with the pcap headers/libs one dir up |
| 14 |
#CFLAGS = -DZAURUS -Wall -I. -I../libpcap-0.7.1 -L../libpcap-0.7.1 -ggdb |
| 15 |
|
| 16 |
# Build for Solaris with the pcap headers/libs one dir up |
| 17 |
#CFLAGS = -DSOLARIS -Wall -I. -I../libpcap-0.7.1 -L../libpcap-0.7.1 -ggdb |
| 18 |
|
| •19 |
LIBS = -lpcap |
| 20 |
|
| 21 |
# Build for Solaris |
| 22 |
#LDFLAGS = -lsocket -lnsl -lpcap |
| 23 |
|
| •24 |
all: cdpr |
| 25 |
|
| •26 |
%.o:%.c cdp.h cdpr.h |
| 27 |
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< |
| 28 |
|
| 29 |
cdpr: cdpr.o cdprs.o conffile.o |
| •30 |
$(CC) $(LDFLAGS) -o cdpr cdpr.o cdprs.o conffile.o $(LIBS) |
| 31 |
|
| 32 |
install: all |
| 33 |
mkdir -p $(DESTDIR)$(prefix)/sbin/ |
| 34 |
install --mode=755 cdpr $(DESTDIR)$(prefix)/sbin/cdpr |
| 35 |
|
| •36 |
clean: |
| •37 |
rm -f *.o cdpr |
| 38 |
|
| 39 |
distclean: clean |
| 40 |
|
| •41 |
.PHONY: all install clean distclean |