Makefile.m32 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. ########################################################
  10. ## Nothing more to do below this line!
  11. LIB = libcares.a
  12. CC = gcc
  13. LD = gcc
  14. RANLIB = ranlib
  15. #RM = rm -f
  16. CFLAGS = -O2 -Wall
  17. LDFLAGS = -s
  18. LIBS = -lwsock32
  19. # Makefile.inc provides the CSOURCES and HHEADERS defines
  20. include Makefile.inc
  21. OBJLIB := $(patsubst %.c,%.o,$(strip $(CSOURCES)))
  22. $(LIB): $(OBJLIB)
  23. ar cru $@ $^
  24. $(RANLIB) $@
  25. all: $(LIB) demos
  26. demos: adig.exe ahost.exe acountry.exe
  27. tags:
  28. etags *.[ch]
  29. %.exe: %.o ares_getopt.o $(LIB)
  30. $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
  31. $(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
  32. .c.o:
  33. $(CC) $(CFLAGS) -c $<
  34. check:
  35. install:
  36. ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
  37. ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
  38. ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
  39. ${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
  40. ${RANLIB} ${DESTDIR}${libdir}/$(LIB)
  41. chmod u-w ${DESTDIR}${libdir}/$(LIB)
  42. ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
  43. ${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
  44. ${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
  45. (for man in $(MANPAGES); do \
  46. ${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
  47. done)
  48. clean:
  49. $(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe acountry.exe
  50. distclean: clean
  51. $(RM) config.cache config.log config.status Makefile