blob: ceb7329c72b052ead893d359d472011a1dc5193e [file] [log] [blame]
Bart De Schuymer1abc55d2002-06-01 19:23:47 +00001# ebtables Makefile
2
3KERNEL_DIR?=/usr/src/linux
4PROGNAME:=ebtables
Bart De Schuymerd4586482002-08-11 16:15:55 +00005PROGVERSION:="2.0-rc2"
6PROGDATE:="August 2002"
Bart De Schuymer1abc55d2002-06-01 19:23:47 +00007
8MANDIR?=/usr/local/man
9CFLAGS:=-Wall -Wunused
10include extensions/Makefile
11
12# Some kernel testers prefer to use a symlink for /usr/include/linux
13ifeq ($(SYMLINK), y)
14KERNEL_INCLUDES=symlink
15else
16KERNEL_INCLUDES=headers
17endif
18
19all: ebtables
20
21.PHONY: headers
22headers:
23 mkdir -p /usr/include/linux/netfilter_bridge
24 cp -f $(KERNEL_DIR)/include/linux/netfilter_bridge/* \
25 /usr/include/linux/netfilter_bridge/
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000026 cp -f $(KERNEL_DIR)/include/linux/netfilter_bridge.h \
27 /usr/include/linux/netfilter_bridge.h
Bart De Schuymerfc3dd672002-07-07 14:27:11 +000028 cp -f $(KERNEL_DIR)/include/linux/if_ether.h \
29 /usr/include/linux/if_ether.h
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000030
31.PHONY: symlink
32symlink:
Bart De Schuymer596c3c02002-06-04 06:30:35 +000033 rm -f /usr/include/linux
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000034 ln -fs $(KERNEL_DIR)/include/linux /usr/include/linux
35
36communication.o: communication.c include/ebtables_u.h
Bart De Schuymerd4586482002-08-11 16:15:55 +000037 $(CC) $(CFLAGS) -DPROGVERSION=\"$(PROGVERSION)\" -c -o $@ $<
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000038
39ebtables.o: ebtables.c include/ebtables_u.h
40 $(CC) $(CFLAGS) -DPROGVERSION=\"$(PROGVERSION)\" \
Bart De Schuymerd4586482002-08-11 16:15:55 +000041 -DPROGNAME=\"$(PROGNAME)\" -DPROGDATE=\"$(PROGDATE)\" -c -o $@ $<
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000042
43ebtables: ebtables.o communication.o $(EXT_OBJS)
44 $(CC) $(CFLAGS) -o $@ $^
45
46$(MANDIR)/man8/ebtables.8: ebtables.8
47 mkdir -p $(@D)
48 install -m 0644 -o root -g root $< $@
49
50/etc/ethertypes: ethertypes
51 mkdir -p $(@D)
52 install -m 0644 -o root -g root $< $@
Bart De Schuymer32890542002-07-10 20:09:56 +000053.PHONY: exec
54exec: ebtables
55 install -m 0755 -o root -g root $< /sbin/ebtables
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000056
57install: $(MANDIR)/man8/ebtables.8 $(KERNEL_INCLUDES) \
Bart De Schuymer32890542002-07-10 20:09:56 +000058 ebtables /etc/ethertypes exec
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000059
60clean:
Bart De Schuymer7ddc0e62002-06-01 21:34:16 +000061 rm -f ebtables
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000062 rm -f *.o *.c~
63 rm -f extensions/*.o extensions/*.c~