~csurbhi/ubuntu/maverick/iptables/iptable-fix.600195

« back to all changes in this revision

Viewing changes to Rules.make

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-06-24 15:06:04 UTC
  • mfrom: (5.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080624150604-5t7r1o1kxq0ycz81
Tags: 1.4.0-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Took references to 2.4 kernel out of doc-base control files (Jordan
    Mantha, Malone #25972) (patches/all/091-fix-2.4-references.patch)
  - Use linux-libc-dev instead of local copy of kernel-headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/make
 
2
 
 
3
all: $(SHARED_LIBS) $(SHARED_SE_LIBS) $(EXTRAS)
 
4
 
 
5
experimental: $(EXTRAS_EXP)
 
6
 
 
7
# Have to handle extensions which no longer exist.
 
8
clean: $(EXTRA_CLEANS)
 
9
        rm -f $(SHARED_LIBS) $(SHARED_SE_LIBS) $(EXTRAS) $(EXTRAS_EXP) $(SHARED_LIBS:%.so=%_sh.o) $(SHARED_SE_LIBS:%.so=%_sh.o)
 
10
        rm -f extensions/initext.c extensions/initext6.c
 
11
        @find . -name '*.[ao]' -o -name '*.so' | xargs rm -f
 
12
 
 
13
install: all $(EXTRA_INSTALLS)
 
14
        @if [ -f /usr/local/bin/iptables -a "$(BINDIR)" = "/usr/local/sbin" ];\
 
15
        then echo 'Erasing iptables from old location (now /usr/local/sbin).';\
 
16
        rm -f /usr/local/bin/iptables;\
 
17
        fi
 
18
 
 
19
install-experimental: $(EXTRA_INSTALLS_EXP)
 
20
 
 
21
TAGS:
 
22
        @rm -f $@
 
23
        find . -name '*.[ch]' | xargs etags -a
 
24
 
 
25
dep: $(DEPFILES) $(EXTRA_DEPENDS)
 
26
        @echo Dependencies will be generated on next make.
 
27
        rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
 
28
 
 
29
$(SHARED_LIBS:%.so=%.d): %.d: %.c
 
30
        @-$(CC) -M -MG $(CFLAGS) $< | \
 
31
            sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
 
32
 
 
33
$(SHARED_LIBS): %.so : %_sh.o
 
34
        $(CC) -shared $(EXT_LDFLAGS) -o $@ $<
 
35
 
 
36
$(SHARED_SE_LIBS:%.so=%.d): %.d: %.c
 
37
        @-$(CC) -M -MG $(CFLAGS) $< | \
 
38
                sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
 
39
 
 
40
$(SHARED_SE_LIBS): %.so : %_sh.o
 
41
        $(LD) -shared $(EXT_LDFLAGS) -o $@ $< $(LDLIBS)
 
42
 
 
43
%_sh.o : %.c
 
44
        $(CC) $(SH_CFLAGS) -o $@ -c $<
 
45
 
 
46
.makefirst:
 
47
        @echo Making dependencies: please wait...
 
48
        @touch .makefirst
 
49
 
 
50
# This is useful for when dependencies completely screwed
 
51
%.h::
 
52
        @echo "Unable to resolve dependency on $@. Try 'make clean'."
 
53
        @-rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
 
54
        @[ -d $(KERNEL_DIR)/include/linux/netfilter_ipv4 ] || echo -e '\n\n    Please try `make KERNEL_DIR=path-to-correct-kernel'\'.'\n\n'
 
55
        @exit 1
 
56
 
 
57
-include $(DEPFILES) $(EXTRA_DEPENDS)
 
58
-include .makefirst