Subversion Repositories public

Rev

Rev 108 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 108 Rev 112
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 = $(PREFIX)/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
DOCDIR = $(PREFIX)/share/doc/$(RELEASE)/
8
DOCDIR = $(PREFIX)/share/doc/$(RELEASE)/
9
9
10
USER = root
10
USER = root
11
11
12
CXX ?= g++
12
CXX ?= g++
13
INSTALL = install
13
INSTALL = install
14
14
15
OPTIMIZE = -O2
15
OPTIMIZE = -O2
16
DEBUG = -g0
16
DEBUG = -g0
17
WARNINGS = -Wall
17
WARNINGS = -Wall
18
CXXAUX = -pipe
18
CXXAUX = -pipe
19
19
20
CXXFLAGS ?= $(OPTIMIZE) $(DEBUG) $(CXXAUX)
20
CXXFLAGS ?= $(OPTIMIZE) $(DEBUG) $(CXXAUX)
21
CXXFLAGS += $(WARNINGS)
21
CXXFLAGS += $(WARNINGS)
22
22
23
PROGRAMS = incrond incrontab
23
PROGRAMS = incrond incrontab
24
24
25
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
26
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
27
27
28
28
29
all:	$(PROGRAMS)
29
all:	$(PROGRAMS)
30
30
31
incrond:	$(INCROND_OBJ)
31
incrond:	$(INCROND_OBJ)
32
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCROND_OBJ)
32
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCROND_OBJ)
33
33
34
incrontab:	$(INCRONTAB_OBJ)
34
incrontab:	$(INCRONTAB_OBJ)
35
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCRONTAB_OBJ)
35
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCRONTAB_OBJ)
36
36
37
.cpp.o:
37
.cpp.o:
38
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
38
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
39
39
40
clean:
40
clean:
41
	rm -f $(PROGRAMS)
41
	rm -f $(PROGRAMS)
42
	rm -f *.o
42
	rm -f *.o
43
43
44
distclean: clean
44
distclean: clean
45
45
46
install:	all install-man
46
install:	all install-man
47
	$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin/
47
	$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin/
48
	$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/sbin/
48
	$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/sbin/
49
	$(INSTALL) -m 0755 -d $(DESTDIR)$(DOCDIR)/
49
	$(INSTALL) -m 0755 -d $(DESTDIR)$(DOCDIR)/
50
	$(INSTALL) -m 04755 -o $(USER) incrontab $(DESTDIR)$(PREFIX)/bin/
50
	$(INSTALL) -m 04755 -o $(USER) incrontab $(DESTDIR)$(PREFIX)/bin/
51
	$(INSTALL) -m 0755 incrond $(DESTDIR)$(PREFIX)/sbin/
51
	$(INSTALL) -m 0755 incrond $(DESTDIR)$(PREFIX)/sbin/
52
	$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(USERDATADIR)
52
	$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(USERDATADIR)
53
	$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(SYSDATADIR)
53
	$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(SYSDATADIR)
54
	$(INSTALL) -m 0644 incron.conf.example $(DESTDIR)$(DOCDIR)/
54
	$(INSTALL) -m 0644 incron.conf.example $(DESTDIR)$(DOCDIR)/
55
55
56
install-man:	incrontab.1 incrontab.5 incrond.8 incron.conf.5
56
install-man:	incrontab.1 incrontab.5 incrond.8 incron.conf.5
57
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man1
57
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man1
58
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man5
58
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man5
59
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man8
59
	$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man8
60
	$(INSTALL) -m 0644 incrontab.1 $(DESTDIR)$(MANPATH)/man1
60
	$(INSTALL) -m 0644 incrontab.1 $(DESTDIR)$(MANPATH)/man1
61
	$(INSTALL) -m 0644 incrontab.5 $(DESTDIR)$(MANPATH)/man5
61
	$(INSTALL) -m 0644 incrontab.5 $(DESTDIR)$(MANPATH)/man5
62
	$(INSTALL) -m 0644 incrond.8 $(DESTDIR)$(MANPATH)/man8
62
	$(INSTALL) -m 0644 incrond.8 $(DESTDIR)$(MANPATH)/man8
63
	$(INSTALL) -m 0644 incron.conf.5 $(DESTDIR)$(MANPATH)/man5
63
	$(INSTALL) -m 0644 incron.conf.5 $(DESTDIR)$(MANPATH)/man5
64
64
65
uninstall:	uninstall-man
65
uninstall:	uninstall-man
66
	rm -f $(DESTDIR)$(PREFIX)/bin/incrontab
66
	rm -f $(DESTDIR)$(PREFIX)/bin/incrontab
67
	rm -f $(DESTDIR)$(PREFIX)/sbin/incrond
67
	rm -f $(DESTDIR)$(PREFIX)/sbin/incrond
68
	rm -rf $(DESTDIR)$(DOCDIR)/
68
	rm -rf $(DESTDIR)$(DOCDIR)/
69
69
70
uninstall-man:
70
uninstall-man:
71
	rm -f $(DESTDIR)$(MANPATH)/man1/incrontab.1
71
	rm -f $(DESTDIR)$(MANPATH)/man1/incrontab.1
72
	rm -f $(DESTDIR)$(MANPATH)/man5/incrontab.5
72
	rm -f $(DESTDIR)$(MANPATH)/man5/incrontab.5
73
	rm -f $(DESTDIR)$(MANPATH)/man8/incrond.8
73
	rm -f $(DESTDIR)$(MANPATH)/man8/incrond.8
74
	rm -f $(DESTDIR)$(MANPATH)/man5/incron.conf.5
74
	rm -f $(DESTDIR)$(MANPATH)/man5/incron.conf.5
75
75
76
update:		uninstall install
76
update:		uninstall install
77
77
78
release:
78
release:
79
	doxygen
79
	doxygen
80
	mkdir -p $(RELEASEDIR)
80
	mkdir -p $(RELEASEDIR)
81
	cp -r doc $(RELEASEDIR)
81
	cp -r doc $(RELEASEDIR)
82
	cp *.h $(RELEASEDIR)
82
	cp *.h $(RELEASEDIR)
83
	cp *.cpp $(RELEASEDIR)
83
	cp *.cpp $(RELEASEDIR)
84
	cp incron.conf.example $(RELEASEDIR)
84
	cp incron.conf.example $(RELEASEDIR)
85
	cp Makefile CHANGELOG COPYING LICENSE-GPL LICENSE-LGPL LICENSE-X11 README TODO VERSION $(RELEASEDIR)
85
	cp Makefile CHANGELOG COPYING LICENSE-GPL LICENSE-LGPL LICENSE-X11 README TODO VERSION $(RELEASEDIR)
86
	cp incrond.8 incrontab.1 incrontab.5 incron.conf.5 $(RELEASEDIR)
86
	cp incrond.8 incrontab.1 incrontab.5 incron.conf.5 $(RELEASEDIR)
87
	tar -c -f $(RELEASE).tar -C $(RELEASEDIR)/.. $(RELEASE)
87
	tar -c -f $(RELEASE).tar -C $(RELEASEDIR)/.. $(RELEASE)
88
	bzip2 -9 $(RELEASE).tar
88
	bzip2 -9 $(RELEASE).tar
89
	tar -c -f $(RELEASE).tar -C $(RELEASEDIR)/.. $(RELEASE)
89
	tar -c -f $(RELEASE).tar -C $(RELEASEDIR)/.. $(RELEASE)
90
	gzip --best $(RELEASE).tar
90
	gzip --best $(RELEASE).tar
91
	echo #!/bin/sh > myzip
91
	echo #!/bin/sh > myzip
92
	echo cd $(RELEASEDIR)/.. >> myzip
92
	echo cd $(RELEASEDIR)/.. >> myzip
93
	echo zip -r -9 `pwd`/$(RELEASE).zip $(RELEASE) >> myzip
93
	echo zip -r -9 `pwd`/$(RELEASE).zip $(RELEASE) >> myzip
94
	chmod 0700 myzip
94
	chmod 0700 myzip
95
	./myzip
95
	./myzip
96
	rm -f myzip
96
	rm -f myzip
97
	sha1sum $(RELEASE).tar.bz2 > sha1.txt
97
	sha1sum $(RELEASE).tar.bz2 > sha1.txt
98
	sha1sum $(RELEASE).tar.gz >> sha1.txt
98
	sha1sum $(RELEASE).tar.gz >> sha1.txt
99
	sha1sum $(RELEASE).zip >> sha1.txt
99
	sha1sum $(RELEASE).zip >> sha1.txt
100
	rm -rf $(RELEASEDIR)
100
	rm -rf $(RELEASEDIR)
101
101
102
release-clean:
102
release-clean:
103
	rm -rf doc
103
	rm -rf doc
104
	rm -f $(RELEASE).tar.bz2
104
	rm -f $(RELEASE).tar.bz2
105
	rm -f $(RELEASE).tar.gz
105
	rm -f $(RELEASE).tar.gz
106
	rm -f $(RELEASE).zip
106
	rm -f $(RELEASE).zip
107
	rm -f sha1.txt
107
	rm -f sha1.txt
108
108
109
.PHONY:	all clean distclean install install-man uninstall uninstall-man release release-clean update
109
.PHONY:	all clean distclean install install-man uninstall uninstall-man release release-clean update
110
110
111
.POSIX:
111
.POSIX:
112
112
113
icd-main.o:	icd-main.cpp inotify-cxx.h incrontab.h usertable.h incron.h appinst.h incroncfg.h appargs.h
113
icd-main.o:	icd-main.cpp inotify-cxx.h incrontab.h usertable.h incron.h appinst.h incroncfg.h appargs.h
114
incrontab.o:	incrontab.cpp incrontab.h inotify-cxx.h strtok.h
114
incrontab.o:	incrontab.cpp incrontab.h inotify-cxx.h strtok.h
115
inotify-cxx.o:	inotify-cxx.cpp inotify-cxx.h
115
inotify-cxx.o:	inotify-cxx.cpp inotify-cxx.h
116
usertable.o:	usertable.cpp usertable.h strtok.h
116
usertable.o:	usertable.cpp usertable.h strtok.h
117
ict-main.o:	ict-main.cpp incrontab.h incron.h incroncfg.h appargs.h
117
ict-main.o:	ict-main.cpp incrontab.h incron.h incroncfg.h appargs.h
118
strtok.o:	strtok.cpp strtok.h
118
strtok.o:	strtok.cpp strtok.h
119
appinst.o:	appinst.cpp appinst.h
119
appinst.o:	appinst.cpp appinst.h
120
incroncfg.o:	incroncfg.cpp incroncfg.h
120
incroncfg.o:	incroncfg.cpp incroncfg.h
121
appargs.o:	appargs.cpp appargs.h
121
appargs.o:	appargs.cpp appargs.h