summaryrefslogtreecommitdiffstats
path: root/src/postmap/Makefile.in
blob: aac92717cc964da49c01050f673889d4c89f446c (plain)
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
SHELL	= /bin/sh
SRCS	= postmap.c 
OBJS	= postmap.o
HDRS	= 
TESTSRC	= 
DEFS	= -I. -I$(INC_DIR) -D$(SYSTYPE)
CFLAGS	= $(DEBUG) $(OPT) $(DEFS)
TESTPROG= 
PROG	= postmap
INC_DIR	= ../../include
LIBS	= ../../lib/lib$(LIB_PREFIX)global$(LIB_SUFFIX) \
	../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX)

.c.o:;	$(CC) $(CFLAGS) -c $*.c

$(PROG):	$(OBJS) $(LIBS)
	$(CC) $(CFLAGS) $(SHLIB_RPATH) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)

$(OBJS): ../../conf/makedefs.out

Makefile: Makefile.in
	cat ../../conf/makedefs.out $? >$@

update: ../../bin/$(PROG)

../../bin/$(PROG): $(PROG)
	cp $(PROG) ../../bin

tests:	test1 test2 fail_test quote_test file_test lmdb_abb_test \
	lmdb_bulk_test lmdb_incr_test

root_tests:

test1:	$(PROG) map.in map-abc1.ref map-ghi1.ref map-uABC1.ref
	$(SHLIB_ENV) $(VALGRIND) ./$(PROG) map.in
	for key in abc ghi; \
	do \
	    $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -q $${key} map.in | diff map-$${key}1.ref -; \
	done
	$(SHLIB_ENV) $(VALGRIND) ./$(PROG) -f map.in
	for key in ABC; \
	do \
	    $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -fq $${key} map.in | diff map-u$${key}1.ref -; \
	done
	rm -f map.in.db

test2:	$(PROG) map.in map-abc2.ref map-ghi2.ref map-uABC2.ref
	$(SHLIB_ENV) $(VALGRIND) ./$(PROG) map.in
	for key in abc ghi; \
	do \
	    echo $${key} | $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -q - map.in | diff map-$${key}2.ref -; \
	done
	$(SHLIB_ENV) $(VALGRIND) ./$(PROG) -f map.in
	for key in ABC; \
	do \
	    echo $${key} | $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -fq - map.in | diff map-u$${key}2.ref -; \
	done
	rm -f map.in.db

fail_test: $(PROG) aliases fail_test.in fail_test.ref
	-($(SHLIB_ENV) sh fail_test.in || exit 0) >fail_test.tmp 2>&1
	diff fail_test.ref fail_test.tmp
	rm -f fail_test.tmp

quote_test: $(PROG) aliases quote_test.in quote_test.ref
	rm -f quote_test_map.*
	$(SHLIB_ENV) sh quote_test.in >quote_test.tmp 2>&1
	diff quote_test.ref quote_test.tmp
	rm -f quote_test.tmp quote_test_map.*

file_test: $(PROG) file_test.in file_test.ref
	rm -f file_test_map.* postmap-file-1 postmap-file-2
	$(SHLIB_ENV) sh file_test.in >file_test.tmp 2>&1
	diff file_test.ref file_test.tmp
	rm -f file_test.tmp file_test_map.* postmap-file-1 postmap-file-2

lmdb_abb_test: $(PROG) lmdb_abb lmdb_abb.ref
	rm -f lmdb_abb.lmdb
	($(SHLIB_ENV) $(VALGRIND) ./postmap lmdb:lmdb_abb; \
	$(SHLIB_ENV) $(VALGRIND) ./postmap -s lmdb:lmdb_abb | sort) >lmdb_abb.tmp 2>&1
	diff lmdb_abb.ref lmdb_abb.tmp
	rm -f lmdb_abb.tmp lmdb_abb.lmdb

lmdb_bulk_test: $(PROG)
	rm -f lmdb_retry.lmdb main.cf
	tr A-Z a-z < /usr/share/dict/words| \
	    sed -e 's/.*/&	&/' -e 10000q| LANG=C sort -u >lmdb_retry
	echo lmdb_map_size=10240 >main.cf
	($(SHLIB_ENV) $(VALGRIND) ./postmap -c . lmdb:lmdb_retry; \
	$(SHLIB_ENV) $(VALGRIND) ./postmap -s lmdb:lmdb_retry | \
	    LANG=C sort > lmdb_retry.tmp)
	cmp lmdb_retry lmdb_retry.tmp
	rm -f lmdb_retry lmdb_retry.tmp lmdb_retry.lmdb main.cf

lmdb_incr_test: $(PROG)
	rm -f lmdb_retry.lmdb main.cf
	tr A-Z a-z < /usr/share/dict/words| \
	    sed -e 's/.*/&	&/' -e 1000q| LANG=C sort -u >lmdb_retry
	echo lmdb_map_size=10240 >main.cf
	($(SHLIB_ENV) $(VALGRIND) ./postmap -ic . lmdb:lmdb_retry <lmdb_retry; \
	$(SHLIB_ENV) $(VALGRIND) ./postmap -s lmdb:lmdb_retry | \
	    LANG=C sort > lmdb_retry.tmp)
	cmp lmdb_retry lmdb_retry.tmp
	rm -f lmdb_retry lmdb_retry.tmp lmdb_retry.lmdb main.cf

printfck: $(OBJS) $(PROG)
	rm -rf printfck
	mkdir printfck
	sed '1,/^# do not edit/!d' Makefile >printfck/Makefile
	set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
	cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`

lint:
	lint $(DEFS) $(SRCS) $(LINTFIX)

clean:
	rm -f *.o *core $(PROG) $(TESTPROG) *.tmp junk *.db
	rm -rf printfck

tidy:	clean

depend: $(MAKES)
	(sed '1,/^# do not edit/!d' Makefile.in; \
	set -e; for i in [a-z][a-z0-9]*.c; do \
	    $(CC) -E $(DEFS) $(INCL) $$i | grep -v '[<>]' | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
	    -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' \
	    -e 's/o: \.\//o: /' -e p -e '}' ; \
	done | LANG=C sort -u) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
	@$(EXPORT) make -f Makefile.in Makefile 1>&2

# do not edit below this line - it is generated by 'make depend'
postmap.o: ../../include/argv.h
postmap.o: ../../include/check_arg.h
postmap.o: ../../include/clean_env.h
postmap.o: ../../include/dict.h
postmap.o: ../../include/dict_db.h
postmap.o: ../../include/dict_proxy.h
postmap.o: ../../include/header_opts.h
postmap.o: ../../include/mail_conf.h
postmap.o: ../../include/mail_dict.h
postmap.o: ../../include/mail_params.h
postmap.o: ../../include/mail_parm_split.h
postmap.o: ../../include/mail_task.h
postmap.o: ../../include/mail_version.h
postmap.o: ../../include/maillog_client.h
postmap.o: ../../include/mime_state.h
postmap.o: ../../include/mkmap.h
postmap.o: ../../include/msg.h
postmap.o: ../../include/msg_vstream.h
postmap.o: ../../include/myflock.h
postmap.o: ../../include/mymalloc.h
postmap.o: ../../include/readlline.h
postmap.o: ../../include/rec_type.h
postmap.o: ../../include/set_eugid.h
postmap.o: ../../include/split_at.h
postmap.o: ../../include/stringops.h
postmap.o: ../../include/sys_defs.h
postmap.o: ../../include/vbuf.h
postmap.o: ../../include/vstream.h
postmap.o: ../../include/vstring.h
postmap.o: ../../include/vstring_vstream.h
postmap.o: ../../include/warn_stat.h
postmap.o: postmap.c