File: Makefile

package info (click to toggle)
lm-sensors 1%3A2.10.8-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,320 kB
  • ctags: 10,818
  • sloc: ansic: 63,999; perl: 8,169; sh: 1,820; makefile: 406; lex: 371; yacc: 312; python: 11
file content (62 lines) | stat: -rw-r--r-- 1,939 bytes parent folder | download | duplicates (2)
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
#
# Edit the following for your setup
#
USER=apache
# CRONTAB not used
#CRONTAB=/var/spool/cron/tabs/$(USER)
RRDPATH=/usr/local/rrdtool/bin
BINPATH=/usr/local/bin
RRDDIR=/var/lib/sensors-rrd
APACHE=/var/www/html
APACHDIR=$(APACHE)/senspix
MACH=`uname -n`
# 2.4 kernels
#SENSDEV=w83781d-isa-0290
#SENSDIR=/proc/sys/dev/sensors/$(SENSDEV)
# 2.6 kernels up to 2.6.13
#SENSDEV=0-0290
#SENSDIR=/sys/bus/i2c/devices/$(SENSDEV)
# 2.6.14 and later kernels
SENSDEV=hwmon0
SENSDIR=/sys/class/hwmon/$(SENSDEV)/device
################################################
# Everything below here should be fine
#
RRDB=$(RRDDIR)/sensors.rrd

all: sens_day.cgi sens_week.cgi summ_week.cgi $(SENSDIR)

%.cgi : %.in Makefile
	sed -e "s#%%RRDPATH%%#$(RRDPATH)#g;s#%%APACHDIR%%#$(APACHDIR)#g;s#%%RRDDIR%%#$(RRDDIR)#g;s#%%MACH%%#$(MACH)#g" $< > $@

$(RRDDIR) :
	install -d -o $(USER) $(RRDDIR)

$(RRDB) : $(RRDDIR)
	./sens_create_rrd $(RRDB)
	chown $(USER) $(RRDB)
	
$(SENSDIR) :
	$(error error - sensor $(SENSDEV) not installed - check SENSDEV definition in Makefile)

$(CRONTAB) :
	$(error error - crontab for user $(USER) not present - check CRONTAB definition in Makefile)

$(APACHE) :
	$(error error - Web server directory $(APACHE) not present - check APACHE definition in Makefile)

$(APACHDIR)/pix : $(APACHE)
	install -d -o $(USER) -m 777 $(APACHDIR)/pix

install: all $(RRDB) $(SENSDIR) $(CRONTAB) $(APACHDIR)/pix
	install -m 755 sens_update_rrd $(BINPATH)
	install -m 755 sens_week.cgi $(APACHDIR)
	install -m 755 sens_day.cgi $(APACHDIR)
	install -m 755 summ_week.cgi $(APACHDIR)
#	grep sens_update_rrd $(CRONTAB) > /dev/null 2>&1 || echo '*/5 * * * *	/usr/local/bin/sens_update_rrd' $(RRDB) $(SENSDEV) >> $(CRONTAB)
	@echo
	@echo Note!!! You must manually install the following line in the crontab for user $(USER):
	@echo '   */5 * * * *    ' /usr/local/bin/sens_update_rrd $(RRDB) $(SENSDEV)

clean:
	rm -f sens_day.cgi sens_week.cgi summ_week.cgi