Updated for MingW. Added inet_ntop.o inet_net_pton.o bitncmp.o.
[platform/upstream/c-ares.git] / Makefile.m32
1 #############################################################
2 # $Id$
3 #
4 ## Makefile for building libcares.a with MingW32 (GCC-3.2)
5 ## Use: make -f Makefile.m32 [demos]
6 ##
7 ## Quick hack by Guenter; comments to: /dev/nul
8
9 CC = gcc
10 RANLIB = ranlib
11
12 ########################################################
13 ## Nothing more to do below this line!
14
15 LIB=libcares.a
16 CC=gcc
17 CFLAGS=-O2 -Wall -DHAVE_GETOPT_H -DHAVE_AF_INET6 -DHAVE_PF_INET6 \
18        -DHAVE_STRUCT_IN6_ADDR -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
19        -DHAVE_IOCTLSOCKET
20
21 LDFLAGS=-s
22 LIBS=-lwsock32
23
24 MANPAGES := $(patsubst %.c,%.o,$(wildcard ares_*.3))
25
26 OBJS    := $(patsubst %.c,%.o,$(wildcard ares_*.c))
27 OBJS    += windows_port.o inet_ntop.o inet_net_pton.o bitncmp.o
28
29 $(LIB): ${OBJS}
30         ar cru $@ ${OBJS}
31         ${RANLIB} $@
32
33 all: $(LIB) demos
34
35 demos: adig.exe ahost.exe
36
37 tags:
38         etags *.[ch]
39
40 adig.exe: adig.o $(LIB)
41         ${CC} ${LDFLAGS} -o $@ adig.o $(LIB) ${LIBS}
42
43 ahost.exe: ahost.o $(LIB)
44         ${CC} ${LDFLAGS} -o $@ ahost.o $(LIB) ${LIBS}
45
46 ${OBJS}: ares.h ares_dns.h ares_private.h
47
48 .c.o:
49         ${CC} -c ${CFLAGS} $<
50
51 check:
52
53 install:
54         ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
55         ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
56         ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
57         ${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
58         ${RANLIB} ${DESTDIR}${libdir}/$(LIB)
59         chmod u-w ${DESTDIR}${libdir}/$(LIB)
60         ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
61         ${INSTALL} -m 444 ${srcdir}/ares_version.h ${DESTDIR}${includedir}
62         (for man in $(MANPAGES); do \
63            ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
64         done)
65
66 clean:
67         rm -f ${OBJS} $(LIB) adig.o adig.exe ahost.o ahost.exe
68
69 distclean: clean
70         rm -f config.cache config.log config.status Makefile
71