#!/usr/bin/make -f prefix ?= /usr/local # Seems that RedHat keeps the pcap headers elsewhere... # Uncomment the below line for RH systems. #CFLAGS=-Wall -ggdb -lpcap -I/usr/include/pcap # Standard build with pcap installed on the system #CFLAGS = -Wall -W -O2 #CFLAGS = -Wall -W -ggdb # Build for the Zaurus with the pcap headers/libs one dir up #CFLAGS = -DZAURUS -Wall -I. -I../libpcap-0.7.1 -L../libpcap-0.7.1 -ggdb # Build for Solaris with the pcap headers/libs one dir up #CFLAGS = -DSOLARIS -Wall -I. -I../libpcap-0.7.1 -L../libpcap-0.7.1 -ggdb LIBS = -lpcap # Build for Solaris #LDFLAGS = -lsocket -lnsl -lpcap all: cdpr %.o:%.c cdp.h cdpr.h $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< cdpr: cdpr.o cdprs.o conffile.o $(CC) $(LDFLAGS) -o cdpr cdpr.o cdprs.o conffile.o $(LIBS) install: all mkdir -p $(DESTDIR)$(prefix)/sbin/ install --mode=755 cdpr $(DESTDIR)$(prefix)/sbin/cdpr clean: rm -f *.o cdpr distclean: clean .PHONY: all install clean distclean