summaryrefslogtreecommitdiff
blob: 6669adde8378b9fa286b8e07bbeb42e692239272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
install headers and make a small archive for people to use

--- iptables/Makefile
+++ iptables/Makefile
@@ -102,6 +102,17 @@
 print-extensions:
 	@[ -n "$(OPTIONALS)" ] && echo Extensions found: $(OPTIONALS)
 
+EXTRAS+=libiptables.a
+DEVEL_HEADERS+=include/iptables.h include/xtables.h include/libipulog/libipulog.h
+DEVEL_LIBS+=libiptables.a
+ifeq ($(DO_IPV6), 1)
+EXTRAS+=libip6tables.a
+DEVEL_HEADERS+=include/ip6tables.h
+DEVEL_LIBS+=libip6tables.a
+endif
+libiptables.a: libiptables.a(iptables.o)
+libip6tables.a: libip6tables.a(ip6tables.o)
+
 iptables.o: iptables.c
 	$(CC) $(CFLAGS) -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" -c -o $@ $<
 
@@ -221,7 +232,7 @@
 .PHONY: install-devel-headers
 install-devel-headers: $(DEVEL_HEADERS)
 	@[ -d $(DESTDIR)$(INCDIR) ] || mkdir -p $(DESTDIR)$(INCDIR)
-	@cp -v $(DEVEL_HEADERS) $(DESTDIR)$(INCDIR)
+	@cd include && cp -v --parents $(patsubst include/%,%,$(DEVEL_HEADERS)) $(DESTDIR)$(INCDIR)
 
 .PHONY: install-devel-libs
 install-devel-libs: $(DEVEL_LIBS)
--- iptables/libiptc/Makefile
+++ iptables/libiptc/Makefile
@@ -16,8 +16,12 @@
 ifeq ($(DO_IPV6), 1)
 EXTRA_DEPENDS+= libiptc/libip6tc.d
 libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip6tc.o)
+DEVEL_HEADERS+=include/libiptc/libip6tc.h
 endif
 
+DEVEL_LIBS+=libiptc/libiptc.a
+DEVEL_HEADERS+=include/libiptc/libiptc.h include/libiptc/ipt_kernel_headers.h include/libiptc/libxtc.h
+
 libiptc/libip4tc.d libiptc/libip6tc.d: %.d: %.c
 	@-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d libiptc/libiptc.a($*.o):@' > $@
 endif