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 | cd51fbe | 2006-04-11 18:20:35 +0000 | [diff] [blame] | 4 | PROGVERSION:=2.0.8-rc2 |
| 5 | PROGDATE:=March\ 2006 |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 6 | |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 7 | # default paths |
Bart De Schuymer | 38561e9 | 2004-02-23 09:20:42 +0000 | [diff] [blame] | 8 | LIBDIR:=/usr/lib |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 9 | MANDIR:=/usr/local/man |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 10 | BINDIR:=/usr/local/sbin |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 11 | ETCDIR:=/etc |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 12 | INITDIR:=/etc/rc.d/init.d |
| 13 | SYSCONFIGDIR:=/etc/sysconfig |
Bart De Schuymer | 38561e9 | 2004-02-23 09:20:42 +0000 | [diff] [blame] | 14 | DESTDIR:= |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 15 | |
| 16 | # include DESTDIR param |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 17 | override LIBDIR:=$(DESTDIR)$(LIBDIR)/$(PROGNAME) |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 18 | override MANDIR:=$(DESTDIR)$(MANDIR) |
| 19 | override BINDIR:=$(DESTDIR)$(BINDIR) |
| 20 | override ETCDIR:=$(DESTDIR)$(ETCDIR) |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 21 | override INITDIR:=$(DESTDIR)$(INITDIR) |
| 22 | override SYSCONFIGDIR:=$(DESTDIR)$(SYSCONFIGDIR) |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 23 | |
| 24 | |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 25 | CFLAGS:=-Wall -Wunused |
Bart De Schuymer | 06a1b46 | 2002-09-07 11:51:13 +0000 | [diff] [blame] | 26 | CC:=gcc |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 27 | LD:=ld |
Bart De Schuymer | 3c1e00c | 2002-12-07 11:18:57 +0000 | [diff] [blame] | 28 | |
Bart De Schuymer | 60c2009 | 2003-07-23 21:34:21 +0000 | [diff] [blame] | 29 | ifeq ($(shell uname -m),sparc64) |
| 30 | CFLAGS+=-DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32 |
| 31 | endif |
| 32 | |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 33 | include extensions/Makefile |
| 34 | |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 35 | OBJECTS2:=getethertype.o communication.o libebtc.o \ |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 36 | useful_functions.o ebtables.o |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 37 | |
Bart De Schuymer | 7d9e3eb | 2006-02-06 21:24:02 +0000 | [diff] [blame] | 38 | OBJECTS:=$(OBJECTS2) $(EXT_OBJS) $(EXT_LIBS) |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 39 | |
Bart De Schuymer | 06a9682 | 2003-02-19 20:09:51 +0000 | [diff] [blame] | 40 | KERNEL_INCLUDES?=include/ |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 41 | |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 42 | ETHERTYPESPATH?=$(ETCDIR) |
Bart De Schuymer | a296038 | 2003-04-01 17:29:13 +0000 | [diff] [blame] | 43 | ETHERTYPESFILE:=$(ETHERTYPESPATH)/ethertypes |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 44 | |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 45 | PIPE_DIR?=$(DESTDIR)/tmp/$(PROGNAME)-v$(PROGVERSION) |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 46 | PIPE=$(PIPE_DIR)/ebtablesd_pipe |
| 47 | EBTD_CMDLINE_MAXLN?=2048 |
| 48 | EBTD_ARGC_MAX?=50 |
| 49 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 50 | PROGSPECS:=-DPROGVERSION=\"$(PROGVERSION)\" \ |
| 51 | -DPROGNAME=\"$(PROGNAME)\" \ |
| 52 | -DPROGDATE=\"$(PROGDATE)\" \ |
Bart De Schuymer | 9d680cc | 2005-10-01 09:16:51 +0000 | [diff] [blame] | 53 | -D_PATH_ETHERTYPES=\"$(ETHERTYPESFILE)\" \ |
| 54 | -DEBTD_ARGC_MAX=$(EBTD_ARGC_MAX) \ |
| 55 | -DEBTD_CMDLINE_MAXLN=$(EBTD_CMDLINE_MAXLN) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 56 | |
Bart De Schuymer | 96ee8d1 | 2005-11-04 21:59:57 +0000 | [diff] [blame] | 57 | # You can probably ignore this, ebtables{u,d} are normally not used |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 58 | PROGSPECSD:=-DPROGVERSION=\"$(PROGVERSION)\" \ |
| 59 | -DPROGNAME=\"$(PROGNAME)\" \ |
| 60 | -DPROGDATE=\"$(PROGDATE)\" \ |
| 61 | -D_PATH_ETHERTYPES=\"$(ETHERTYPESFILE)\" \ |
| 62 | -DEBTD_CMDLINE_MAXLN=$(EBTD_CMDLINE_MAXLN) \ |
| 63 | -DEBTD_ARGC_MAX=$(EBTD_ARGC_MAX) \ |
| 64 | -DEBTD_PIPE=\"$(PIPE)\" \ |
| 65 | -DEBTD_PIPE_DIR=\"$(PIPE_DIR)\" |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 66 | |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 67 | # Uncomment for debugging (slower) |
| 68 | #PROGSPECS+=-DEBT_DEBUG |
| 69 | #PROGSPECSD+=-DEBT_DEBUG |
Bart De Schuymer | 96ee8d1 | 2005-11-04 21:59:57 +0000 | [diff] [blame] | 70 | #CFLAGS+=-ggdb |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 71 | |
Bart De Schuymer | 96ee8d1 | 2005-11-04 21:59:57 +0000 | [diff] [blame] | 72 | all: ebtables ebtables-restore |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 73 | |
| 74 | communication.o: communication.c include/ebtables_u.h |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 75 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) |
| 76 | |
Bart De Schuymer | 8339ff1 | 2004-01-14 20:05:27 +0000 | [diff] [blame] | 77 | libebtc.o: libebtc.c include/ebtables_u.h |
| 78 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) |
| 79 | |
| 80 | useful_functions.o: useful_functions.c include/ebtables_u.h |
| 81 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) |
| 82 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 83 | getethertype.o: getethertype.c include/ethernetdb.h |
fnm3 | 9bb3d0a | 2002-11-21 10:42:56 +0000 | [diff] [blame] | 84 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -Iinclude/ |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 85 | |
| 86 | ebtables.o: ebtables.c include/ebtables_u.h |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 87 | $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< -I$(KERNEL_INCLUDES) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 88 | |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 89 | ebtables-standalone.o: ebtables-standalone.c include/ebtables_u.h |
| 90 | $(CC) $(CFLAGS) $(PROGSPECS) -c $< -o $@ -I$(KERNEL_INCLUDES) |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 91 | |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 92 | .PHONY: libebtc |
| 93 | libebtc: $(OBJECTS2) |
Bart De Schuymer | e1c1588 | 2004-05-24 19:57:58 +0000 | [diff] [blame] | 94 | $(LD) -shared -soname libebtc.so -o libebtc.so -lc $(OBJECTS2) |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 95 | |
| 96 | ebtables: $(OBJECTS) ebtables-standalone.o libebtc |
| 97 | $(CC) $(CFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ |
| 98 | -Wl,-rpath,$(LIBDIR) |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 99 | |
| 100 | ebtablesu: ebtablesu.c |
| 101 | $(CC) $(CFLAGS) $(PROGSPECSD) $< -o $@ |
| 102 | |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 103 | ebtablesd.o: ebtablesd.c include/ebtables_u.h |
| 104 | $(CC) $(CFLAGS) $(PROGSPECSD) -c $< -o $@ -I$(KERNEL_INCLUDES) |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 105 | |
Bart De Schuymer | 838fa5b | 2005-06-18 14:43:32 +0000 | [diff] [blame] | 106 | ebtablesd: $(OBJECTS) ebtablesd.o libebtc |
| 107 | $(CC) $(CFLAGS) -o $@ ebtablesd.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ |
| 108 | -Wl,-rpath,$(LIBDIR) |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 109 | |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 110 | ebtables-restore.o: ebtables-restore.c include/ebtables_u.h |
Bart De Schuymer | 9d680cc | 2005-10-01 09:16:51 +0000 | [diff] [blame] | 111 | $(CC) $(CFLAGS) $(PROGSPECS) -c $< -o $@ -I$(KERNEL_INCLUDES) |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 112 | |
| 113 | ebtables-restore: $(OBJECTS) ebtables-restore.o libebtc |
| 114 | $(CC) $(CFLAGS) -o $@ ebtables-restore.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ |
| 115 | -Wl,-rpath,$(LIBDIR) |
| 116 | |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 117 | .PHONY: daemon |
| 118 | daemon: ebtablesd ebtablesu |
| 119 | |
Bart De Schuymer | 7d9e3eb | 2006-02-06 21:24:02 +0000 | [diff] [blame] | 120 | # a little scripting for a static binary, making one for ebtables-restore |
| 121 | # should be completely analogous |
| 122 | static: extensions/ebt_*.c extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c getethertype.c libebtc.c useful_functions.c |
| 123 | cp ebtables-standalone.c ebtables-standalone.c_ ; \ |
| 124 | cp include/ebtables_u.h include/ebtables_u.h_ ; \ |
| 125 | sed "s/ main(/ pseudomain(/" ebtables-standalone.c > ebtables-standalone.c__ ; \ |
| 126 | mv ebtables-standalone.c__ ebtables-standalone.c ; \ |
| 127 | printf "\nint main(int argc, char *argv[])\n{\n " >> ebtables-standalone.c ; \ |
| 128 | for arg in $(EXT_FUNC) \ |
| 129 | ; do \ |
| 130 | sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \ |
| 131 | mv extensions/ebt_$${arg}.c_ extensions/ebt_$${arg}.c ; \ |
| 132 | printf "\t%s();\n" _$${arg}_init >> ebtables-standalone.c ; \ |
| 133 | printf "extern void %s();\n" _$${arg}_init >> include/ebtables_u.h ; \ |
| 134 | done ; \ |
| 135 | for arg in $(EXT_TABLES) \ |
| 136 | ; do \ |
| 137 | sed s/_init/_t_$${arg}_init/ extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c_ ; \ |
| 138 | mv extensions/ebtable_$${arg}.c_ extensions/ebtable_$${arg}.c ; \ |
| 139 | printf "\t%s();\n" _t_$${arg}_init >> ebtables-standalone.c ; \ |
| 140 | printf "extern void %s();\n" _t_$${arg}_init >> include/ebtables_u.h ; \ |
| 141 | done ; \ |
| 142 | printf "\n\tpseudomain(argc, argv);\n\treturn 0;\n}\n" >> ebtables-standalone.c ;\ |
Bart De Schuymer | dc5d9fc | 2006-08-09 10:28:14 +0000 | [diff] [blame] | 143 | $(CC) $(CFLAGS) $(PROGSPECS) -o $@ $^ -I$(KERNEL_INCLUDES) -Iinclude ; \ |
Bart De Schuymer | 7d9e3eb | 2006-02-06 21:24:02 +0000 | [diff] [blame] | 144 | for arg in $(EXT_FUNC) \ |
| 145 | ; do \ |
| 146 | sed "s/ .*_init/ _init/" extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \ |
| 147 | mv extensions/ebt_$${arg}.c_ extensions/ebt_$${arg}.c ; \ |
| 148 | done ; \ |
| 149 | for arg in $(EXT_TABLES) \ |
| 150 | ; do \ |
| 151 | sed "s/ .*_init/ _init/" extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c_ ; \ |
| 152 | mv extensions/ebtable_$${arg}.c_ extensions/ebtable_$${arg}.c ; \ |
| 153 | done ; \ |
| 154 | mv ebtables-standalone.c_ ebtables-standalone.c ; \ |
| 155 | mv include/ebtables_u.h_ include/ebtables_u.h |
| 156 | |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 157 | tmp1:=$(shell printf $(BINDIR) | sed 's/\//\\\//g') |
| 158 | tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g') |
Bart De Schuymer | db97ab2 | 2005-09-01 20:37:07 +0000 | [diff] [blame] | 159 | tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g') |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 160 | .PHONY: scripts |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 161 | scripts: ebtables-save ebtables.sysv ebtables-config |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 162 | cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ |
| 163 | install -m 0755 -o root -g root ebtables-save_ $(BINDIR)/ebtables-save |
Bart De Schuymer | db97ab2 | 2005-09-01 20:37:07 +0000 | [diff] [blame] | 164 | cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 165 | install -m 0755 -o root -g root ebtables.sysv_ $(INITDIR)/ebtables |
Bart De Schuymer | 9336b5a | 2005-11-04 22:01:23 +0000 | [diff] [blame] | 166 | cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 167 | install -m 0600 -o root -g root ebtables-config_ $(SYSCONFIGDIR)/ebtables-config |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 168 | rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 169 | |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 170 | $(MANDIR)/man8/ebtables.8: ebtables.8 |
| 171 | mkdir -p $(@D) |
| 172 | install -m 0644 -o root -g root $< $@ |
| 173 | |
Bart De Schuymer | 2eb1f92 | 2002-11-22 18:55:55 +0000 | [diff] [blame] | 174 | $(ETHERTYPESFILE): ethertypes |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 175 | mkdir -p $(@D) |
| 176 | install -m 0644 -o root -g root $< $@ |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 177 | |
Bart De Schuymer | 3289054 | 2002-07-10 20:09:56 +0000 | [diff] [blame] | 178 | .PHONY: exec |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 179 | exec: ebtables ebtables-restore |
Bart De Schuymer | 3749f30 | 2004-02-11 21:23:38 +0000 | [diff] [blame] | 180 | mkdir -p $(BINDIR) |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 181 | install -m 0755 -o root -g root $(PROGNAME) $(BINDIR)/$(PROGNAME) |
| 182 | install -m 0755 -o root -g root ebtables-restore $(BINDIR)/ebtables-restore |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 183 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 184 | .PHONY: install |
Bart De Schuymer | 50441e9 | 2005-08-30 21:20:55 +0000 | [diff] [blame] | 185 | install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts |
Bart De Schuymer | 0f5e3fe | 2004-02-10 18:08:00 +0000 | [diff] [blame] | 186 | mkdir -p $(LIBDIR) |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 187 | install -m 0755 extensions/*.so $(LIBDIR) |
| 188 | install -m 0755 *.so $(LIBDIR) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 189 | |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 190 | .PHONY: clean |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 191 | clean: |
Bart De Schuymer | 7d9e3eb | 2006-02-06 21:24:02 +0000 | [diff] [blame] | 192 | rm -f ebtables ebtables-restore ebtablesd ebtablesu static |
Bart De Schuymer | 90db00b | 2005-09-28 19:36:34 +0000 | [diff] [blame] | 193 | rm -f *.o *~ *.so |
Bart De Schuymer | 96ee8d1 | 2005-11-04 21:59:57 +0000 | [diff] [blame] | 194 | rm -f extensions/*.o extensions/*.c~ extensions/*.so include/*~ |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 195 | |
| 196 | DIR:=$(PROGNAME)-v$(PROGVERSION) |
| 197 | # This is used to make a new userspace release |
| 198 | .PHONY: release |
| 199 | release: |
| 200 | mkdir -p include/linux/netfilter_bridge |
| 201 | install -m 0644 -o root -g root \ |
| 202 | $(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/ |
| 203 | # To keep possible compile error complaints about undefined ETH_P_8021Q |
| 204 | # off my back |
| 205 | install -m 0644 -o root -g root \ |
| 206 | $(KERNEL_INCLUDES)/linux/if_ether.h include/linux/ |
| 207 | install -m 0644 -o root -g root \ |
| 208 | $(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \ |
| 209 | include/linux/netfilter_bridge/ |
Bart De Schuymer | 60c2009 | 2003-07-23 21:34:21 +0000 | [diff] [blame] | 210 | install -m 0644 -o root -g root \ |
| 211 | include/ebtables.h include/linux/netfilter_bridge/ |
Bart De Schuymer | 0f8c499 | 2002-11-20 19:41:02 +0000 | [diff] [blame] | 212 | make clean |
Bart De Schuymer | e29506d | 2003-07-26 11:53:32 +0000 | [diff] [blame] | 213 | touch * |
| 214 | touch extensions/* |
| 215 | touch include/* |
| 216 | touch include/linux/* |
| 217 | touch include/linux/netfilter_bridge/* |
Bart De Schuymer | 308ea9f | 2005-11-13 12:15:09 +0000 | [diff] [blame] | 218 | cd ..;tar -c $(DIR) | gzip >$(DIR).tar.gz; cd - |
| 219 | rm -rf include/linux |
| 220 | |
| 221 | # This will make the rpm and put it in /usr/src/redhat/RPMS |
| 222 | # (do this as root after make release) |
| 223 | .PHONY: rpmbuild |
| 224 | rpmbuild: |
| 225 | cp ../$(DIR).tar.gz /usr/src/redhat/SOURCES/ |
Bart De Schuymer | 58acf95 | 2005-11-13 12:23:13 +0000 | [diff] [blame] | 226 | rpmbuild --buildroot $(shell mktemp -td $(DIR)-XXXXX) -bb ebtables.spec |
Bart De Schuymer | 8bde101 | 2004-11-20 13:00:52 +0000 | [diff] [blame] | 227 | |
| 228 | .PHONY: test_ulog |
| 229 | test_ulog: examples/ulog/test_ulog.c getethertype.o |
| 230 | $(CC) $(CFLAGS) $< -o test_ulog -I$(KERNEL_INCLUDES) -lc \ |
| 231 | getethertype.o |
| 232 | mv test_ulog examples/ulog/ |
| 233 | |
| 234 | .PHONY: examples |
| 235 | examples: test_ulog |