1 objects := adu.o string.o cmdline.o fd.o select.o create.o interactive.o select.cmdline.o format.o user.o bloom.o
4 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
6 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
7 DEBUG_CPPFLAGS += -Wredundant-decls
10 CPPFLAGS += -Wuninitialized
11 CPPFLAGS += -Wchar-subscripts
12 CPPFLAGS += -Wformat-security
13 CPPFLAGS += -Werror-implicit-function-declaration
14 CPPFLAGS += -Wmissing-format-attribute
15 CPPFLAGS += -Wunused-macros
16 CPPFLAGS += -Wbad-function-cast
17 CPPFLAGS += -DVERSION='"$(version)"'
18 CPPFLAGS += -I/usr/local/include
20 LDFLAGS += -L/usr/local/lib
23 ifeq (,$(findstring BSD,$(uname_S)))
24 CPPFLAGS += -D_LARGEFILE64_SOURCE
25 CPPFLAGS += $(shell getconf LFS64_CFLAGS)
26 LDFLAGS += -D_LARGEFILE64_SOURCE
27 LDFLAGS += $(shell getconf LFS64_LDFLAGS)
28 LDFLAGS += $(shell getconf LFS64_LIBS)
29 CPPFLAGS += -DHAVE_STAT64=1
33 Makefile.deps: $(wildcard *.c *.h)
36 -include Makefile.deps
39 $(CC) -o $@ $(LDFLAGS) $(objects) -lcrypto -losl
41 cmdline.o: cmdline.c cmdline.h
42 $(CC) -c $(CPPFLAGS) $<
44 cmdline.c cmdline.h: adu.ggo
45 gengetopt --no-handle-error --no-handle-help --conf-parser < $<
49 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
56 select.cmdline.c select.cmdline.h: select.ggo
57 gengetopt --set-package=select \
61 --arg-struct-name=select_args_info \
62 --file-name=$(subst .ggo,,$<).cmdline \
63 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
65 select.cmdline.o: select.cmdline.c select.cmdline.h
66 $(CC) -c $(CPPFLAGS) $<
69 help2man -h --detailed-help --include adu.1.inc -N ./$< > $@
72 man2html $< | sed -e 's|^<DT><DD>$$|<DT><DD><br>|g' > $@
75 rm -f *.o adu *cmdline.c *cmdline.h adu.1 adu.1.html adu.png index.html adu.sk~
77 index.html: adu.1.html index.html.in INSTALL README
78 sed -e '/@README@/,$$d' index.html.in > $@
79 grutatxt -nb < README >> $@
80 sed -e '1,/@README@/d' -e '/@INSTALL@/,$$d' index.html.in >> $@
81 grutatxt -nb < INSTALL >> $@
82 sed -e '1,/@INSTALL@/d' -e '/@MAN_PAGE@/,$$d' index.html.in >> $@
83 sed -e '1,/Return to Main Contents/d' -e '/Index/,$$d' adu.1.html >> $@
84 sed -e '1,/@MAN_PAGE@/d' index.html.in >> $@