blob: 3034d46e34de572ccae66c85641234e7b6d95196 (
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
|
ifeq ($(strip $(V)),)
E = @echo
Q = @
else
E = @\#
Q =
endif
export E Q
ifneq ($(USE_ASCIIDOCTOR),)
ASCIIDOC := asciidoctor
XMLTO :=
else
ASCIIDOC := asciidoc
XMLTO := xmlto
endif
SRC += bers.txt
XMLS := $(patsubst %.txt,%.xml,$(SRC))
MANS := $(patsubst %.txt,%.8,$(SRC))
%.8: %.txt
$(E) " GEN " $@
ifneq ($(USE_ASCIIDOCTOR),)
$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
else
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
endif
docs: $(MANS)
@true
CFLAGS := -O0 -ggdb3
LIBS := -lpthread
%.o: %.c
$(E) " CC " $@
$(Q) $(CC) -c -o $@ $(CFLAGS) $^
bers: bers.o
$(E) " LINK " $@
$(Q) $(CC) -o $@ $(CFLAGS) $(LIBS) $^
all: bers
@true
clean:
$(E) " CLEAN "
$(Q) rm -f $(XMLS) $(MANS)
$(Q) rm -f bers.o
$(Q) rm -f bers
.PHONY: all docs clean
|