File: Makefile

package info (click to toggle)
mrtg 2.5.2-1
  • links: PTS
  • area: contrib
  • in suites: hamm
  • size: 916 kB
  • ctags: 465
  • sloc: perl: 4,603; ansic: 2,132; makefile: 190; csh: 49; sh: 40
file content (118 lines) | stat: -rw-r--r-- 3,227 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
#################################################################
# Makefile for mrtg ...
#################################################################
# this is to fix IRIX who prefers csh
SHELL=/bin/sh
# GD_INCLUDE 
# The path to the include files for the gd graphics library.
#GD_INCLUDE=/usr/local/include/gd
GD_INCLUDE=

# GD_LIB
# The path to the gd graphics library: libgd.a
#GD_LIB=/usr/local/lib
GD_LIB=

# Where is perl 5 on this machine
# PERL=/usr/local/bin/perl
PERL=/usr/bin/perl


# CC
# C compiler used to compile rateup. gcc works for me.
# cc from SparcWorks is OK as well
CC=gcc
#CC=cc
# CFLAGS
# Enter '-g' to include debugging info, or '-O2' to optimize
# for gcc
CFLAGS=-g -O2 -Wall

# for sparcworks
#CFLAGS=-g


########################### End of constants

all:
	@echo  ""
	@echo  ""
	@echo  "INSTRUCTIONS"
	@echo  "------------"
	@echo  "Look in 'readme.html' for full instructions on installing mrtg."
	@echo  "To compile rateup, the C program that accelerates mrtg,"
	@echo  "you will first need to compile the gd graphics library by"
	@echo  "Thomas Boutell (see http://www.boutell.com/gd/)"
	@echo  ""
	@echo  "Once you have compiled the gd library,"
	@echo  "edit 'Makefile' to reflect the paths to the gd"
	@echo  "header files (GD_INCLUDE) and the gd library file (GD_LIB),"
	@echo  "and to your perl 5 binary"
	@echo  ""
	@echo  "* To compile rateup, then type 'make rateup'."
	@echo  "* Do a 'make substitute' to fix the perl5 pointers in the scripts"
	@echo  ""
	@echo  "And now you should realy read the docs!"
	@echo  ""
	@echo  ""

rateup: rateup.c
	$(CC) $(CFLAGS) rateup.c -lgd -lm -o rateup

PERLFILES = mrtg cfgmaker indexmaker convert

substitute:
	$(PERL) -pi -e 's@^#\!/.*@#!$(PERL)@' $(PERLFILES)


#################################################################
# Private Parts :-)
#################################################################

NUMBER = 2.5.2
VERSION = mrtg-$(NUMBER)

TAR = tar
ZIP = zip
TARCREATE = cvzf
FILES = $(VERSION)/BER.pm \
	$(VERSION)/COPYING \
	$(VERSION)/COPYRIGHT \
	$(VERSION)/Changes \
	$(VERSION)/Contributors \
	$(VERSION)/INSTALL \
	$(VERSION)/Makefile \
	$(VERSION)/Todo \
	$(VERSION)/SNMP_Session.pm \
	$(VERSION)/cfgmaker \
	$(VERSION)/convert \
	$(VERSION)/indexmaker \
	$(VERSION)/mrtg \
	$(VERSION)/mrtg-l.gif \
	$(VERSION)/mrtg-m.gif \
	$(VERSION)/mrtg-r.gif \
	$(VERSION)/mrtg-ti.gif \
	$(VERSION)/rateup.c \
	$(VERSION)/readme.html \
	$(VERSION)/readme.txt \
	$(VERSION)/contrib \
	$(VERSION)/mibhelp.txt \
	$(VERSION)/htaccess-dist \
	$(VERSION)/mrtg-conf.html \
	$(VERSION)/mrtg-conf.txt \
	$(VERSION)/mrtg-conf.pod \
	$(VERSION)/README.logfile-format

ARCHIVE=$(VERSION).tar.gz
ZIPARC=$(VERSION).zip

tar:
	lynx readme.html -dump > readme.txt 
	pod2html mrtg-conf.pod | perl -p -e 's|<BODY|<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#990200" VLINK="#006342" |' > mrtg-conf.html 
	pod2text mrtg-conf.pod > mrtg-conf.txt 
	cd .. ; ln -s mrtg $(VERSION) ;\
	$(TAR) $(TARCREATE) $(VERSION)/$(ARCHIVE) $(FILES);\
	$(TAR) $(TARCREATE) $(VERSION)/rateup-sol251-$(NUMBER).tar.gz $(VERSION)/rateup;\
	$(ZIP) -r $(VERSION)/$(ZIPARC) $(FILES);\
	$(ZIP) $(VERSION)/rateup-win32-$(NUMBER).zip $(VERSION)/rateup.exe;\
	rm $(VERSION)