6 CFLAGS += @CFLAGS@ -Wall -pedantic
7 # Uncomment to enable profiling.
9 # Can be "pg" for Postgresql, "file" for flat files or "db2" for pksd db2 style.
13 #MAKEDEPEND = makedepend -f- --
14 MAKEDEPEND = $(CC) -MM
16 exec_prefix ?= @exec_prefix@
18 PROGS = add lookup gpgwww onak splitkeys onak-mail.pl stripkey
19 CORE_OBJS = armor.o charfuncs.o decodekey.o getcgi.o hash.o \
20 keyid.o keyindex.o ll.o mem.o onak-conf.o parsekey.o sha1.o md5.o \
21 log.o photoid.o wordlist.o cleanup.o merge.o sendsync.o
22 SRCS = armor.c parsekey.c merge.c keyid.c md5.c sha1.c main.c getcgi.c mem.c \
23 keyindex.c stats.c lookup.c add.c keydb_$(DBTYPE).c ll.c hash.c \
24 gpgwww.c onak-conf.c charfuncs.c sendsync.c log.c photoid.c \
25 wordlist.c cleankey.c cleanup.c
29 KEYDB_OBJ = keydb_keyd.o
30 SRCS += keyd.c keydb_keyd.c
32 KEYDB_OBJ = keydb_$(DBTYPE).o
35 OBJS = stats.o cleankey.o $(CORE_OBJS) $(KEYDB_OBJ)
37 all: .depend $(PROGS) testparse maxpath sixdegrees splitkeys onak.conf
39 keyd: keyd.o $(CORE_OBJS) keydb_$(DBTYPE).o
40 $(CC) $(LDFLAGS) -o keyd keyd.o $(CORE_OBJS) keydb_$(DBTYPE).o $(LIBS)
42 splitkeys: splitkeys.o $(CORE_OBJS) $(KEYDB_OBJ)
43 $(CC) $(LDFLAGS) -o splitkeys splitkeys.o $(CORE_OBJS) $(KEYDB_OBJ) \
46 testparse: main.o $(OBJS)
47 $(CC) $(LDFLAGS) -o testparse main.o $(OBJS) $(LIBS)
49 maxpath: maxpath.o $(OBJS)
50 $(CC) $(LDFLAGS) -o maxpath maxpath.o $(OBJS) $(LIBS)
52 sixdegrees: sixdegrees.o $(OBJS)
53 $(CC) $(LDFLAGS) -o sixdegrees sixdegrees.o $(OBJS) $(LIBS)
55 stripkey: stripkey.o $(OBJS)
56 $(CC) $(LDFLAGS) -o stripkey stripkey.o $(OBJS) $(LIBS)
58 gpgwww: gpgwww.o $(OBJS)
59 $(CC) $(LDFLAGS) -o gpgwww gpgwww.o $(OBJS) $(LIBS)
61 lookup: lookup.o cleankey.o $(CORE_OBJS) $(KEYDB_OBJ)
62 $(CC) $(LDFLAGS) -o lookup lookup.o cleankey.o $(CORE_OBJS) \
65 add: add.o cleankey.o $(CORE_OBJS) $(KEYDB_OBJ)
66 $(CC) $(LDFLAGS) -o add add.o cleankey.o \
67 $(CORE_OBJS) $(KEYDB_OBJ) $(LIBS)
69 onak: onak.o cleankey.o $(CORE_OBJS) $(KEYDB_OBJ)
70 $(CC) $(LDFLAGS) -o onak onak.o cleankey.o \
71 $(CORE_OBJS) $(KEYDB_OBJ) $(LIBS)
73 onak-conf.o: onak-conf.c onak-conf.h
74 $(CC) $(CFLAGS) -DCONFIGFILE=\"@sysconfdir@/onak.conf\" -c onak-conf.c
76 onak-mail.pl: onak-mail.pl.in
77 sed 's:@CONFIG@:@sysconfdir@/onak.conf:g' < onak-mail.pl.in > onak-mail.pl
80 onak.conf: onak.conf.in
81 sed -e 's:@BINDIR@:@bindir@:g' \
82 -e 's:@STATEDIR@:@localstatedir@:g' \
83 < onak.conf.in > onak.conf
86 $(RM) $(PROGS) $(OBJS) Makefile.bak testparse maxpath *.core core \
87 gpgwww.o add.o lookup.o main.o maxpath.o onak.o sixdegrees \
88 sixdegrees.o splitkeys.o stripkey.o onak.conf
90 $(RM) keyd.o keydb_$(DBTYPE).o
94 $(RM) -f Makefile .depend config.{log,status,h}
95 $(RM) -r autom4te.cache
99 $(MAKEDEPEND) $(CFLAGS) $(SRCS) > .depend