Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1 | # ebtables Makefile |
| 2 | |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 3 | PROGNAME:=ebtables |
Bart De Schuymer | 2eb1f92 | 2002-11-22 18:55:55 +0000 | [diff] [blame^] | 4 | PROGVERSION:=2.0.1 |
| 5 | PROGDATE:=October\ 2002 |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 6 | |
| 7 | MANDIR?=/usr/local/man |
| 8 | CFLAGS:=-Wall -Wunused |
Bart De Schuymer | 06a1b46 | 2002-09-07 11:51:13 +0000 | [diff] [blame] | 9 | CC:=gcc |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 10 | include extensions/Makefile |
| 11 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 12 | OBJECTS:=getethertype.o ebtables.o communication.o $(EXT_OBJS) |
| 13 | |
| 14 | # Use the option NONSTANDARD=y when you don't want to use the kernel includes |
| 15 | # that are included in this package. You should set KERNEL_INCLUDES to |
| 16 | # the right directory (eg /usr/src/linux/include). |
| 17 | # You should only need this when compiling the CVS or when adding new code. |
| 18 | ifeq ($(NONSTANDARD), y) |
| 19 | KERNEL_INCLUDES?=/usr/include/ |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 20 | else |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 21 | KERNEL_INCLUDES:=include/ |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 22 | endif |
| 23 | |
Bart De Schuymer | 2eb1f92 | 2002-11-22 18:55:55 +0000 | [diff] [blame^] | 24 | ifneq ($(ETHERTYPESPATH),) |
| 25 | ETHERTYPESFILE:=$(ETHERTYPESPATH)ethertypes |
| 26 | else |
| 27 | ETHERTYPESFILE:=/usr/local/etc/ethertypes |
| 28 | endif |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 29 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 30 | PROGSPECS:=-DPROGVERSION=\"$(PROGVERSION)\" \ |
| 31 | -DPROGNAME=\"$(PROGNAME)\" \ |
| 32 | -DPROGDATE=\"$(PROGDATE)\" \ |
fnm3 | 9bb3d0a | 2002-11-21 10:42:56 +0000 | [diff] [blame] | 33 | -D_PATH_ETHERTYPES=\"$(ETHERTYPESFILE)\" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 34 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 35 | |
| 36 | all: ebtables |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 37 | |
| 38 | communication.o: communication.c include/ebtables_u.h |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 39 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) |
| 40 | |
| 41 | getethertype.o: getethertype.c include/ethernetdb.h |
fnm3 | 9bb3d0a | 2002-11-21 10:42:56 +0000 | [diff] [blame] | 42 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -Iinclude/ |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 43 | |
| 44 | ebtables.o: ebtables.c include/ebtables_u.h |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 45 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 46 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 47 | ebtables: $(OBJECTS) |
| 48 | $(CC) $(CFLAGS) -o $@ $^ -I$(KERNEL_INCLUDES) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 49 | |
| 50 | $(MANDIR)/man8/ebtables.8: ebtables.8 |
| 51 | mkdir -p $(@D) |
| 52 | install -m 0644 -o root -g root $< $@ |
| 53 | |
Bart De Schuymer | 2eb1f92 | 2002-11-22 18:55:55 +0000 | [diff] [blame^] | 54 | $(ETHERTYPESFILE): ethertypes |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 55 | mkdir -p $(@D) |
| 56 | install -m 0644 -o root -g root $< $@ |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 57 | |
Bart De Schuymer | 3289054 | 2002-07-10 20:09:56 +0000 | [diff] [blame] | 58 | .PHONY: exec |
| 59 | exec: ebtables |
| 60 | install -m 0755 -o root -g root $< /sbin/ebtables |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 61 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 62 | .PHONY: install |
Bart De Schuymer | 2eb1f92 | 2002-11-22 18:55:55 +0000 | [diff] [blame^] | 63 | install: $(MANDIR)/man8/ebtables.8 ebtables $(ETHERTYPESFILE) exec |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 64 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 65 | .PHONY: clean |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 66 | clean: |
Bart De Schuymer | 7ddc0e6 | 2002-06-01 21:34:16 +0000 | [diff] [blame] | 67 | rm -f ebtables |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 68 | rm -f *.o *.c~ |
| 69 | rm -f extensions/*.o extensions/*.c~ |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 70 | |
| 71 | DIR:=$(PROGNAME)-v$(PROGVERSION) |
| 72 | # This is used to make a new userspace release |
| 73 | .PHONY: release |
| 74 | release: |
| 75 | mkdir -p include/linux/netfilter_bridge |
| 76 | install -m 0644 -o root -g root \ |
| 77 | $(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/ |
| 78 | # To keep possible compile error complaints about undefined ETH_P_8021Q |
| 79 | # off my back |
| 80 | install -m 0644 -o root -g root \ |
| 81 | $(KERNEL_INCLUDES)/linux/if_ether.h include/linux/ |
| 82 | install -m 0644 -o root -g root \ |
| 83 | $(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \ |
| 84 | include/linux/netfilter_bridge/ |
| 85 | make clean |
| 86 | cd ..;tar -c $(DIR) | gzip >$(DIR).tar.gz |