comparison contrib/Makefile @ 16:c508ee15dfca

switch to automake/autoconf
author carl
date Sun, 19 Feb 2006 18:47:46 -0800
parents
children
comparison
equal deleted inserted replaced
15:ac98f448b6ab 16:c508ee15dfca
1 #!/usr/bin/make -f
2
3 CFLAGS ?= -g -Wall
4 PREFIX ?= /usr/local
5 INSTALL ?= install
6
7 #---------------- Do not modify below this point ------------------
8
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)
15 CFLAGS += -DVERSION=\"$(VERSION)\"
16 CPPFLAGS += -DVERSION=\"$(VERSION)\"
17
18 DOCS := AUTHORS ChangeLog CREDITS FILE-FORMAT FILE-FORMAT.html LICENSE TODO \
19 VERSION
20
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 \
25 testdebug.c timeconv.c timeconv.h w32pst.sln w32pst.vcproj \
26 nick2ldif.cpp pst2ldif.cpp
27
28 PROGS := lspst readpst readpstlog pst2ldif nick2ldif
29 ALL_PROGS := $(PROGS) dumpblocks getidblock testdebug
30
31 all: $(PROGS)
32
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
47
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
54
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
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
61 clean:
62 rm -f core *.o readpst.log $(ALL_PROGS) *~ MANIFEST
63
64 distclean: clean
65 rm -f libpst-*.tar.gz
66
67 install: all
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
75 uninstall:
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