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 | |
Sven Wegener | 561e90e | 2007-07-15 17:13:24 +0000 | [diff] [blame] | 14 | # For recent kernels we only need the source in KERNEL_DIR to build. Older |
| 15 | # kernels have a bug, where linux/netfilter_ipv4.h includes linux/config.h, |
| 16 | # which includes linux/autoconf.h, which is placed into KBUILD_OUTPUT. |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 17 | ifndef KERNEL_DIR |
Sven Wegener | 561e90e | 2007-07-15 17:13:24 +0000 | [diff] [blame] | 18 | KERNEL_DIR="/lib/modules/$(shell uname -r)/source" |
| 19 | endif |
| 20 | ifndef KBUILD_OUTPUT |
| 21 | KBUILD_OUTPUT="/lib/modules/$(shell uname -r)/build" |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 22 | endif |
Pablo Neira Ayuso | 556c3d9 | 2007-06-25 12:01:12 +0000 | [diff] [blame] | 23 | IPTABLES_VERSION:=1.3.8 |
| 24 | OLD_IPTABLES_VERSION:=1.3.7 |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 25 | |
Pablo Neira AyusoMaurice van der Pot | 44fc5e1 | 2007-04-16 17:15:22 +0000 | [diff] [blame] | 26 | PREFIX:=/usr/local |
Harald Welte | ba6d012 | 2002-02-17 19:49:26 +0000 | [diff] [blame] | 27 | LIBDIR:=$(PREFIX)/lib |
| 28 | BINDIR:=$(PREFIX)/sbin |
| 29 | MANDIR:=$(PREFIX)/man |
| 30 | INCDIR:=$(PREFIX)/include |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 31 | |
Harald Welte | 3a5026f | 2001-09-02 16:07:33 +0000 | [diff] [blame] | 32 | # directory for new iptables releases |
| 33 | RELEASE_DIR:=/tmp |
| 34 | |
Rusty Russell | 209820b | 2001-01-08 08:14:33 +0000 | [diff] [blame] | 35 | # Need libc6 for this. FIXME: Should covert to autoconf. |
Rusty Russell | 4d2afbf | 2001-05-01 02:06:08 +0000 | [diff] [blame] | 36 | ifeq ($(shell [ -f /usr/include/netinet/ip6.h ] && echo YES), YES) |
Harald Welte | 2354d92 | 2003-03-04 23:15:42 +0000 | [diff] [blame] | 37 | DO_IPV6:=1 |
Rusty Russell | 8e07bd7 | 2000-12-19 03:11:00 +0000 | [diff] [blame] | 38 | endif |
| 39 | |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 40 | # Enable linking to libselinux via enviornment 'DO_SELINUX=1' |
| 41 | ifndef DO_SELINUX |
| 42 | DO_SELINUX=0 |
| 43 | endif |
| 44 | |
Harald Welte | 380ba5f | 2002-02-13 16:19:55 +0000 | [diff] [blame] | 45 | COPT_FLAGS:=-O2 |
Sven Wegener | 561e90e | 2007-07-15 17:13:24 +0000 | [diff] [blame] | 46 | CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KBUILD_OUTPUT)/include -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] | 47 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 48 | ifdef NO_SHARED_LIBS |
| 49 | CFLAGS += -DNO_SHARED_LIBS=1 |
| 50 | endif |
| 51 | |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 52 | EXTRAS+=iptables iptables.o iptables.8 |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 53 | EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8 |
| 54 | |
Harald Welte | eba774d | 2001-10-16 08:22:40 +0000 | [diff] [blame] | 55 | # No longer experimental. |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 56 | ifneq ($(DO_MULTI), 1) |
Amin Azez | 8d3eccb | 2006-11-13 20:23:36 +0000 | [diff] [blame] | 57 | EXTRAS+=iptables-save iptables-restore iptables-xml |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 58 | endif |
Amin Azez | 8d3eccb | 2006-11-13 20:23:36 +0000 | [diff] [blame] | 59 | EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore $(DESTDIR)$(BINDIR)/iptables-xml $(DESTDIR)$(MANDIR)/man8/iptables-restore.8 $(DESTDIR)$(MANDIR)/man8/iptables-save.8 |
Rusty Russell | 8e07bd7 | 2000-12-19 03:11:00 +0000 | [diff] [blame] | 60 | |
Harald Welte | 2354d92 | 2003-03-04 23:15:42 +0000 | [diff] [blame] | 61 | ifeq ($(DO_IPV6), 1) |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 62 | EXTRAS+=ip6tables ip6tables.o ip6tables.8 |
András Kis-Szabó | 0612943 | 2001-10-14 13:27:03 +0000 | [diff] [blame] | 63 | EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/ip6tables $(DESTDIR)$(MANDIR)/man8/ip6tables.8 |
Harald Welte | 8a6831a | 2001-03-15 15:33:56 +0000 | [diff] [blame] | 64 | EXTRAS_EXP+=ip6tables-save ip6tables-restore |
Harald Welte | 46d4d0a | 2001-03-16 15:48:56 +0000 | [diff] [blame] | 65 | 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] | 66 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 67 | |
| 68 | ifndef IPT_LIBDIR |
| 69 | IPT_LIBDIR:=$(LIBDIR)/iptables |
| 70 | endif |
| 71 | |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 72 | ifndef NO_SHARED_LIBS |
| 73 | DEPFILES = $(SHARED_LIBS:%.so=%.d) |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 74 | DEPFILES += $(SHARED_SE_LIBS:%.so=%.d) |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 75 | SH_CFLAGS:=$(CFLAGS) -fPIC |
| 76 | STATIC_LIBS = |
| 77 | STATIC6_LIBS = |
| 78 | LDFLAGS = -rdynamic |
Patrick McHardy | 51d84a1 | 2007-04-18 12:41:09 +0000 | [diff] [blame] | 79 | LDLIBS = -ldl |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 80 | ifeq ($(DO_SELINUX), 1) |
| 81 | LDLIBS += -lselinux |
| 82 | endif |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 83 | else |
| 84 | DEPFILES = $(EXT_OBJS:%.o=%.d) |
| 85 | STATIC_LIBS = extensions/libext.a |
| 86 | STATIC6_LIBS = extensions/libext6.a |
| 87 | LDFLAGS = -static |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 88 | LDLIBS = |
| 89 | ifeq ($(DO_SELINUX), 1) |
| 90 | LDLIBS += -lselinux |
| 91 | endif |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 92 | endif |
| 93 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 94 | .PHONY: default |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 95 | default: print-extensions all |
| 96 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 97 | .PHONY: print-extensions |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 98 | print-extensions: |
Rusty Russell | c8d7d89 | 2000-09-19 07:01:00 +0000 | [diff] [blame] | 99 | @[ -n "$(OPTIONALS)" ] && echo Extensions found: $(OPTIONALS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 100 | |
| 101 | iptables.o: iptables.c |
| 102 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< |
| 103 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 104 | ifeq ($(DO_MULTI), 1) |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 105 | iptables: iptables-multi.c iptables-save.c iptables-restore.c iptables-xml.c iptables-standalone.c iptables.o xtables.o $(STATIC_LIBS) libiptc/libiptc.a |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 106 | $(CC) $(CFLAGS) -DIPTABLES_MULTI -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| 107 | else |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 108 | iptables: iptables-standalone.c iptables.o xtables.o $(STATIC_LIBS) libiptc/libiptc.a |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 109 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 110 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 111 | |
| 112 | $(DESTDIR)$(BINDIR)/iptables: iptables |
| 113 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 114 | cp $< $@ |
| 115 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 116 | iptables-save: iptables-save.c iptables.o xtables.o $(STATIC_LIBS) libiptc/libiptc.a |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 117 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 118 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 119 | ifeq ($(DO_MULTI), 1) |
| 120 | $(DESTDIR)$(BINDIR)/iptables-save: iptables |
| 121 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 122 | ln -sf $< $@ |
| 123 | else |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 124 | $(DESTDIR)$(BINDIR)/iptables-save: iptables-save |
| 125 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 126 | cp $< $@ |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 127 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 128 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 129 | iptables-restore: iptables-restore.c iptables.o xtables.o $(STATIC_LIBS) libiptc/libiptc.a |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 130 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 131 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 132 | ifeq ($(DO_MULTI), 1) |
| 133 | $(DESTDIR)$(BINDIR)/iptables-restore: iptables |
| 134 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 135 | ln -sf $< $@ |
| 136 | else |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 137 | $(DESTDIR)$(BINDIR)/iptables-restore: iptables-restore |
| 138 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 139 | cp $< $@ |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 140 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 141 | |
Amin Azez | 8d3eccb | 2006-11-13 20:23:36 +0000 | [diff] [blame] | 142 | iptables-xml: iptables-xml.c #iptables.o # $(STATIC_LIBS) libiptc/libiptc.a |
| 143 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| 144 | |
| 145 | ifeq ($(DO_MULTI), 1) |
Lutz Jaenicke | e78c69c | 2006-12-09 13:06:04 +0000 | [diff] [blame] | 146 | $(DESTDIR)$(BINDIR)/iptables-xml: iptables |
Amin Azez | 8d3eccb | 2006-11-13 20:23:36 +0000 | [diff] [blame] | 147 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 148 | ln -sf $< $@ |
| 149 | else |
| 150 | $(DESTDIR)$(BINDIR)/iptables-xml: iptables-xml |
| 151 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 152 | cp $< $@ |
| 153 | endif |
| 154 | |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 155 | ip6tables.o: ip6tables.c |
Harald Welte | 0aefbd3 | 2001-05-11 21:41:47 +0000 | [diff] [blame] | 156 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 157 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 158 | ip6tables: ip6tables-standalone.c ip6tables.o xtables.o $(STATIC6_LIBS) libiptc/libiptc.a |
Harald Welte | 2a7116e | 2002-08-26 13:09:40 +0000 | [diff] [blame] | 159 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 160 | |
| 161 | $(DESTDIR)$(BINDIR)/ip6tables: ip6tables |
| 162 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 163 | cp $< $@ |
| 164 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 165 | ip6tables-save: ip6tables-save.c ip6tables.o xtables.o $(STATIC6_LIBS) libiptc/libiptc.a |
Harald Welte | 2a7116e | 2002-08-26 13:09:40 +0000 | [diff] [blame] | 166 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 167 | |
| 168 | $(DESTDIR)$(BINDIR)/ip6tables-save: ip6tables-save |
| 169 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 170 | cp $< $@ |
| 171 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame^] | 172 | ip6tables-restore: ip6tables-restore.c ip6tables.o xtables.o $(STATIC6_LIBS) libiptc/libiptc.a |
Harald Welte | 2a7116e | 2002-08-26 13:09:40 +0000 | [diff] [blame] | 173 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 174 | |
| 175 | $(DESTDIR)$(BINDIR)/ip6tables-restore: ip6tables-restore |
| 176 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 177 | cp $< $@ |
| 178 | |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 179 | $(DESTDIR)$(MANDIR)/man8/%.8: %.8 |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 180 | @[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 |
| 181 | cp $< $@ |
| 182 | |
| 183 | EXTRA_DEPENDS+=iptables-standalone.d iptables.d |
| 184 | |
| 185 | iptables-standalone.d iptables.d: %.d: %.c |
| 186 | @-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d $*.o:@' > $@ |
| 187 | |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 188 | iptables.8: iptables.8.in extensions/libipt_matches.man extensions/libipt_targets.man |
| 189 | sed -e '/@MATCH@/ r extensions/libipt_matches.man' -e '/@TARGET@/ r extensions/libipt_targets.man' iptables.8.in >iptables.8 |
| 190 | |
| 191 | ip6tables.8: ip6tables.8.in extensions/libip6t_matches.man extensions/libip6t_targets.man |
Phil Oester | de8ae51 | 2004-09-09 09:57:11 +0000 | [diff] [blame] | 192 | sed -e '/@MATCH@/ r extensions/libip6t_matches.man' -e '/@TARGET@/ r extensions/libip6t_targets.man' ip6tables.8.in >ip6tables.8 |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 193 | |
| 194 | # Development Targets |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 195 | .PHONY: install-devel-man3 |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 196 | install-devel-man3: $(DEVEL_MAN3) |
| 197 | @[ -d $(DESTDIR)$(MANDIR)/man3 ] || mkdir -p $(DESTDIR)$(MANDIR)/man3 |
| 198 | @cp -v $(DEVEL_MAN3) $(DESTDIR)$(MANDIR)/man3 |
| 199 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 200 | .PHONY: install-devel-headers |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 201 | install-devel-headers: $(DEVEL_HEADERS) |
| 202 | @[ -d $(DESTDIR)$(INCDIR) ] || mkdir -p $(DESTDIR)$(INCDIR) |
| 203 | @cp -v $(DEVEL_HEADERS) $(DESTDIR)$(INCDIR) |
| 204 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 205 | .PHONY: install-devel-libs |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 206 | install-devel-libs: $(DEVEL_LIBS) |
| 207 | @[ -d $(DESTDIR)$(LIBDIR) ] || mkdir -p $(DESTDIR)$(LIBDIR) |
| 208 | @cp -v $(DEVEL_LIBS) $(DESTDIR)$(LIBDIR) |
| 209 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 210 | .PHONY: install-devel |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 211 | install-devel: all install-devel-man3 install-devel-headers install-devel-libs |
| 212 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 213 | .PHONY: distclean |
Rusty Russell | 905795c | 2000-04-19 11:22:03 +0000 | [diff] [blame] | 214 | distclean: clean |
Rusty Russell | a470f33 | 2000-11-07 04:08:34 +0000 | [diff] [blame] | 215 | @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] | 216 | |
| 217 | # Rusty's distro magic. |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 218 | .PHONY: distrib |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 219 | 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] | 220 | |
| 221 | # Makefile must not define: |
Harald Welte | 380ba5f | 2002-02-13 16:19:55 +0000 | [diff] [blame] | 222 | # -g -pg -DIPTC_DEBUG |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 223 | .PHONY: check |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 224 | check: |
Patrick McHardy | 83321c0 | 2007-01-10 13:56:05 +0000 | [diff] [blame] | 225 | @if echo $(CFLAGS) | egrep -e '(^|[[:space:]])(-g|-pg|-DIPTC_DEBUG)([[:space:]]|$)' >/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] | 226 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 227 | .PHONY: nowhitespace |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 228 | nowhitespace: |
Rusty Russell | 2e5f953 | 2001-01-07 09:37:02 +0000 | [diff] [blame] | 229 | @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] | 230 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 231 | .PHONY: delrelease |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 232 | delrelease: |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 233 | rm -f $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 234 | |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 235 | $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2: |
Harald Welte | 5974683 | 2005-02-01 16:47:35 +0000 | [diff] [blame] | 236 | cd .. && ln -sf iptables iptables-$(IPTABLES_VERSION) && tar cvf - --exclude .svn iptables-$(IPTABLES_VERSION)/. | bzip2 -9 > $@ && rm iptables-$(IPTABLES_VERSION) |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 237 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 238 | .PHONY: diff |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 239 | diff: $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 240 | @mkdir /tmp/diffdir |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 241 | @cd /tmp/diffdir && tar -x --bzip2 -f $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
| 242 | @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] | 243 | @rm -rf /tmp/diffdir |
| 244 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 245 | .PHONY: md5sums |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 246 | md5sums: |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 247 | 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] | 248 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 249 | # $(wildcard) fails wierdly with make v.3.78.1. |
| 250 | include $(shell echo */Makefile) |
| 251 | include Rules.make |