File: Makefile

package info (click to toggle)
apcupsd 3.14.14-7
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,904 kB
  • sloc: ansic: 24,826; cpp: 9,230; sh: 4,484; makefile: 1,200; tcl: 368; objc: 317; php: 107
file content (55 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (8)
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
topdir:=../..

SUBDIRS =
include $(topdir)/autoconf/targets.mak

all-install: install-sun $(if $(DESTDIR),,install-$(USBDRV))
all-uninstall: uninstall-sun $(if $(DESTDIR),,uninstall-$(USBDRV))

install-sun:
	$(call DISTINST,Sun)
	$(call MKDIR,/etc/rc0.d)
	$(call MKDIR,/etc/rc1.d)
	$(call MKDIR,/etc/rc2.d)
	$(call MKDIR,/etc/init.d)
	$(call INSTPROG,744,apcupsd,/etc/init.d/apcupsd)
	$(call SYMLINK,../init.d/apcupsd,/etc/rc0.d/K21apcupsd)
	$(call SYMLINK,../init.d/apcupsd,/etc/rc1.d/S89apcupsd)
	$(call SYMLINK,../init.d/apcupsd,/etc/rc2.d/S89apcupsd)
	@echo "================================================="
	@echo "apcupsd script installation for Solaris $(DISTVER) complete."
	@echo "You should now edit $(sysconfdir)/apcupsd.conf  to correspond"
	@echo "to your setup then start the apcupsd daemon with:"
	@echo 
	@echo "/etc/init.d/apcupsd start"
	@echo 
	@echo "Thereafter when you reboot, it will be stopped and started"
	@echo "automatically."
	@echo "================================================="

install-usb:
	@echo "Configuring ugen driver to match APC UPSes..."
	@echo
	$(V)-add_drv -f -i '"usbif51d,class3"' ugen || \
	  update_drv -a -i '"usbif51d,class3"' ugen
	@echo
	@echo "NOTE:"
	@echo "   \"(usbif51d,class3) already in use\" and"
	@echo "   \"Driver (ugen) is already installed\""
	@echo "   errors may be safely ignored."
	@echo
	@echo "================================================="
	@echo "Driver configured. You must PERFORM A RECONFIGURE"
	@echo "BOOT \"reboot -- -r\" before running Apcupsd."
	@echo "================================================="

uninstall-sun:
	$(call DISTUNINST,Sun)
	-$(call UNINST,/etc/rc0.d/K21apcupsd)
	-$(call UNINST,/etc/rc1.d/S89apcupsd)
	-$(call UNINST,/etc/rc2.d/S89apcupsd)
	-$(call UNINST,/etc/init.d/apcupsd)

uninstall-usb:
	@echo "Removing ugen binding (errors are safe to ignore)..."
	$(V)-update_drv -d -i '"usbif51d,class3"' ugen > /dev/null