compute_user_summary does not need any private data.
[adu.git] / Makefile
1 objects := adu.o string.o cmdline.o fd.o select.o create.o interactive.o select.cmdline.o format.o user.o
2 all: adu
3 version := 0.0.4
4
5 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
6 DEBUG_CPPFLAGS += -Wredundant-decls
7 CPPFLAGS += -Os
8 CPPFLAGS += -Wall
9 CPPFLAGS += -Wuninitialized
10 CPPFLAGS += -Wchar-subscripts
11 CPPFLAGS += -Wformat-security
12 CPPFLAGS += -Werror-implicit-function-declaration
13 CPPFLAGS += -Wmissing-format-attribute
14 CPPFLAGS += -Wunused-macros
15 CPPFLAGS += -Wbad-function-cast
16 CPPFLAGS += -D_LARGEFILE64_SOURCE
17 CPPFLAGS += $(shell getconf LFS64_CFLAGS)
18 CPPFLAGS += -DVERSION='"$(version)"'
19
20 LDFLAGS += -D_LARGEFILE64_SOURCE
21 LDFLAGS += $(shell getconf LFS64_LDFLAGS)
22 LDFLAGS += $(shell getconf LFS64_LIBS)
23
24
25 Makefile.deps: $(wildcard *.c *.h)
26 gcc -MM -MG *.c > $@
27
28 -include Makefile.deps
29
30 adu: $(objects)
31 $(CC) -o $@ $(LDFLAGS) $(objects) -lcrypto -losl
32
33 cmdline.o: cmdline.c cmdline.h
34 $(CC) -c $(CPPFLAGS) $<
35
36 cmdline.c cmdline.h: adu.ggo
37 gengetopt --no-handle-error --no-handle-help --conf-parser < $<
38
39
40 %.o: %.c Makefile
41 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
42
43 %.ppm: %.sk
44 sk2ppm $< > $@
45 %.png: %.ppm
46 convert $< $@
47
48 select.cmdline.c select.cmdline.h: select.ggo
49 gengetopt --set-package=select \
50 --no-handle-help \
51 --no-handle-error \
52 --no-handle-version \
53 --arg-struct-name=select_args_info \
54 --file-name=$(subst .ggo,,$<).cmdline \
55 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
56
57 select.cmdline.o: select.cmdline.c select.cmdline.h
58 $(CC) -c $(CPPFLAGS) $<
59
60 adu.1: adu adu.1.inc
61 help2man -h --detailed-help --include adu.1.inc -N ./$< > $@
62
63 %.1.html: %.1
64 man2html $< | sed -e 's|^<DT><DD>$$|<DT><DD><br>|g' > $@
65
66 clean:
67 rm -f *.o adu *cmdline.c *cmdline.h adu.1 adu.1.html adu.png index.html adu.sk~
68
69 index.html: adu.1.html index.html.in INSTALL README
70 sed -e '/@README@/,$$d' index.html.in > $@
71 grutatxt -nb < README >> $@
72 sed -e '1,/@README@/d' -e '/@INSTALL@/,$$d' index.html.in >> $@
73 grutatxt -nb < INSTALL >> $@
74 sed -e '1,/@INSTALL@/d' -e '/@MAN_PAGE@/,$$d' index.html.in >> $@
75 sed -e '1,/Return to Main Contents/d' -e '/Index/,$$d' adu.1.html >> $@
76 sed -e '1,/@MAN_PAGE@/d' index.html.in >> $@