Annotation of embedaddon/ipguard/Makefile, revision 1.1
1.1 ! misho 1: ## Makefile
! 2: ##
! 3: ## copyright (c) 2010 SeaD
! 4: ##
! 5: ## $Id: Makefile,v 1.17 2010/07/12 03:46:36 sead Exp $
! 6:
! 7: NAME=ipguard
! 8:
! 9: PREFIX?=/usr/local
! 10: ETHERS?=/etc/ethers
! 11:
! 12: ## FreeBSD
! 13: LOCALBASE=/usr/local
! 14: LIBNET_CONFIG=libnet11-config
! 15:
! 16: ## OpenBSD (tested by irix)
! 17: # LOCALBASE=/usr/local
! 18: # LIBNET_CONFIG=libnet-config-1.1
! 19:
! 20: ## Linux
! 21: # LOCALBASE=/usr
! 22: # LIBNET_CONFIG=libnet-config
! 23:
! 24: INCLUDES=`${LIBNET_CONFIG} --cflags`
! 25: LIBS=`${LIBNET_CONFIG} --libs` -lpcap -L${LOCALBASE}/lib
! 26: DEFINES=`${LIBNET_CONFIG} --defines`
! 27:
! 28: STATIC=
! 29: CC=gcc
! 30:
! 31: CFLAGS+=-g -Wall -DETHERS='"$(ETHERS)"'
! 32:
! 33: OBJS=ethers.o ipguard.o packet.o system.o
! 34:
! 35: .c.o:
! 36: @echo Compiling $*.c
! 37: @$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $<
! 38:
! 39: all: start $(NAME)
! 40:
! 41: start:
! 42: @echo "Making $(NAME)"
! 43: @echo "INCLUDES=$(INCLUDES)"
! 44: @echo "LIBS=$(LIBS)"
! 45: @echo "DEFINES=$(DEFINES)"
! 46: @echo "CFLAGS=$(CFLAGS)"
! 47:
! 48: $(NAME): $(OBJS)
! 49: @echo Linking $@
! 50: @$(CC) -o $@ $(OBJS) $(LIBS) $(STATIC)
! 51:
! 52: clean:
! 53: @echo Cleaning OBJS
! 54: @rm -f $(OBJS)
! 55:
! 56: cleanall: clean
! 57: @echo Removing $(NAME)
! 58: @rm -f $(NAME)
! 59:
! 60: install: all
! 61: mkdir -p -m 755 $(PREFIX)/sbin
! 62: install -s -m 755 $(NAME) $(PREFIX)/sbin/$(NAME)
! 63: mkdir -p -m 755 $(PREFIX)/man/man8
! 64: install -m 644 doc/$(NAME).8 $(PREFIX)/man/man8/$(NAME).8
! 65:
! 66: uninstall: deinstall
! 67:
! 68: deinstall:
! 69: rm -f $(PREFIX)/man/man8/$(NAME).8
! 70: rm -f $(PREFIX)/sbin/$(NAME)
! 71:
! 72: ethers.o: ipguard.h
! 73: ipguard.o: ipguard.h
! 74: packet.o: ipguard.h
! 75: system.o: ipguard.h
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>