Annotation of embedaddon/ipguard/Makefile, revision 1.1.1.1.4.1
1.1 misho 1: ## Makefile
2: ##
3: ## copyright (c) 2010 SeaD
4: ##
1.1.1.1.4.1! misho 5: ## $Id: Makefile,v 1.1.1.1 2012/02/21 21:59:41 misho Exp $
1.1 misho 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:
1.1.1.1.4.1! misho 24: #INCLUDES=`${LIBNET_CONFIG} --cflags`
! 25: #LIBS=`${LIBNET_CONFIG} --libs` -lpcap -L${LOCALBASE}/lib
! 26: #DEFINES=`${LIBNET_CONFIG} --defines`
! 27: INCLUDES=-I$(PREFIX)/include
! 28: LIBS=-L$(PREFIX)/lib -lnet -lpcap
! 29: DEFINES=-DLIBNET_BSDISH_OS -DHAVE_SOCKADDR_SA_LEN
1.1 misho 30:
31: STATIC=
1.1.1.1.4.1! misho 32: CC=cc
1.1 misho 33:
34: CFLAGS+=-g -Wall -DETHERS='"$(ETHERS)"'
35:
36: OBJS=ethers.o ipguard.o packet.o system.o
37:
38: .c.o:
39: @echo Compiling $*.c
40: @$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $<
41:
42: all: start $(NAME)
43:
44: start:
45: @echo "Making $(NAME)"
46: @echo "INCLUDES=$(INCLUDES)"
47: @echo "LIBS=$(LIBS)"
48: @echo "DEFINES=$(DEFINES)"
49: @echo "CFLAGS=$(CFLAGS)"
50:
51: $(NAME): $(OBJS)
52: @echo Linking $@
53: @$(CC) -o $@ $(OBJS) $(LIBS) $(STATIC)
54:
55: clean:
56: @echo Cleaning OBJS
57: @rm -f $(OBJS)
58:
59: cleanall: clean
60: @echo Removing $(NAME)
61: @rm -f $(NAME)
62:
63: install: all
64: mkdir -p -m 755 $(PREFIX)/sbin
65: install -s -m 755 $(NAME) $(PREFIX)/sbin/$(NAME)
66: mkdir -p -m 755 $(PREFIX)/man/man8
67: install -m 644 doc/$(NAME).8 $(PREFIX)/man/man8/$(NAME).8
68:
69: uninstall: deinstall
70:
71: deinstall:
72: rm -f $(PREFIX)/man/man8/$(NAME).8
73: rm -f $(PREFIX)/sbin/$(NAME)
74:
75: ethers.o: ipguard.h
76: ipguard.o: ipguard.h
77: packet.o: ipguard.h
78: system.o: ipguard.h
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>