Upgrade to 1.18.1
[platform/upstream/c-ares.git] / Makefile.m32
index c27a597..66d28b1 100644 (file)
@@ -8,7 +8,7 @@
 ########################################################
 ## Nothing more to do below this line!
 
-LIB    = libcares.a
+LIB    = src/lib/libcares.a
 
 AR     = $(CROSSPREFIX)ar
 CC     = $(CROSSPREFIX)gcc
@@ -17,15 +17,15 @@ RANLIB      = $(CROSSPREFIX)ranlib
 #RM    = rm -f
 CP     = cp -afv
 
-CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I.
+CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0600
 CFLAGS += -DCARES_STATICLIB
 LDFLAGS        = $(CARES_LDFLAG_EXTRAS) -s
-LIBS   = -lwsock32
+LIBS   = -lws2_32 -liphlpapi
 
 # Makefile.inc provides the CSOURCES and HHEADERS defines
-include Makefile.inc
+include src/lib/Makefile.inc
 
-OBJLIB := $(patsubst %.c,%.o,$(strip $(CSOURCES)))
+OBJLIB := $(patsubst %.c,src/lib/%.o,$(strip $(CSOURCES)))
 
 
 $(LIB): $(OBJLIB)
@@ -34,21 +34,21 @@ $(LIB): $(OBJLIB)
 
 all: $(LIB) demos
 
-demos: adig.exe ahost.exe acountry.exe
+demos: src/tools/adig.exe src/tools/ahost.exe src/tools/acountry.exe
 
 tags:
        etags *.[ch]
 
-%.exe: %.o ares_getopt.o $(LIB)
+%.exe: %.o src/tools/ares_getopt.o $(LIB)
        $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 
-$(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
+$(OBJLIB): include/ares.h include/ares_dns.h include/ares_build.h
 
 .c.o:
-       $(CC) $(CFLAGS) -c $<
+       $(CC) $(CFLAGS) -o $@ -c $<
 
-ares_build.h:
-       $(CP) ares_build.h.dist ares_build.h
+include/ares_build.h:
+       $(CP) include/ares_build.h.dist include/ares_build.h
 
 check:
 
@@ -59,18 +59,19 @@ install:
        ${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
        ${RANLIB} ${DESTDIR}${libdir}/$(LIB)
        chmod u-w ${DESTDIR}${libdir}/$(LIB)
-       ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
-       ${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
-       ${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
+       ${INSTALL} -m 444 ${srcdir}/include/ares.h ${DESTDIR}${includedir}
+       ${INSTALL} -m 444 ${srcdir}/include/ares_build.h ${DESTDIR}${includedir}
+       ${INSTALL} -m 444 ${srcdir}/include/ares_rules.h ${DESTDIR}${includedir}
+       ${INSTALL} -m 444 ${srcdir}/include/ares_version.h ${DESTDIR}${includedir}
        (for man in $(MANPAGES); do \
           ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
        done)
 
 clean:
-       $(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe acountry.exe
+       $(RM) src/tools/ares_getopt.o $(OBJLIB) $(LIB) src/tools/adig.exe src/tools/ahost.exe src/tools/acountry.exe
 
 distclean: clean
        $(RM) config.cache config.log config.status Makefile
-ifeq "$(wildcard ares_build.h.dist)" "ares_build.h.dist"
-       $(RM) ares_build.h
+ifeq "$(wildcard include/ares_build.h.dist)" "include/ares_build.h.dist"
+       $(RM) include/ares_build.h
 endif