Prevent wrapper.c from flooding the IRC server.
[iii.git] / Makefile
bloba68e94d4abd292e30b3bcb6d9ba88b2f4b153c35
1 # ii - irc it - simple but flexible IRC client
2 # (C)opyright MMV-MMVI Anselm R. Garbe
3 # (C)opyright MMV-MMVII Anselm R. Garbe, Nico Golde
5 include config.mk
7 # Configuration:
8 .SUFFIXES: .in.1 .1 .1.html .1.txt
9 PROJECT = ii
10 DOCSRC = doc/ # Should end with a slash.
11 CSRCS = ii.c wrapper.c
12 MANSRCS = ${DOCSRC}ii.in.1 ${DOCSRC}wrapper.in.1
14 all: options ${CSRCS:.c=} ${MANSRCS:.in.1=.1}
15 @echo Built the sources and formatted the manpages.
17 options:
18 @echo Build options:
19 @echo "LIBS = ${LIBS}"
20 @echo "INCLUDES = ${INCLUDES}"
21 @echo "CFLAGS = ${CFLAGS}"
22 @echo "LDFLAGS = ${LDFLAGS}"
23 @echo "CC = ${CC}"
25 # Building the sources:
26 .c.o:
27 @echo CC $<
28 @${CC} -c ${CFLAGS} $<
30 .o:
31 @echo LD $<
32 @${CC} -o $@ $< ${LDFLAGS}
34 ${CSRCS:.c=}: $@.o $@
36 # Formatting the manpages:
37 .in.1.1:
38 @echo MDOC TERM $<
39 @mandoc -Tlint $<
40 @cp -f $< $@
42 .1.1.html:
43 @echo MDOC HTML $<
44 @mandoc -Thtml -Wall -fstrict $< >$@
46 .1.1.txt:
47 @echo MDOC TXT $<
48 @mandoc -Wall -fstrict $< | col -b >$@
50 format: ${MANSRCS:.in.1=.1.txt} ${MANSRCS:.in.1=.1.html}
52 dist: all format
53 @mkdir -p ${PROJECT}-${VERSION}/${DOCSRC}
54 @cp -R query.sh Makefile CHANGES README LICENSE config.mk ${CSRCS} \
55 ${PROJECT}-${VERSION}
56 @cp -R ${DOCSRC}FAQ ${MANSRCS} ${MANSRCS:.in.1=.1.txt} \
57 ${MANSRCS:.in.1=.1.html} ${PROJECT}-${VERSION}/${DOCSRC}
58 @tar -cf ${PROJECT}-${VERSION}.tar ${PROJECT}-${VERSION}
59 @gzip ${PROJECT}-${VERSION}.tar
60 @rm -rf ${PROJECT}-${VERSION}
61 @echo Created distribution ${PROJECT}-${VERSION}.tar.gz.
63 install: all
64 @mkdir -p ${DESTDIR}/${DOCDIR}
65 @mkdir -p ${DESTDIR}/${BINDIR}
66 @mkdir -p ${DESTDIR}/${MAN1DIR}
68 @install -d ${DESTDIR}/${BINDIR} ${DESTDIR}/${MAN1DIR}
69 @install -m 644 CHANGES README query.sh ${DOCSRC}FAQ LICENSE \
70 ${DESTDIR}/${DOCDIR}
71 @install -m 775 ${CSRCS:.c=} ${DESTDIR}/${BINDIR}
72 @install -m 444 ${MANSRCS:.in.1=.1} ${DESTDIR}/${MAN1DIR}
73 @echo Installed everything.
75 uninstall: all
76 .for mansrc in ${MANSRCS:.in.1=.1}
77 @rm -f ${DESTDIR}/${MAN1DIR}/`basename ${mansrc}`
78 .endfor
79 @rm -rf ${DESTDIR}/${DOCDIR}
80 .for exec in ${CSRCS:.c=}
81 @rm -f ${DESTDIR}/${BINDIR}/${exec}
82 .endfor
83 @echo Uninstalled everything.
85 clean:
86 rm -f ${CSRCS:.c=} */*~ *.o *core *.tar.gz ${MANSRCS:.in.1=.1} \
87 ${MANSRCS:.in.1=.1.txt} ${MANSRCS:.in.1=.1.html}