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 |
Yasuyuki KOZAKAI | dbda07b | 2007-07-24 06:08:05 +0000 | [diff] [blame] | 71 | DEST_IPT_LIBDIR:=$(DESTDIR)$(LIBDIR)/iptables |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 72 | |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 73 | ifndef NO_SHARED_LIBS |
| 74 | DEPFILES = $(SHARED_LIBS:%.so=%.d) |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 75 | DEPFILES += $(SHARED_SE_LIBS:%.so=%.d) |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 76 | SH_CFLAGS:=$(CFLAGS) -fPIC |
| 77 | STATIC_LIBS = |
| 78 | STATIC6_LIBS = |
| 79 | LDFLAGS = -rdynamic |
Patrick McHardy | 51d84a1 | 2007-04-18 12:41:09 +0000 | [diff] [blame] | 80 | LDLIBS = -ldl |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 81 | ifeq ($(DO_SELINUX), 1) |
| 82 | LDLIBS += -lselinux |
| 83 | endif |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 84 | else |
| 85 | DEPFILES = $(EXT_OBJS:%.o=%.d) |
| 86 | STATIC_LIBS = extensions/libext.a |
| 87 | STATIC6_LIBS = extensions/libext6.a |
| 88 | LDFLAGS = -static |
James Morris | c81a3f3 | 2006-05-24 16:11:58 +0000 | [diff] [blame] | 89 | LDLIBS = |
| 90 | ifeq ($(DO_SELINUX), 1) |
| 91 | LDLIBS += -lselinux |
| 92 | endif |
Martin Josefsson | dc93fce | 2004-05-26 15:46:27 +0000 | [diff] [blame] | 93 | endif |
| 94 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 95 | .PHONY: default |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 96 | default: print-extensions all |
| 97 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 98 | .PHONY: print-extensions |
Rusty Russell | 5245182 | 2000-08-27 07:47:46 +0000 | [diff] [blame] | 99 | print-extensions: |
Rusty Russell | c8d7d89 | 2000-09-19 07:01:00 +0000 | [diff] [blame] | 100 | @[ -n "$(OPTIONALS)" ] && echo Extensions found: $(OPTIONALS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 101 | |
| 102 | iptables.o: iptables.c |
| 103 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< |
| 104 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 105 | ifeq ($(DO_MULTI), 1) |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 106 | 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] | 107 | $(CC) $(CFLAGS) -DIPTABLES_MULTI -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| 108 | else |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 109 | 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] | 110 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 111 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 112 | |
| 113 | $(DESTDIR)$(BINDIR)/iptables: iptables |
| 114 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 115 | cp $< $@ |
| 116 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 117 | 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] | 118 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 119 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 120 | ifeq ($(DO_MULTI), 1) |
| 121 | $(DESTDIR)$(BINDIR)/iptables-save: iptables |
| 122 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 123 | ln -sf $< $@ |
| 124 | else |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 125 | $(DESTDIR)$(BINDIR)/iptables-save: iptables-save |
| 126 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 127 | cp $< $@ |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 128 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 129 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 130 | 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] | 131 | $(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 132 | |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 133 | ifeq ($(DO_MULTI), 1) |
| 134 | $(DESTDIR)$(BINDIR)/iptables-restore: iptables |
| 135 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 136 | ln -sf $< $@ |
| 137 | else |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 138 | $(DESTDIR)$(BINDIR)/iptables-restore: iptables-restore |
| 139 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 140 | cp $< $@ |
Bastiaan Bakker | 4e3771f | 2004-06-25 11:18:57 +0000 | [diff] [blame] | 141 | endif |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 142 | |
Amin Azez | 8d3eccb | 2006-11-13 20:23:36 +0000 | [diff] [blame] | 143 | iptables-xml: iptables-xml.c #iptables.o # $(STATIC_LIBS) libiptc/libiptc.a |
| 144 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| 145 | |
| 146 | ifeq ($(DO_MULTI), 1) |
Lutz Jaenicke | e78c69c | 2006-12-09 13:06:04 +0000 | [diff] [blame] | 147 | $(DESTDIR)$(BINDIR)/iptables-xml: iptables |
Amin Azez | 8d3eccb | 2006-11-13 20:23:36 +0000 | [diff] [blame] | 148 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 149 | ln -sf $< $@ |
| 150 | else |
| 151 | $(DESTDIR)$(BINDIR)/iptables-xml: iptables-xml |
| 152 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 153 | cp $< $@ |
| 154 | endif |
| 155 | |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 156 | ip6tables.o: ip6tables.c |
Harald Welte | 0aefbd3 | 2001-05-11 21:41:47 +0000 | [diff] [blame] | 157 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $< |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 158 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 159 | 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] | 160 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 161 | |
| 162 | $(DESTDIR)$(BINDIR)/ip6tables: ip6tables |
| 163 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 164 | cp $< $@ |
| 165 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 166 | 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] | 167 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 168 | |
| 169 | $(DESTDIR)$(BINDIR)/ip6tables-save: ip6tables-save |
| 170 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 171 | cp $< $@ |
| 172 | |
Yasuyuki KOZAKAI | 5208806 | 2007-07-24 05:44:11 +0000 | [diff] [blame] | 173 | 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] | 174 | $(CC) $(CFLAGS) -DIP6T_LIB_DIR=\"$(IPT_LIBDIR)\" $(LDFLAGS) -o $@ $^ $(LDLIBS) |
Philip Blundell | 8c70090 | 2000-05-15 02:17:52 +0000 | [diff] [blame] | 175 | |
| 176 | $(DESTDIR)$(BINDIR)/ip6tables-restore: ip6tables-restore |
| 177 | @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 178 | cp $< $@ |
| 179 | |
Rusty Russell | 01c4520 | 2001-01-07 06:50:31 +0000 | [diff] [blame] | 180 | $(DESTDIR)$(MANDIR)/man8/%.8: %.8 |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 181 | @[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8 |
| 182 | cp $< $@ |
| 183 | |
| 184 | EXTRA_DEPENDS+=iptables-standalone.d iptables.d |
| 185 | |
| 186 | iptables-standalone.d iptables.d: %.d: %.c |
| 187 | @-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d $*.o:@' > $@ |
| 188 | |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 189 | iptables.8: iptables.8.in extensions/libipt_matches.man extensions/libipt_targets.man |
| 190 | sed -e '/@MATCH@/ r extensions/libipt_matches.man' -e '/@TARGET@/ r extensions/libipt_targets.man' iptables.8.in >iptables.8 |
| 191 | |
| 192 | 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] | 193 | 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] | 194 | |
| 195 | # Development Targets |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 196 | .PHONY: install-devel-man3 |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 197 | install-devel-man3: $(DEVEL_MAN3) |
| 198 | @[ -d $(DESTDIR)$(MANDIR)/man3 ] || mkdir -p $(DESTDIR)$(MANDIR)/man3 |
| 199 | @cp -v $(DEVEL_MAN3) $(DESTDIR)$(MANDIR)/man3 |
| 200 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 201 | .PHONY: install-devel-headers |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 202 | install-devel-headers: $(DEVEL_HEADERS) |
| 203 | @[ -d $(DESTDIR)$(INCDIR) ] || mkdir -p $(DESTDIR)$(INCDIR) |
| 204 | @cp -v $(DEVEL_HEADERS) $(DESTDIR)$(INCDIR) |
| 205 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 206 | .PHONY: install-devel-libs |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 207 | install-devel-libs: $(DEVEL_LIBS) |
| 208 | @[ -d $(DESTDIR)$(LIBDIR) ] || mkdir -p $(DESTDIR)$(LIBDIR) |
| 209 | @cp -v $(DEVEL_LIBS) $(DESTDIR)$(LIBDIR) |
| 210 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 211 | .PHONY: install-devel |
James Morris | c82e9ac | 2000-11-24 14:34:02 +0000 | [diff] [blame] | 212 | install-devel: all install-devel-man3 install-devel-headers install-devel-libs |
| 213 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 214 | .PHONY: distclean |
Rusty Russell | 905795c | 2000-04-19 11:22:03 +0000 | [diff] [blame] | 215 | distclean: clean |
Rusty Russell | a470f33 | 2000-11-07 04:08:34 +0000 | [diff] [blame] | 216 | @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] | 217 | |
| 218 | # Rusty's distro magic. |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 219 | .PHONY: distrib |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 220 | 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] | 221 | |
| 222 | # Makefile must not define: |
Harald Welte | 380ba5f | 2002-02-13 16:19:55 +0000 | [diff] [blame] | 223 | # -g -pg -DIPTC_DEBUG |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 224 | .PHONY: check |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 225 | check: |
Patrick McHardy | 83321c0 | 2007-01-10 13:56:05 +0000 | [diff] [blame] | 226 | @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] | 227 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 228 | .PHONY: nowhitespace |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 229 | nowhitespace: |
Rusty Russell | 2e5f953 | 2001-01-07 09:37:02 +0000 | [diff] [blame] | 230 | @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] | 231 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 232 | .PHONY: delrelease |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 233 | delrelease: |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 234 | rm -f $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 235 | |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 236 | $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2: |
Harald Welte | 5974683 | 2005-02-01 16:47:35 +0000 | [diff] [blame] | 237 | 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] | 238 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 239 | .PHONY: diff |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 240 | diff: $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 241 | @mkdir /tmp/diffdir |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 242 | @cd /tmp/diffdir && tar -x --bzip2 -f $(RELEASE_DIR)/iptables-$(IPTABLES_VERSION).tar.bz2 |
| 243 | @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] | 244 | @rm -rf /tmp/diffdir |
| 245 | |
Harald Welte | 7505d61 | 2001-07-31 13:06:17 +0000 | [diff] [blame] | 246 | .PHONY: md5sums |
Rusty Russell | 175f641 | 2000-03-24 09:32:20 +0000 | [diff] [blame] | 247 | md5sums: |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 248 | 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] | 249 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 250 | # $(wildcard) fails wierdly with make v.3.78.1. |
| 251 | include $(shell echo */Makefile) |
| 252 | include Rules.make |