File: Makefile.in

package info (click to toggle)
mrtg 2.9.17-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,140 kB
  • ctags: 1,517
  • sloc: perl: 22,688; ansic: 3,536; sh: 1,309; makefile: 319; php: 227; awk: 213; csh: 49; exp: 16
file content (130 lines) | stat: -rw-r--r-- 5,117 bytes parent folder | download
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# things that the GNU standards document suggests all makefiles
# should have.
SHELL=/bin/sh
VER=2.9.17
.SUFFIXES:
.SUFFIXES: .c .o .pl .pm .pod .html .man .wml .1 .txt

prefix = @prefix@
libdir = @libdir@

top_srcdir = @top_srcdir@

# Where is perl 5 on this machine
PERL = @PERL@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
GDFORM_EXT = @GDFORM_EXT@
LD_RUN_PATH = @LD_RUN_PATH@

INSTALL = @INSTALL@
MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs

all:	 bin/rateup subst

bin/rateup: src/rateup.c
	LD_RUN_PATH=$(LD_RUN_PATH) $(CC) $(CPPFLAGS) $(CFLAGS) src/rateup.c $(LDFLAGS) -o bin/rateup

subst:
	$(PERL) -0777 -pi -e 's@^#!\s*/\S*perl@#! $(PERL)@' bin/cfgmaker bin/indexmaker bin/mrtg
	$(PERL) -0777 -pi -e 's@GRAPHFMT="...";@GRAPHFMT="$(GDFORM_EXT)";@' bin/mrtg bin/indexmaker

clean:
	-rm bin/rateup
	-rm config.cache

install:
	$(MKINSTALLDIRS) $(prefix)/bin
	for x in bin/mrtg bin/cfgmaker bin/indexmaker bin/rateup; do \
	  $(INSTALL) -m 755 $$x $(prefix)/bin; done
	$(MKINSTALLDIRS) $(prefix)/lib/mrtg2/Pod
	for x in lib/mrtg2/*.pm; do \
	  $(INSTALL) -m 644 $$x $(prefix)/lib/mrtg2; done
	for x in lib/mrtg2/Pod/*.pm; do \
	  $(INSTALL) -m 644 $$x $(prefix)/lib/mrtg2/Pod; done
	for x in images/*.gif images/*.png; do \
	  $(INSTALL) -m 644 $$x $(prefix)/lib/mrtg2; done
	$(MKINSTALLDIRS) $(prefix)/doc/mrtg2
	for x in COPYING COPYRIGHT README CHANGES THANKS doc/*.pod doc/*.html doc/*.wml doc/*.txt doc/*.png; do \
	  $(INSTALL) -m 644 $$x $(prefix)/doc/mrtg2; done
	$(MKINSTALLDIRS) $(prefix)/man/man1
	for x in doc/*.1; do \
	  $(INSTALL) -m 644 $$x $(prefix)/man/man1; done

########### Distribution Tools

###
### Things you might NOT want to play with ... 
###

ARCHIVE = mrtg-$(VER)
DIRNAME = mrtg-$(VER)

POD = doc/faq.pod           doc/logfile.pod       doc/nt-guide.pod      doc/unix-guide.pod   \
      doc/forum.pod         doc/mibhelp.pod       doc/reference.pod     doc/webserver.pod    \
      doc/mrtg-rrd.pod      doc/squid.pod         doc/mrtg.pod       doc/contrib.pod \
      doc/cfgmaker.pod      doc/indexmaker.pod    doc/mrtglib.pod

MAN = $(POD:.pod=.1)
TXT = $(POD:.pod=.txt)
HTML = $(POD:.pod=.html) doc/index.html

getpod:
	-rm $(HTML) $(MAN) $(TXT)
	-rm doc/cfgmaker.pod; ln -s ../bin/cfgmaker doc/cfgmaker.pod
	-rm doc/indexmaker.pod;ln -s ../bin/indexmaker doc/indexmaker.pod
	-rm doc/mrtglib.pod;ln -s ../lib/mrtg2/MRTG_lib.pm doc/mrtglib.pod

.pod.1:
	pod2man --release=$(VER) --center=mrtg $<  > $@

.pod.html:
	( cd doc ; pod2html --infile=../$< --outfile=../$@ --noindex --htmlroot=. --podroot=. --podpath=. --title=$* )

.wml.html:
	wmk -f $<

.1.txt:
	@NROFF@ -man -Tascii $< > $@

man: $(MAN)

html: $(HTML)

txt: $(TXT)

versync:
	$(PERL) -i -p -e 's|VERSION\s*=\s*"\d+\.\d+\.\d+([a-z0-9]+)?"|VERSION = "$(VER)"|gi; s|mrtg-\d+\.\d+\.\d+([a-z0-9]+)?|mrtg-$(VER)|gi; s|MRTG\s\d+\.\d+\.\d+([a-z0-9]+)?|MRTG $(VER)|gi' ANNOUNCE bin/mrtg bin/cfgmaker bin/indexmaker lib/mrtg2/*.pm src/*.c doc/*.pod doc/*.wml doc/*.html
	cd translate && $(PERL) mergelocale.pl skeleton.pm0 *.pmd && cp locales_mrtg.pm ../lib/mrtg2

doc:    getpod versync man html txt
	(cd doc; lynx -dump index.html >index.txt)
	$(PERL) -p -e 's|"http://people.ee.ethz.ch/~oetiker/webtools/mrtg/([^"])|"$$1|g' doc/index.html >doc/www-index.html
	$(PERL) -p -e 's|"http://people.ee.ethz.ch/~oetiker/webtools/mrtg/([^"])|"$$1|g' doc/mrtg.html >doc/www-mrtg.html
	$(PERL) -i -p -e 's|\QHREF="././\E|HREF="|g' doc/*.html
	(cd doc; perl -i -p -e 's|<BODY>|<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#990200" VLINK="#006342"><P><IMG SRC="mrtg-l.png"><IMG SRC="mrtg-m.png"><IMG SRC="mrtg-r.gif"></P>|' *.html)

tar:	doc
	autoconf
	gchmod -R u=rwX,go=rX .
	(cd .. ; ln -s AABM-mrtg $(DIRNAME))
	(cd .. ; sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | gtar -czv --files-from=- -f $(DIRNAME)/archive/$(ARCHIVE).tar.gz --exclude='*~')
	$(PERL) -0777 -pi -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' bin/mrtg bin/indexmaker
	# build rateup for windows ...
	i386-mingw32msvc-gcc -O3 -mwindows -Ilibs-i386-mingw32msvc/zlib -Ilibs-i386-mingw32msvc/libpng -Ilibs-i386-mingw32msvc/gd -Llibs-i386-mingw32msvc/zlib -Llibs-i386-mingw32msvc/libpng -Llibs-i386-mingw32msvc/gd src/rateup.c -o bin/rateup.exe -lgd -lpng -lz
	(cd .. ; touch $(DIRNAME)/contrib/a~;sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | xargs zip -r $(DIRNAME)/archive/$(ARCHIVE).zip; zip $(DIRNAME)/archive/$(ARCHIVE).zip $(DIRNAME)/bin/rateup.exe; zip -d $(DIRNAME)/archive/$(ARCHIVE).zip '*~')
	-rm ../$(DIRNAME)

doc-dist: doc
	scp doc/*.html oetiker@tardis.ee.ethz.ch:public_html/webtools/mrtg/
	scp doc/www-index.html oetiker@tardis.ee.ethz.ch:public_html/webtools/mrtg/readme.html
	scp doc/www-mrtg.html oetiker@tardis.ee.ethz.ch:public_html/webtools/mrtg/mrtg.html

dist: doc-dist tar
	scp CHANGES archive/$(ARCHIVE).* oetiker@tardis.ee.ethz.ch:public_html/webtools/mrtg/pub/
	ssh oetiker@tardis.ee.ethz.ch '(cd public_html/webtools/mrtg/pub; rm mrtg.tar.gz;ln -s $(ARCHIVE).tar.gz mrtg.tar.gz)'

betadist: doc-dist tar
	scp CHANGES archive/$(ARCHIVE).* oetiker@tardis.ee.ethz.ch:public_html/webtools/mrtg/pub/beta