Subversion Repositories public

Rev

Rev 102 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 102 Rev 108
Line 1... Line 1...
1
PREFIX = /usr/local
1
PREFIX = /usr/local
2
USERDATADIR = /var/spool/incron
2
USERDATADIR = /var/spool/incron
3
SYSDATADIR = /etc/incron.d
3
SYSDATADIR = /etc/incron.d
4
CFGDIR = /etc
4
CFGDIR = /etc
5
MANPATH = /usr/share/man
5
MANPATH = $(PREFIX)/share/man
6
RELEASE = incron-`cat VERSION`
6
RELEASE = incron-`cat VERSION`
7
RELEASEDIR = /tmp/$(RELEASE)
7
RELEASEDIR = /tmp/$(RELEASE)
8
8
DOCDIR = $(PREFIX)/share/doc/$(RELEASE)/
-
 
9
9
USER = root
10
USER = root
10
11
11
CXX = g++
12
CXX ?= g++
12
INSTALL = install
13
INSTALL = install
13
14
14
OPTIMIZE = -O2
15
OPTIMIZE = -O2
15
DEBUG = -g0
16
DEBUG = -g0
16
WARNINGS = -Wall
17
WARNINGS = -Wall
17
CXXAUX = -pipe
18
CXXAUX = -pipe
18
19
19
CXXFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS) $(CXXAUX)
20
CXXFLAGS ?= $(OPTIMIZE) $(DEBUG) $(CXXAUX)
20
LDFLAGS = $(WARNINGS)
21
CXXFLAGS += $(WARNINGS)
21
22
22
PROGRAMS = incrond incrontab
23
PROGRAMS = incrond incrontab
23
24
24
INCROND_OBJ = icd-main.o incrontab.o inotify-cxx.o usertable.o strtok.o appinst.o incroncfg.o appargs.o
25
INCROND_OBJ = icd-main.o incrontab.o inotify-cxx.o usertable.o strtok.o appinst.o incroncfg.o appargs.o
25
INCRONTAB_OBJ = ict-main.o incrontab.o inotify-cxx.o strtok.o incroncfg.o appargs.o
26
INCRONTAB_OBJ = ict-main.o incrontab.o inotify-cxx.o strtok.o incroncfg.o appargs.o
26
27
27
28
28
all:	$(PROGRAMS)
29
all:	$(PROGRAMS)
29
30
30
incrond:	$(INCROND_OBJ)
31
incrond:	$(INCROND_OBJ)
31
	$(CXX) $(LDFLAGS) -o $@ $(INCROND_OBJ)
32
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCROND_OBJ)
32
33
33
incrontab:	$(INCRONTAB_OBJ)
34
incrontab:	$(INCRONTAB_OBJ)
34
	$(CXX) $(LDFLAGS) -o $@ $(INCRONTAB_OBJ)
35
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCRONTAB_OBJ)
35
36
36
.cpp.o:
37
.cpp.o:
37
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
38
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
38
39
39
clean:
40
clean:
40
	rm -f $(PROGRAMS)
41
	rm -f $(PROGRAMS)
Line 42... Line 43...
42
43
43
distclean: clean
44
distclean: clean
44
45
45
install:	all install-man
46
install:	all install-man
46
	[ -d $(PREFIX) ]
47
	$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin/
47
	$(INSTALL) -m 04755 -o $(USER) incrontab $(PREFIX)/bin/
48
	$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/sbin/
-
 
49
	$(INSTALL) -m 0755 -d $(DESTDIR)$(DOCDIR)/
-
 
50
	$(INSTALL) -m 04755 -o $(USER) incrontab $(DESTDIR)$(PREFIX)/bin/
48
	$(INSTALL) -m 0755 incrond $(PREFIX)/sbin/
51
	$(INSTALL) -m 0755 incrond $(DESTDIR)$(PREFIX)/sbin/
49
	$(INSTALL) -m 0755 -o $(USER) -d $(USERDATADIR)
52
	$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(USERDATADIR)
50
	$(INSTALL) -m 0755 -o $(USER) -d $(SYSDATADIR)
53
	$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(SYSDATADIR)
51
	$(INSTALL) -m 0644 -o $(USER) incron.conf.example $(CFGDIR)
54
	$(INSTALL) -m 0644 incron.conf.example $(DESTDIR)$(DOCDIR)/
52
55
53
install-man:	incrontab.1 incrontab.5 incrond.8 incron.conf.5
56
install-man:	incrontab.1 incrontab.5 incrond.8 incron.conf.5
54
	$(INSTALL) -m 0755 -d $(MANPATH)/man1
57
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man1
55
	$(INSTALL) -m 0755 -d $(MANPATH)/man5
58
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man5
56
	$(INSTALL) -m 0755 -d $(MANPATH)/man8
59
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man8
57
	$(INSTALL) -m 0644 incrontab.1 $(MANPATH)/man1
60
	$(INSTALL) -m 0644 incrontab.1 $(DESTDIR)$(MANPATH)/man1
58
	$(INSTALL) -m 0644 incrontab.5 $(MANPATH)/man5
61
	$(INSTALL) -m 0644 incrontab.5 $(DESTDIR)$(MANPATH)/man5
59
	$(INSTALL) -m 0644 incrond.8 $(MANPATH)/man8
62
	$(INSTALL) -m 0644 incrond.8 $(DESTDIR)$(MANPATH)/man8
60
	$(INSTALL) -m 0644 incron.conf.5 $(MANPATH)/man5
63
	$(INSTALL) -m 0644 incron.conf.5 $(DESTDIR)$(MANPATH)/man5
61
64
62
uninstall:	uninstall-man
65
uninstall:	uninstall-man
63
	[ -d $(PREFIX) ]
66
	rm -f $(DESTDIR)$(PREFIX)/bin/incrontab
64
	rm -f $(PREFIX)/bin/incrontab
-
 
65
	rm -f $(PREFIX)/sbin/incrond
67
	rm -f $(DESTDIR)$(PREFIX)/sbin/incrond
66
	rm -f $(CFGDIR)/incron.conf.example
68
	rm -rf $(DESTDIR)$(DOCDIR)/
67
69
68
uninstall-man:
70
uninstall-man:
69
	rm -f $(MANPATH)/man1/incrontab.1
71
	rm -f $(DESTDIR)$(MANPATH)/man1/incrontab.1
70
	rm -f $(MANPATH)/man5/incrontab.5
72
	rm -f $(DESTDIR)$(MANPATH)/man5/incrontab.5
71
	rm -f $(MANPATH)/man8/incrond.8
73
	rm -f $(DESTDIR)$(MANPATH)/man8/incrond.8
72
	rm -f $(MANPATH)/man5/incron.conf.5
74
	rm -f $(DESTDIR)$(MANPATH)/man5/incron.conf.5
73
75
74
update:		uninstall install
76
update:		uninstall install
75
77
76
release:
78
release:
77
	doxygen
79
	doxygen
78
	mkdir -p $(RELEASEDIR)
80
	mkdir -p $(RELEASEDIR)