]> git.ipfire.org Git - people/stevee/network.git/blame - Makefile
Obsolete Makeconfig file.
[people/stevee/network.git] / Makefile
CommitLineData
bf41b85d
MT
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2012-2013 IPFire Network Development Team #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21PACKAGE_NAME = network
22PACKAGE_VERSION = 005
aa574002
MT
23
24DESTDIR=
25
e7399160
MT
26# Export HTML documents to this directory.
27HTML_DOCS_DIR = html
28
120c0830
SS
29prefix=/usr
30bindir=$(prefix)/bin
31sbindir=$(prefix)/sbin
32libdir=$(prefix)/lib
afb7d704 33datadir=$(prefix)/share
f8915761 34mandir=$(datadir)/man
120c0830
SS
35sysconfdir=/etc
36localstatedir=/var
5bb2429a 37systemdunitdir=$(prefix)/lib/systemd/system
5529407b 38tmpfilesdir=$(prefix)/lib/tmpfiles.d
120c0830 39
d9e4e1ab 40# File to store the version number in.
120c0830 41VERSION_FILE = $(DESTDIR)$(libdir)/network/version
d9e4e1ab 42
a2a6f759
MT
43# A list of files which should be removed on "make clean"
44CLEANFILES =
45
46# man pages
47MAN_PAGES = \
48 man/network.8 \
49 man/network-config.8 \
50 man/network-device.8 \
51 man/network-dns-server.8 \
52 man/network-port-batman-adv.8 \
53 man/network-port-batman-adv-port.8 \
54 man/network-route.8 \
55 man/network-zone.8 \
1e00d198 56 man/network-zone-6to4-tunnel.8 \
a2a6f759
MT
57 man/network-zone-bridge.8 \
58 man/network-zone-config-pppoe-server.8 \
59 man/network-zone-pppoe.8
60
61MAN_PAGES_HTML = $(patsubst %.xml,%.html,$(MAN_PAGES_XML))
62MAN_PAGES_XML = $(patsubst %.8,%.xml,$(MAN_PAGES))
f8915761 63MAN_PAGES_8 = $(filter %.8,$(MAN_PAGES))
a2a6f759
MT
64
65CLEANFILES += \
66 $(MAN_PAGES) \
67 $(MAN_PAGES_HTML)
68
69XSLTPROC = xsltproc
70
71XSLTPROC_FLAGS = \
72 --nonet \
73 --stringparam man.output.quietly 1 \
74 --stringparam funcsynopsis.style ansi \
75 --stringparam man.th.extra1.suppress 1 \
76 --stringparam man.authors.section.enabled 1 \
77 --stringparam man.copyright.section.enabled 1
78
79XSLTPROC_COMMAND_MAN = \
80 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
81 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
82
83XSLTPROC_COMMAND_HTML = \
84 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) man/custom-html.xsl $<
85
86man/%.8: man/%.xml
87 $(XSLTPROC_COMMAND_MAN)
88
89man/%.html: man/%.xml man/custom-html.xsl
90 $(XSLTPROC_COMMAND_HTML)
91
de28a630 92.PHONY: all
a2a6f759 93all: $(MAN_PAGES)
aa574002 94
de28a630 95.PHONY: install
f8915761 96install: $(MAN_PAGES)
120c0830
SS
97 -mkdir -pv $(DESTDIR)$(sysconfdir)/{network/{ports,zones},ppp}
98 -mkdir -pv $(DESTDIR)$(libdir)/{network,sysctl.d,udev}
99 -mkdir -pv $(DESTDIR)$(localstatedir)/log/network
100 -mkdir -pv $(DESTDIR)$(sbindir)
5bb2429a 101 -mkdir -pv $(DESTDIR)$(systemdunitdir)
5529407b 102 -mkdir -pv $(DESTDIR)$(tmpfilesdir)
afb7d704 103 -mkdir -pv $(DESTDIR)$(datadir)/firewall
aa574002 104
98146c00 105 install -m 755 -v firewall $(DESTDIR)$(sbindir)
120c0830 106 install -m 755 -v network $(DESTDIR)$(sbindir)
aa574002 107
120c0830
SS
108 cp -rfv {hooks,header*,functions*} $(DESTDIR)$(libdir)/network/
109 cp -fv sysctl.d/* $(DESTDIR)$(libdir)/sysctl.d/
110 cp -rfv udev/* $(DESTDIR)$(libdir)/udev
111 cp -rfv network-* $(DESTDIR)$(libdir)/network/
5bb2429a 112 cp -vf systemd/*.service $(DESTDIR)$(systemdunitdir)
5529407b 113 cp -vf network.tmpfiles $(DESTDIR)$(tmpfilesdir)/network.conf
aa574002 114
28f0b4ab
MT
115 # Install the helper tools.
116 -mkdir -pv $(DESTDIR)$(libdir)/network/helpers
117 cp -vf helpers/* $(DESTDIR)$(libdir)/network/helpers
118
ca79d92e
MT
119 # Install bridge-stp.
120 ln -svf --relative \
121 $(DESTDIR)$(libdir)/network/helpers/bridge-stp \
122 $(DESTDIR)$(sbindir)/
30812a00 123
e9ea243e 124 # Install dhclient script and helper.
5bb2429a
MT
125 install -m 755 dhclient-helper $(DESTDIR)$(libdir)/network/
126 install -m 755 dhclient-script $(DESTDIR)$(sbindir)/
e9ea243e 127
120c0830
SS
128 install -m 755 -v ppp/ip-updown $(DESTDIR)$(sysconfdir)/ppp
129 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-pre-up
130 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-up
131 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-down
ef620c07
MT
132 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ipv6-up
133 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ipv6-down
6c74a64c 134 install -m 755 -v ppp/dialer $(DESTDIR)$(libdir)/network/
aa574002 135
999d659b
MT
136 # Install pppoe-server wrapper.
137 install -m 755 ppp/pppoe-server $(DESTDIR)$(libdir)/network/
138
afb7d704
MT
139 # Install the firewall macros.
140 cp -av macros $(DESTDIR)$(datadir)/firewall/
141
d9e4e1ab 142 # Create the version file.
ef620c07
MT
143 : > $(VERSION_FILE)
144 echo "# This file is automatically generated." >> $(VERSION_FILE)
de28a630
MT
145 echo "NETWORK_VERSION=$(PACKAGE_VERSION)" >> $(VERSION_FILE)
146
f8915761
MT
147 # Install man pages.
148 -mkdir -pv $(DESTDIR)$(mandir)/man8
149 install -v -m 644 $(MAN_PAGES_8) $(DESTDIR)$(mandir)/man8
150
a2a6f759
MT
151.PHONY: clean
152clean:
153 rm -f $(CLEANFILES)
d9e4e1ab 154
aa574002 155dist:
de28a630
MT
156 git archive --format tar --prefix $(PACKAGE_NAME)-$(PACKAGE_VERSION)/ HEAD | gzip -9 > \
157 $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
a2a6f759
MT
158
159.PHONY: export-html-docs
160export-html-docs: $(MAN_PAGES_HTML)
e7399160
MT
161 mkdir -pv $(HTML_DOCS_DIR)
162 cp -vf $^ $(HTML_DOCS_DIR)