Debian Codegraph @

Makefile

raw ◀ ▶
3 Debian patches touch this file
1 ARPTABLES_VERSION:=0.0.5
2
3 KERNEL_DIR:=./
4 # default paths
•5 PREFIX:=/usr
6 LIBDIR:=$(PREFIX)/lib
7 BINDIR:=$(PREFIX)/sbin
•8 MANDIR:=/usr/share/man
9 man8dir=$(MANDIR)/man8
•10 SYSCONFIGDIR:=/etc/default
11 DESTDIR:=
12
13 MANS = arptables-legacy.8 arptables-save.8 arptables-restore.8
14
•15 DEFAULT_CFLAGS = -O2 -Wall -Wunused
16 DEFAULT_CPPFLAGS = -I$(KERNEL_DIR)/include -Iinclude -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
17
18 ifndef ARPT_LIBDIR
19 ARPT_LIBDIR:=$(LIBDIR)/arptables
20 endif
21
22 include extensions/Makefile
23
24 all: arptables-legacy libarptc/libarptc.a
25
26 arptables.o: arptables.c
•27 $(CC) $(DEFAULT_CPPFLAGS) $(CPPFLAGS) $(DEFAULT_CFLAGS) $(CFLAGS) -c -o $@ $<
28
29 arptables-standalone.o: arptables-standalone.c
•30 $(CC) $(DEFAULT_CPPFLAGS) $(CPPFLAGS) $(DEFAULT_CFLAGS) $(CFLAGS) -c -o $@ $<
31
32 libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
•33 $(CC) $(DEFAULT_CPPFLAGS) $(CPPFLAGS) $(DEFAULT_CFLAGS) $(CFLAGS) -c -o $@ $<
34
35 libarptc/libarptc.a: libarptc/libarptc.o
36 $(AR) rcs $@ $<
37
38 arptables-legacy: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS)
•39 $(CC) $(DEFAULT_CPPFLAGS) $(CPPFLAGS) $(DEFAULT_CFLAGS) $(CFLAGS) $(DEFAULT_LDFLAGS) $(LDFLAGS) -o $@ $^
40
41 tmp1:=$(shell printf $(BINDIR) | sed 's/\//\\\//g')
42 tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g')
•43 .PHONY: install-bin
44 install-bin: arptables-legacy arptables-save arptables-restore
45 install -d $(DESTDIR)$(BINDIR)
46 install -m 0755 arptables-legacy $(DESTDIR)$(BINDIR)
47 cat arptables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-save_
48 install -m 0755 arptables-save_ $(DESTDIR)$(BINDIR)/arptables-legacy-save
49 cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_
•50 install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-legacy-restore
51 rm -f arptables-save_ arptables-restore_
52
53 .PHONY: install-man
54 install-man: $(MANS)
55 [ -d "$(DESTDIR)$(man8dir)" ] || mkdir -p "$(DESTDIR)$(man8dir)"
56 install -m 0644 $^ $(DESTDIR)$(man8dir)/
57
58 .PHONY: install
•59 install: install-man install-bin
60
61 .PHONY: clean
62 clean:
63 rm -f arptables-legacy
64 rm -f *.o *~
65 rm -f extensions/*.o extensions/*~
66 rm -f libarptc/*.o libarptc/*~ libarptc/*.a
67 rm -f include/*~ include/libarptc/*~
68
69 DIR:=arptables-v$(ARPTABLES_VERSION)
70 # This is used to make a new userspace release
71 .PHONY: release
72 release:
73 make clean
74 cd ..;find $(DIR) -exec touch {} \;;find $(DIR) -exec chmod o-r,g-r,o-w,g-w,o-x,g-x {} \;;tar -pc $(DIR) | gzip >$(DIR).tar.gz
75