Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1 | # ebtables Makefile |
| 2 | |
| 3 | KERNEL_DIR?=/usr/src/linux |
| 4 | PROGNAME:=ebtables |
Bart De Schuymer | d458648 | 2002-08-11 16:15:55 +0000 | [diff] [blame] | 5 | PROGVERSION:="2.0-rc2" |
| 6 | PROGDATE:="August 2002" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 7 | |
| 8 | MANDIR?=/usr/local/man |
| 9 | CFLAGS:=-Wall -Wunused |
| 10 | include extensions/Makefile |
| 11 | |
| 12 | # Some kernel testers prefer to use a symlink for /usr/include/linux |
| 13 | ifeq ($(SYMLINK), y) |
| 14 | KERNEL_INCLUDES=symlink |
| 15 | else |
| 16 | KERNEL_INCLUDES=headers |
| 17 | endif |
| 18 | |
| 19 | all: ebtables |
| 20 | |
| 21 | .PHONY: headers |
| 22 | headers: |
| 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 Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 26 | cp -f $(KERNEL_DIR)/include/linux/netfilter_bridge.h \ |
| 27 | /usr/include/linux/netfilter_bridge.h |
Bart De Schuymer | fc3dd67 | 2002-07-07 14:27:11 +0000 | [diff] [blame] | 28 | cp -f $(KERNEL_DIR)/include/linux/if_ether.h \ |
| 29 | /usr/include/linux/if_ether.h |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 30 | |
| 31 | .PHONY: symlink |
| 32 | symlink: |
Bart De Schuymer | 596c3c0 | 2002-06-04 06:30:35 +0000 | [diff] [blame] | 33 | rm -f /usr/include/linux |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 34 | ln -fs $(KERNEL_DIR)/include/linux /usr/include/linux |
| 35 | |
| 36 | communication.o: communication.c include/ebtables_u.h |
Bart De Schuymer | d458648 | 2002-08-11 16:15:55 +0000 | [diff] [blame] | 37 | $(CC) $(CFLAGS) -DPROGVERSION=\"$(PROGVERSION)\" -c -o $@ $< |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 38 | |
| 39 | ebtables.o: ebtables.c include/ebtables_u.h |
| 40 | $(CC) $(CFLAGS) -DPROGVERSION=\"$(PROGVERSION)\" \ |
Bart De Schuymer | d458648 | 2002-08-11 16:15:55 +0000 | [diff] [blame] | 41 | -DPROGNAME=\"$(PROGNAME)\" -DPROGDATE=\"$(PROGDATE)\" -c -o $@ $< |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 42 | |
| 43 | ebtables: 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 Schuymer | 3289054 | 2002-07-10 20:09:56 +0000 | [diff] [blame] | 53 | .PHONY: exec |
| 54 | exec: ebtables |
| 55 | install -m 0755 -o root -g root $< /sbin/ebtables |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 56 | |
| 57 | install: $(MANDIR)/man8/ebtables.8 $(KERNEL_INCLUDES) \ |
Bart De Schuymer | 3289054 | 2002-07-10 20:09:56 +0000 | [diff] [blame] | 58 | ebtables /etc/ethertypes exec |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 59 | |
| 60 | clean: |
Bart De Schuymer | 7ddc0e6 | 2002-06-01 21:34:16 +0000 | [diff] [blame] | 61 | rm -f ebtables |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 62 | rm -f *.o *.c~ |
| 63 | rm -f extensions/*.o extensions/*.c~ |