-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
136 lines (109 loc) · 5.53 KB
/
Makefile.in
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
131
132
133
134
135
136
# things that the GNU standards document suggests all makefiles
# should have.
SHELL=/bin/sh
VER=2.17.4
.SUFFIXES:
.SUFFIXES: .c .o .pl .pm .pod .man .1 .txt
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
mandir = @mandir@
datadir = @datadir@
top_srcdir = @top_srcdir@
# Where is perl 5 on this machine
PERL = @PERL@
CC = @CC@
CFLAGS = @CFLAGS@ @DEFS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
GDFORM_EXT = @GDFORM_EXT@
SET_LD_RUN_PATH = @SET_LD_RUN_PATH@
LIBS = @LIBS@
INSTALL = @INSTALL@
MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
all: bin/rateup subst
bin/rateup: bin/rateup.o
$(SET_LD_RUN_PATH) $(CC) bin/rateup.o -o bin/rateup $(LDFLAGS) $(LIBS)
bin/rateup.o: $(top_srcdir)/src/rateup.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(top_srcdir)/src/rateup.c -o bin/rateup.o
subst:
$(PERL) -0777 -p -i~ -e "s'^#!\s*/\S*perl'#! $(PERL)'" $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker $(top_srcdir)/bin/mrtg
$(PERL) -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="$(GDFORM_EXT)";@' $(top_srcdir)/bin/mrtg $(top_srcdir)/bin/indexmaker
clean:
-rm -f bin/rateup
-rm -f config.cache
-rm -f bin/rateup.o
install: all
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
for x in $(top_srcdir)/bin/mrtg $(top_srcdir)/bin/cfgmaker $(top_srcdir)/bin/indexmaker $(top_srcdir)/bin/mrtg-traffic-sum; do \
$(INSTALL) -m 755 $$x $(DESTDIR)$(bindir); done
for x in bin/rateup; do \
$(INSTALL) -m 755 $$x $(DESTDIR)$(bindir); done
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/mrtg2/Pod
for x in $(top_srcdir)/lib/mrtg2/*.pm; do \
$(INSTALL) -m 644 $$x $(DESTDIR)$(libdir)/mrtg2; done
for x in $(top_srcdir)/lib/mrtg2/Pod/*.pm; do \
$(INSTALL) -m 644 $$x $(DESTDIR)$(libdir)/mrtg2/Pod; done
$(MKINSTALLDIRS) $(DESTDIR)$(datadir)/mrtg2/icons
for x in $(top_srcdir)/images/*.gif $(top_srcdir)/images/*.png; do \
$(INSTALL) -m 644 $$x $(DESTDIR)$(datadir)/mrtg2/icons; done
$(MKINSTALLDIRS) $(DESTDIR)$(datadir)/doc/mrtg2
(cd $(top_srcdir); for x in COPYING COPYRIGHT README CHANGES THANKS doc/*.pod doc/*.txt doc/*.png; do \
$(INSTALL) -m 644 $$x $(DESTDIR)$(datadir)/doc/mrtg2; done)
$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
for x in $(top_srcdir)/doc/*.1; do \
$(INSTALL) -m 644 $$x $(DESTDIR)$(mandir)/man1; done
########### Distribution Tools
###
### Things you might NOT want to play with ...
###
ARCHIVE = mrtg-$(VER)
DIRNAME = mrtg-$(VER)
POD = doc/mrtg-faq.pod doc/mrtg-logfile.pod doc/mrtg-nt-guide.pod doc/mrtg-nw-guide.pod \
doc/mrtg-unix-guide.pod \
doc/mrtg-forum.pod doc/mrtg-mibhelp.pod doc/mrtg-reference.pod doc/mrtg-webserver.pod \
doc/mrtg-rrd.pod doc/mrtg-squid.pod doc/mrtg.pod doc/mrtg-contrib.pod \
doc/cfgmaker.pod doc/indexmaker.pod doc/mrtglib.pod doc/mrtg-ipv6.pod doc/mrtg-traffic-sum.pod
MAN = $(POD:.pod=.1)
TXT = $(POD:.pod=.txt)
getpod:
-rm $(MAN) $(TXT)
-for x in cfgmaker indexmaker mrtg-mailer mrtg-traffic-sum; do \
rm doc/$$x.pod; ln -s ../bin/$$x doc/$$x.pod; done
-rm doc/mrtglib.pod;ln -s ../lib/mrtg2/MRTG_lib.pm doc/mrtglib.pod
.pod.1:
pod2man --release=$(VER) --center=mrtg $< > $@
.1.txt:
@NROFF@ -man -Tascii $< > $@
man: $(MAN)
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' bin/mrtg bin/cfgmaker bin/indexmaker lib/mrtg2/*.pm src/*.c `find doc/ -name \*.pod -type f`
cd translate && $(PERL) mergelocale.pl skeleton.pm0 *.pmd && cp locales_mrtg.pm ../lib/mrtg2
doc: getpod versync man txt
rateupexe:
i386-mingw32msvc-gcc -Wall -Wno-format -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -O3 -mwindows -Ilibs-i386-mingw32msvc/zlib -Ilibs-i386-mingw32msvc/libpng -Ilibs-i386-mingw32msvc/gd -c src/strftime.c -o src/strftime.o
i386-mingw32msvc-gcc -Wall -Wno-format -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -O3 -mwindows -Ilibs-i386-mingw32msvc/zlib -Ilibs-i386-mingw32msvc/libpng -Ilibs-i386-mingw32msvc/gd -c src/rateup.c -o src/rateup.o -Dstrftime=strftime_
i386-mingw32msvc-gcc -Llibs-i386-mingw32msvc/zlib -Llibs-i386-mingw32msvc/libpng -Llibs-i386-mingw32msvc/gd src/rateup.o src/strftime.o -o bin/rateup.exe -lgd -lpng -lz
i386-mingw32msvc-strip bin/rateup.exe
tar: doc rateupexe
autoconf
gchmod -R u=rwX,go=rX .
(cd .. ; ln -s src $(DIRNAME))
(cd .. ; sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | tar -czv --files-from=- -f $(DIRNAME)/$(ARCHIVE).tar.gz --exclude='*~' --exclude="*.rej" --exclude="*.orig" --exclude=".svn")
$(PERL) -0777 -pi -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' bin/mrtg bin/indexmaker
# build rateup for windows ...
(cd .. ; touch $(DIRNAME)/contrib/a~;sed -e "s/^/$(DIRNAME)\//" $(DIRNAME)/MANIFEST | xargs zip -r $(DIRNAME)/$(ARCHIVE).zip; zip $(DIRNAME)/$(ARCHIVE).zip $(DIRNAME)/bin/rateup.exe $(DIRNAME)/bin/rateup.nlm $(DIRNAME)/bin/rateup.nlm; zip -d $(DIRNAME)/$(ARCHIVE).zip '*~' '*.svn*')
-rm ../$(DIRNAME)
dist: tar
svn commit -m 'released version $(VER)'
svn copy -m "tagging version $(VER)" svn://svn.oetiker.ch/mrtg/trunk/src svn://svn.oetiker.ch/mrtg/tags/$(VER)
md5sum $(ARCHIVE).tar.gz >$(ARCHIVE).tar.gz.md5
gpg -s $(ARCHIVE).tar.gz.md5
chmod 644 $(ARCHIVE).tar.gz.md5*
scp CHANGES $(ARCHIVE).* [email protected]:public_html/mrtg/pub/
ssh [email protected] "cd public_html/mrtg/pub; rm mrtg.tar.gz;ln -s $(ARCHIVE).tar.gz mrtg.tar.gz"
betadist: tar
mv $(ARCHIVE).* ${HOME}/public_html/webtools/mrtg/pub/beta
cp CHANGES ${HOME}/public_html/webtools/mrtg/pub/beta