configure: fix symbol hiding usability check
[platform/upstream/c-ares.git] / Makefile.m32
1 #############################################################
2 #
3 ## Makefile for building libcares.a with MingW32 (GCC-3.2)
4 ## Use: make -f Makefile.m32 [demos]
5 ##
6 ## Quick hack by Guenter; comments to: /dev/nul
7 #
8 ########################################################
9 ## Nothing more to do below this line!
10
11 LIB     = libcares.a
12
13 CC      = gcc
14 LD      = gcc
15 RANLIB  = ranlib
16 #RM     = rm -f
17
18 CFLAGS  = -O2 -Wall
19 LDFLAGS = -s
20 LIBS    = -lwsock32
21
22 # Makefile.inc provides the CSOURCES and HHEADERS defines
23 include Makefile.inc
24
25 OBJLIB  := $(patsubst %.c,%.o,$(strip $(CSOURCES)))
26
27
28 $(LIB): $(OBJLIB)
29         ar cru $@ $^
30         $(RANLIB) $@
31
32 all: $(LIB) demos
33
34 demos: adig.exe ahost.exe acountry.exe
35
36 tags:
37         etags *.[ch]
38
39 %.exe: %.o ares_getopt.o $(LIB)
40         $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
41
42 $(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
43
44 .c.o:
45         $(CC) $(CFLAGS) -c $<
46
47 check:
48
49 install:
50         ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
51         ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
52         ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
53         ${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
54         ${RANLIB} ${DESTDIR}${libdir}/$(LIB)
55         chmod u-w ${DESTDIR}${libdir}/$(LIB)
56         ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
57         ${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
58         ${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
59         (for man in $(MANPAGES); do \
60            ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
61         done)
62
63 clean:
64         $(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe acountry.exe
65
66 distclean: clean
67         $(RM) config.cache config.log config.status Makefile
68