File: Makefile.in

package info (click to toggle)
nut 0.45.5-rel-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,984 kB
  • ctags: 2,146
  • sloc: ansic: 22,216; sh: 1,138; makefile: 405
file content (105 lines) | stat: -rw-r--r-- 2,553 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
# Network UPS Tools: top level

# directory definitions
prefix      = @prefix@
BASEPATH    = $(INSTALLROOT)@prefix@
CONFPATH    = $(INSTALLROOT)@sysconfdir@
CGIPATH     = $(INSTALLROOT)@CGIPATH@
MODELPATH   = $(INSTALLROOT)@MODELPATH@
INSTALLDIRS = $(CONFPATH) $(MODELPATH) $(BASEPATH)/@bindir@ $(BASEPATH)/@sbindir@
STATEPATH   = $(INSTALLROOT)@STATEPATH@

SUBDIRS	= common models server clients
CFLAGS	= -I../include @CFLAGS@

# these are here so they can be overridden during a make install
RUNUID=@RUN_AS_USER@
RUNGID=@RUN_AS_GROUP@

# Permissions for executables
INSTALLPERMS = 0755
INSTALLCMD = @INSTALL@

all: build

build:
	@for i in $(SUBDIRS); do \
		echo $$i/; cd $$i; $(MAKE); cd ..; \
	done

clean:
	@for i in $(SUBDIRS); do \
		cd $$i; $(MAKE) clean; cd ..;\
	done

distclean: clean
	-cp Makefile.dist Makefile
	-rm -f include/config.h
	-rm -f config.status config.cache config.log
	-rm -f scripts/RedHat-6.0/upsd scripts/RedHat-6.0/upsmon
	@for i in $(SUBDIRS) conf man; do \
		rm $$i/Makefile; \
	done

install: install-dirs install-man
	@echo Installing in $(BASEPATH)...

	@for i in $(SUBDIRS) conf; do \
		cd $$i; $(MAKE) install; cd ..; \
	done

install-dirs:
	@for d in $(INSTALLDIRS); do \
		if (test ! -d $$d) then \
			./install-sh -d $$d || exit 1; \
		fi \
	done

	@if (test ! -d $(STATEPATH)) then \
		./install-sh -d $(STATEPATH) || exit 1 ; \
		./install-sh -d -o $(RUNUID) -g $(RUNGID) $(STATEPATH) \
		|| echo "Unable to set ownership of $(STATEPATH)"; \
	fi

install-man:
	@cd man; $(MAKE) install; cd ..;

cgi:
	@cd clients; $(MAKE) cgi; cd ..;

install-cgi: install-dirs 
	if (test ! -d $(CGIPATH)) then \
		./install-sh -d $(CGIPATH) || exit 1; \
	fi \

	@cd conf; $(MAKE) install; cd ..;
	@cd clients; $(MAKE) install-cgi; cd ..;

install-cgi-man:
	@cd man; $(MAKE) install-cgi-man; cd ..;

install-misc: install-dirs
	@cd clients; $(MAKE) install-misc; cd ..;

# This is only used to set the "official" version before it goes out the door.
#
rhver = $(shell echo $(SETVER) | sed s/\-//g)
setver:
	@if (test -z "$(SETVER)") then \
		echo "SETVER not defined"; \
		exit; \
	else \
		echo "Setting version to $(SETVER)"; \
		if (test -f "include/version.h") then \
			echo "#define UPS_VERSION \"$(SETVER)\"" > include/version.h; \
		else \
			echo "include/version.h not found"; \
			exit; \
		fi; \
		if (test -f packaging/RedHat/nut.spec.in) then \
			cat packaging/RedHat/nut.spec.in | sed s/@NUT-VERSION@/$(rhver)/g > packaging/RedHat/nut.spec; \
		else \
			echo "nut.spec.in not found"; \
			exit ; \
		fi \
	fi