Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 1 | # uncomment this to get a fully statically linked version |
| 2 | # NO_SHARED_LIBS = 1 |
| 3 | |
Harald Welte | 2354d92 | 2003-03-04 23:15:42 +0000 | [diff] [blame] | 4 | # uncomment this to disable IPv6 support |
| 5 | # DO_IPV6 = 0 |
| 6 | |
Harald Welte | 3a5026f | 2001-09-02 16:07:33 +0000 | [diff] [blame] | 7 | ###################################################################### |
| 8 | # YOU SHOULD NOT NEED TO TOUCH ANYTHING BELOW THIS LINE |
| 9 | ###################################################################### |
| 10 | |
| 11 | # Standard part of Makefile for topdir. |
| 12 | TOPLEVEL_INCLUDED=YES |
| 13 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 14 | ifndef KERNEL_DIR |
| 15 | KERNEL_DIR=/usr/src/linux |
| 16 | endif |
Harald Welte | f1528c8 | 2004-06-17 12:21:11 +0000 | [diff] [blame] | 17 | IPTABLES_VERSION:=1.2.11 |
| 18 | OLD_IPTABLES_VERSION:=1.2.10 |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 19 | |
Harald Welte | ba6d012 | 2002-02-17 19:49:26 +0000 | [diff] [blame] | 20 | PREFIX:=/usr/local |
| 21 | LIBDIR:=$(PREFIX)/lib |
| 22 | BINDIR:=$(PREFIX)/sbin |
| 23 | MANDIR:=$(PREFIX)/man |
| 24 | INCDIR:=$(PREFIX)/include |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 25 | |
Harald Welte | 3a5026f | 2001-09-02 16:07:33 +0000 | [diff] [blame] | 26 | # directory for new iptables releases |
| 27 | RELEASE_DIR:=/tmp |
| 28 | |
Rusty Russell | 209820b | 2001-01-08 08:14:33 +0000 | [diff] [blame] | 29 | # Need libc6 for this. FIXME: Should covert to autoconf. |
Rusty Russell | 4d2afbf | 2001-05-01 02:06:08 +0000 | [diff] [blame] | 30 | ifeq ($(shell [ -f /usr/include/netinet/ip6.h ] && echo YES), YES) |
Harald Welte | 2354d92 | 2003-03-04 23:15:42 +0000 | [diff] [blame] | 31 | DO_IPV6:=1 |
Rusty Russell | 8e07bd7 | 2000-12-19 03:11:00 +0000 | [diff] [blame] | 32 | endif |
| 33 | |
Harald Welte | 380ba5f | 2002-02-13 16:19:55 +0000 | [diff] [blame] | 34 | COPT_FLAGS:=-O2 |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 35 | CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include -Iinclude/ -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DIPTC_DEBUG |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 36 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 37 | ifdef NO_SHARED_LIBS |
| 38 | CFLAGS += -DNO_SHARED_LIBS=1 |
| 39 | endif |
| 40 | |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 41 | EXTRAS+=iptables iptables.o iptables.8 |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 42 | EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8 |
| 43 | |
Harald Welte | eba774d | 2001-10-16 08:22:40 +0000 | [diff] [blame] | 44 | # No longer experimental. |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 45 | ifneq ($(DO_MULTI), 1) |
Harald Welte | eba774d | 2001-10-16 08:22:40 +0000 | [diff] [blame] | 46 | EXTRAS+=iptables-save iptables-restore |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 47 | endif |
Harald Welte | eba774d | 2001-10-16 08:22:40 +0000 | [diff] [blame] | 48 | EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore $(DESTDIR)$(MANDIR)/man8/iptables-restore.8 $(DESTDIR)$(MANDIR)/man8/iptables-save.8 |
Rusty Russell | 8e07bd7 | 2000-12-19 03:11:00 +0000 | [diff] [blame] | 49 | |
Harald Welte | 2354d92 | 2003-03-04 23:15:42 +0000 | [diff] [blame] | 50 | ifeq ($(DO_IPV6), 1) |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 51 | EXTRAS+=ip6tables ip6tables.o ip6tables.8 |
András Kis-Szabó | 0612943 | 2001-10-14 13:27:03 +0000 | [diff] [blame] | 52 | EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/ip6tables $(DESTDIR)$(MANDIR)/man8/ip6tables.8 |
Harald Welte | 8a6831a | 2001-03-15 15:33:56 +0000 | [diff] [blame] | 53 | EXTRAS_EXP+=ip6tables-save ip6tables-restore |
Harald Welte | 46d4d0a | 2001-03-16 15:48:56 +0000 | [diff] [blame] | 54 | EXTRA_INSTALLS_EXP+=$(DESTDIR)$(BINDIR)/ip6tables-save $(DESTDIR)$(BINDIR)/ip6tables-restore # $(DESTDIR)$(MANDIR)/man8/iptables-restore.8 $(DESTDIR)$(MANDIR)/man8/iptables-save.8 $(DESTDIR)$(MANDIR)/man8/ip6tables-save.8 $(DESTDIR)$(MANDIR)/man8/ip6tables-restore.8 |
Rusty Russell | 8e07bd7 | 2000-12-19 03:11:00 +0000 | [diff] [blame] | 55 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 56 | |
Rusty Russell | 09b9a41 | 2000-04-27 10:16:47 +0000 | [diff] [blame] | 57 | # Sparc64 hack |
| 58 | ifeq ($(shell uname -m),sparc64) |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 59 | POINTERTEST:=1 |
| 60 | 32bituser := $(shell echo -e "\#include <stdio.h>\n\#if !defined(__sparcv9) && !defined(__arch64__) && !defined(_LP64)\nuserspace_is_32bit\n\#endif" | $(CC) $(CFLAGS) -E - | grep userspace_is_32bit) |
| 61 | ifdef 32bituser |
| 62 | # The kernel is 64-bit, even though userspace is 32. |
| 63 | CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32 |
| 64 | else |
| 65 | EXT_LDFLAGS=-m elf64_sparc |
| 66 | endif |
Rusty Russell | 09b9a41 | 2000-04-27 10:16:47 +0000 | [diff] [blame] | 67 | endif |
| 68 | |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 69 | # Alpha only has 64bit userspace and fails the test below |
| 70 | ifeq ($(shell uname -m), alpha) |
| 71 | POINTERTEST:=1 |
| 72 | endif |
| 73 | |
| 74 | # Generic test if arch wasn't found above |
| 75 | ifneq ($(POINTERTEST),1) |
| 76 | # Try to determine if kernel is 64bit and we are compiling for 32bit |
| 77 | ifeq ($(shell [ -a $(KERNEL_DIR)/include/asm ] && echo YES), YES) |
| 78 | 64bitkernel := $(shell echo -e "\#include <asm/types.h>\n\#if BITS_PER_LONG == 64\nkernel_is_64bits\n\#endif" | $(CC) $(CFLAGS) -D__KERNEL__ -E - | grep kernel_is_64bits) |
| 79 | ifdef 64bitkernel |
| 80 | 32bituser := $(shell echo -e "\#include <stdio.h>\n\#if !defined(__arch64__) && !defined(_LP64)\nuserspace_is_32bit\n\#endif" | $(CC) $(CFLAGS) -E - | grep userspace_is_32bit) |
| 81 | ifdef 32bituser |
| 82 | CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32 |
| 83 | endif |
| 84 | endif |
| 85 | else |
| 86 | CFLAGS+=-D_UNKNOWN_KERNEL_POINTER_SIZE |
| 87 | endif |
Rusty Russell | da70715 | 2001-04-21 04:25:09 +0000 | [diff] [blame] | 88 | endif |
| 89 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 90 | ifndef IPT_LIBDIR |
| 91 | IPT_LIBDIR:=$(LIBDIR)/iptables |
| 92 | endif |
| 93 | |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 94 | ifndef NO_SHARED_LIBS |
| 95 | DEPFILES = $(SHARED_LIBS:%.so=%.d) |
| 96 | SH_CFLAGS:=$(CFLAGS) -fPIC |
| 97 | STATIC_LIBS = |
| 98 | STATIC6_LIBS = |
| 99 | LDFLAGS = -rdynamic |
| 100 | LDLIBS = -ldl -lnsl |
| 101 | else |
| 102 | DEPFILES = $(EXT_OBJS:%.o=%.d) |
| 103 | STATIC_LIBS = extensions/libext.a |
| 104 | STATIC6_LIBS = extensions/libext6.a |
| 105 | LDFLAGS = -static |
| 106 | LDLIBS = |
| 107 | endif |
| 108 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 109 | .PHONY: default |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 110 | default: print-extensions all |
| 111 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 112 | .PHONY: print-extensions |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 113 | print-extensions: |
Rusty Russell | c8d7d89 | 2000-09-19 07:01:00 +0000 | [diff] [blame] | 114 | @[ -n "$(OPTIONALS)" ] && echo Extensions found: $(OPTIONALS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 115 | |
| 116 | iptables.o: iptables.c |
| 117 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< |
| 118 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 119 | ifeq ($(DO_MULTI), 1) |
| 120 | iptables: iptables-multi.c iptables-save.c iptables-restore.c iptables-standalone.c iptables.o $(STATIC_LIBS) libiptc/libiptc.a |
| 121 | $(CC) $(CFLAGS) -DIPTABLES_MULTI -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| 122 | else |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 123 | iptables: iptables-standalone.c iptables.o $(STATIC_LIBS) libiptc/libiptc.a |
| 124 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 125 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 126 | |
| 127 | $(DESTDIR)$(BINDIR)/iptables: iptables |
| 128 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 129 | cp $< $@ |
| 130 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 131 | iptables-save: iptables-save.c iptables.o $(STATIC_LIBS) libiptc/libiptc.a |
| 132 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 133 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 134 | ifeq ($(DO_MULTI), 1) |
| 135 | $(DESTDIR)$(BINDIR)/iptables-save: iptables |
| 136 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 137 | ln -sf $< $@ |
| 138 | else |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 139 | $(DESTDIR)$(BINDIR)/iptables-save: iptables-save |
| 140 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 141 | cp $< $@ |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 142 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 143 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 144 | iptables-restore: iptables-restore.c iptables.o $(STATIC_LIBS) libiptc/libiptc.a |
| 145 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 146 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 147 | ifeq ($(DO_MULTI), 1) |
| 148 | $(DESTDIR)$(BINDIR)/iptables-restore: iptables |
| 149 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 150 | ln -sf $< $@ |
| 151 | else |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 152 | $(DESTDIR)$(BINDIR)/iptables-restore: iptables-restore |
| 153 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 154 | cp $< $@ |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame^] | 155 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 156 | |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 157 | ip6tables.o: ip6tables.c |
Harald Welte | 0aefbd3 | 2001-05-11 21:41:47 +0000 | [diff] [blame] | 158 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 159 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 160 | ip6tables: ip6tables-standalone.c ip6tables.o $(STATIC6_LIBS) libiptc/libiptc.a |
Harald Welte | 2a7116e | 2002-08-26 13:09:40 +0000 | [diff] [blame] | 161 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 162 | |
| 163 | $(DESTDIR)$(BINDIR)/ip6tables: ip6tables |
| 164 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 165 | cp $< $@ |
| 166 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 167 | ip6tables-save: ip6tables-save.c ip6tables.o $(STATIC6_LIBS) libiptc/libiptc.a |
Harald Welte | 2a7116e | 2002-08-26 13:09:40 +0000 | [diff] [blame] | 168 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 169 | |
| 170 | $(DESTDIR)$(BINDIR)/ip6tables-save: ip6tables-save |
| 171 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 172 | cp $< $@ |
| 173 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 174 | ip6tables-restore: ip6tables-restore.c ip6tables.o $(STATIC6_LIBS) libiptc/libiptc.a |
Harald Welte | 2a7116e | 2002-08-26 13:09:40 +0000 | [diff] [blame] | 175 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 176 | |
| 177 | $(DESTDIR)$(BINDIR)/ip6tables-restore: ip6tables-restore |
| 178 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 179 | cp $< $@ |
| 180 | |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 181 | $(DESTDIR)$(MANDIR)/man8/%.8: %.8 |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 182 | @[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 |
| 183 | cp $< $@ |
| 184 | |
| 185 | EXTRA_DEPENDS+=iptables-standalone.d iptables.d |
| 186 | |
| 187 | iptables-standalone.d iptables.d: %.d: %.c |
| 188 | @-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d $*.o:@' > $@ |
| 189 | |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 190 | iptables.8: iptables.8.in extensions/libipt_matches.man extensions/libipt_targets.man |
| 191 | sed -e '/@MATCH@/ r extensions/libipt_matches.man' -e '/@TARGET@/ r extensions/libipt_targets.man' iptables.8.in >iptables.8 |
| 192 | |
| 193 | ip6tables.8: ip6tables.8.in extensions/libip6t_matches.man extensions/libip6t_targets.man |
| 194 | sed -e '/@MATCH@/ r extensions/libip6t_matches.man' -e '/@TARGET@/ r extensions/libiptt_targets.man' ip6tables.8.in >ip6tables.8 |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 195 | |
| 196 | # Development Targets |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 197 | .PHONY: install-devel-man3 |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 198 | install-devel-man3: $(DEVEL_MAN3) |
| 199 | @[ -d $(DESTDIR)$(MANDIR)/man3 ] || mkdir -p $(DESTDIR)$(MANDIR)/man3 |
| 200 | @cp -v $(DEVEL_MAN3) $(DESTDIR)$(MANDIR)/man3 |
| 201 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 202 | .PHONY: install-devel-headers |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 203 | install-devel-headers: $(DEVEL_HEADERS) |
| 204 | @[ -d $(DESTDIR)$(INCDIR) ] || mkdir -p $(DESTDIR)$(INCDIR) |
| 205 | @cp -v $(DEVEL_HEADERS) $(DESTDIR)$(INCDIR) |
| 206 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 207 | .PHONY: install-devel-libs |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 208 | install-devel-libs: $(DEVEL_LIBS) |
| 209 | @[ -d $(DESTDIR)$(LIBDIR) ] || mkdir -p $(DESTDIR)$(LIBDIR) |
| 210 | @cp -v $(DEVEL_LIBS) $(DESTDIR)$(LIBDIR) |
| 211 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 212 | .PHONY: install-devel |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 213 | install-devel: all install-devel-man3 install-devel-headers install-devel-libs |
| 214 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 215 | .PHONY: distclean |
Rusty Russell | 905795c | 2000-04-19 11:22:03 +0000 | [diff] [blame] | 216 | distclean: clean |
Rusty Russell | a470f33 | 2000-11-07 04:08:34 +0000 | [diff] [blame] | 217 | @rm -f TAGS `find . -name '*~' -o -name '.*~'` `find . -name '*.rej'` `find . -name '*.d'` .makefirst |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 218 | |
| 219 | # Rusty's distro magic. |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 220 | .PHONY: distrib |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 221 | distrib: check distclean delrelease $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 diff md5sums # nowhitespace |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 222 | |
| 223 | # Makefile must not define: |
Harald Welte | 380ba5f | 2002-02-13 16:19:55 +0000 | [diff] [blame] | 224 | # -g -pg -DIPTC_DEBUG |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 225 | .PHONY: check |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 226 | check: |
Harald Welte | 380ba5f | 2002-02-13 16:19:55 +0000 | [diff] [blame] | 227 | @if echo $(CFLAGS) | egrep -e '-g|-pg|IPTC_DEBUG' >/dev/null; then echo Remove debugging flags; exit 1; else exit 0; fi |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 228 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 229 | .PHONY: nowhitespace |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 230 | nowhitespace: |
Rusty Russell | 2e5f953 | 2001-01-07 09:37:02 +0000 | [diff] [blame] | 231 | @if grep -n '[ ]$$' `find . -name 'Makefile' -o -name '*.[ch]'`; then exit 1; else exit 0; fi |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 232 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 233 | .PHONY: delrelease |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 234 | delrelease: |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 235 | rm -f $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 236 | |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 237 | $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2: |
Harald Welte | ea4ab1c | 2004-06-14 22:07:06 +0000 | [diff] [blame] | 238 | cd .. && ln -sf iptables iptables-$(IPTABLES_VERSION) && tar cvf - --exclude CVS iptables-$(IPTABLES_VERSION)/. | bzip2 -9 > $@ && rm iptables-$(IPTABLES_VERSION) |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 239 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 240 | .PHONY: diff |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 241 | diff: $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 242 | @mkdir /tmp/diffdir |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 243 | @cd /tmp/diffdir && tar -x --bzip2 -f $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
| 244 | @set -e; cd /tmp/diffdir; tar -x --bzip2 -f $(RELEASE_DIR)/iptables-$(OLD_IPTABLES_VERSION).tar.bz2; echo Creating patch-iptables-$(OLD_IPTABLES_VERSION)-$(IPTABLES_VERSION).bz2; diff -urN iptables-$(OLD_IPTABLES_VERSION) iptables-$(IPTABLES_VERSION) | bzip2 -9 > $(RELEASE_DIR)/patch-iptables-$(OLD_IPTABLES_VERSION)-$(IPTABLES_VERSION).bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 245 | @rm -rf /tmp/diffdir |
| 246 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 247 | .PHONY: md5sums |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 248 | md5sums: |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 249 | cd $(RELEASE_DIR)/ && md5sum patch-iptables-*-$(IPTABLES_VERSION).bz2 iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 250 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 251 | # $(wildcard) fails wierdly with make v.3.78.1. |
| 252 | include $(shell echo */Makefile) |
| 253 | include Rules.make |