blob: e839753858d8c59c3b5ad8bd4c0c3bf54521476e [file] [log] [blame]
Bart De Schuymer1abc55d2002-06-01 19:23:47 +00001# ebtables Makefile
2
3KERNEL_DIR?=/usr/src/linux
4PROGNAME:=ebtables
5PROGVERSION:="2.0pre6 (May 2002)"
6
7MANDIR?=/usr/local/man
8CFLAGS:=-Wall -Wunused
9include extensions/Makefile
10
11# Some kernel testers prefer to use a symlink for /usr/include/linux
12ifeq ($(SYMLINK), y)
13KERNEL_INCLUDES=symlink
14else
15KERNEL_INCLUDES=headers
16endif
17
18all: ebtables
19
20.PHONY: headers
21headers:
22 mkdir -p /usr/include/linux/netfilter_bridge
23 cp -f $(KERNEL_DIR)/include/linux/netfilter_bridge/* \
24 /usr/include/linux/netfilter_bridge/
25 cp -f $(KERNEL_DIR)/include/linux/br_db.h \
26 /usr/include/linux/br_db.h
27 cp -f $(KERNEL_DIR)/include/linux/netfilter_bridge.h \
28 /usr/include/linux/netfilter_bridge.h
29
30.PHONY: symlink
31symlink:
32 ln -fs $(KERNEL_DIR)/include/linux /usr/include/linux
33
34communication.o: communication.c include/ebtables_u.h
35 $(CC) $(CFLAGS) -c -o $@ $<
36
37ebtables.o: ebtables.c include/ebtables_u.h
38 $(CC) $(CFLAGS) -DPROGVERSION=\"$(PROGVERSION)\" \
39 -DPROGNAME=\"$(PROGNAME)\" -c -o $@ $<
40
41ebtables: ebtables.o communication.o $(EXT_OBJS)
42 $(CC) $(CFLAGS) -o $@ $^
43
44$(MANDIR)/man8/ebtables.8: ebtables.8
45 mkdir -p $(@D)
46 install -m 0644 -o root -g root $< $@
47
48/etc/ethertypes: ethertypes
49 mkdir -p $(@D)
50 install -m 0644 -o root -g root $< $@
51
52install: $(MANDIR)/man8/ebtables.8 $(KERNEL_INCLUDES) \
53 ebtables /etc/ethertypes
54
55clean:
Bart De Schuymer7ddc0e62002-06-01 21:34:16 +000056 rm -f ebtables
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000057 rm -f *.o *.c~
58 rm -f extensions/*.o extensions/*.c~