5
|
1 #!/usr/bin/make -f
|
0
|
2
|
5
|
3 CFLAGS ?= -g -Wall
|
|
4 PREFIX ?= /usr/local
|
|
5 INSTALL ?= install
|
0
|
6
|
5
|
7 #---------------- Do not modify below this point ------------------
|
0
|
8
|
5
|
9 INSTALL_DIR := $(INSTALL) -p -d -o root -g root -m 0755
|
|
10 INSTALL_FILE := $(INSTALL) -p -o root -g root -m 0644
|
|
11 INSTALL_PROGRAM := $(INSTALL) -p -o root -g root -m 0755 # -s
|
|
12 INSTALL_SCRIPT := $(INSTALL) -p -o root -g root -m 0755
|
|
13
|
|
14 VERSION = $(shell cat VERSION)
|
13
|
15 CFLAGS += -DVERSION=\"$(VERSION)\"
|
14
|
16 CPPFLAGS += -DVERSION=\"$(VERSION)\"
|
0
|
17
|
5
|
18 DOCS := AUTHORS ChangeLog CREDITS FILE-FORMAT FILE-FORMAT.html LICENSE TODO \
|
|
19 VERSION
|
0
|
20
|
5
|
21 DISTFILES := $(DOCS) Makefile setup1.vdproj XGetopt.c XGetopt.h common.h \
|
|
22 debug.c define.h dumpblocks.c getidblock.c libpst.c libpst.h \
|
|
23 libstrfunc.c libstrfunc.h lspst.c lzfu.c lzfu.h moz-script \
|
|
24 readlog.vcproj readpst.1 readpst.c readpstlog.1 readpstlog.c \
|
11
|
25 testdebug.c timeconv.c timeconv.h w32pst.sln w32pst.vcproj \
|
|
26 nick2ldif.cpp pst2ldif.cpp
|
0
|
27
|
5
|
28 PROGS := lspst readpst readpstlog pst2ldif nick2ldif
|
|
29 ALL_PROGS := $(PROGS) dumpblocks getidblock testdebug
|
2
|
30
|
5
|
31 all: $(PROGS)
|
0
|
32
|
5
|
33 XGetopt.o: XGetopt.h
|
|
34 debug.o: define.h
|
|
35 dumpblocks.o: define.h
|
|
36 getidblock.o: XGetopt.h define.h libpst.h
|
|
37 libpst.o: define.h libstrfunc.h libpst.h timeconv.h
|
|
38 libstrfunc.o: libstrfunc.h
|
|
39 lspst.o: libpst.h timeconv.h
|
|
40 lzfu.o: define.h libpst.h lzfu.h
|
|
41 readpst.o: XGetopt.h libstrfunc.h define.h libpst.h common.h timeconv.h lzfu.h
|
|
42 pst2ldif.o: XGetopt.h libstrfunc.h define.h libpst.h common.h timeconv.h lzfu.h
|
|
43 nick2ldif.o: XGetopt.h libstrfunc.h define.h libpst.h common.h timeconv.h lzfu.h
|
|
44 readpstlog.o: XGetopt.h define.h
|
|
45 testdebug.o: define.h
|
|
46 timeconv.o: timeconv.h common.h
|
0
|
47
|
5
|
48 readpst: readpst.o libpst.o timeconv.o libstrfunc.o debug.o lzfu.o
|
|
49 lspst: debug.o libpst.o libstrfunc.o lspst.o timeconv.o
|
|
50 getidblock: getidblock.o libpst.o debug.o libstrfunc.o
|
|
51 testdebug: testdebug.o debug.o
|
|
52 readpstlog: readpstlog.o debug.o
|
|
53 dumpblocks: dumpblocks.o libpst.o debug.o libstrfunc.o
|
0
|
54
|
8
|
55 pst2ldif: pst2ldif.o libpst.o timeconv.o libstrfunc.o debug.o lzfu.o
|
|
56 g++ ${CFLAGS} pst2ldif.cpp -o pst2ldif libpst.o timeconv.o libstrfunc.o debug.o lzfu.o
|
|
57
|
7
|
58 nick2ldif: nick2ldif.o libpst.o timeconv.o libstrfunc.o debug.o lzfu.o
|
|
59 g++ ${CFLAGS} nick2ldif.cpp -o nick2ldif libpst.o timeconv.o libstrfunc.o debug.o lzfu.o
|
|
60
|
2
|
61 clean:
|
5
|
62 rm -f core *.o readpst.log $(ALL_PROGS) *~ MANIFEST
|
0
|
63
|
5
|
64 distclean: clean
|
|
65 rm -f libpst-*.tar.gz
|
0
|
66
|
|
67 install: all
|
5
|
68 $(INSTALL_DIR) $(DESTDIR)$(PREFIX)/bin
|
|
69 $(INSTALL_PROGRAM) readpst{,log} $(DESTDIR)$(PREFIX)/bin
|
|
70 $(INSTALL_DIR) $(DESTDIR)$(PREFIX)/share/man/man1
|
|
71 $(INSTALL_FILE) readpst{,log}.1 $(DESTDIR)$(PREFIX)/share/man/man1/
|
|
72 $(INSTALL_DIR) $(DESTDIR)$(PREFIX)/share/doc/libpst
|
|
73 $(INSTALL_FILE) $(DOCS) $(DESTDIR)$(PREFIX)/share/doc/libpst/
|
|
74
|
0
|
75 uninstall:
|
5
|
76 -rm -f $(DESTDIR)$(PREFIX)/bin/readpst{,log}
|
|
77 -rm -f $(DESTDIR)$(PREFIX)/share/man/man1/readpst{,log}.1
|
|
78
|
|
79 # stolen from ESR's Software Release Practices HOWTO available at:
|
|
80 # http://en.tldp.org/HOWTO/Software-Release-Practice-HOWTO/distpractice.html
|
|
81 MANIFEST: Makefile
|
|
82 @ls $(DISTFILES) | sed s:^:libpst-$(VERSION)/: >MANIFEST
|
|
83 tarball libpst-$(VERSION).tar.gz: MANIFEST $(DISTFILES)
|
|
84 @(cd ..; ln -s libpst libpst-$(VERSION))
|
|
85 (cd ..; tar -czvf libpst/libpst-$(VERSION).tar.gz `cat libpst/MANIFEST`)
|
|
86 @(cd ..; rm libpst-$(VERSION))
|
|
87 @rm -f MANIFEST
|
|
88
|
|
89 .PHONY: clean distclean uninstall install tarball
|