|
| 1 | +# Copyright Joyent, Inc. and other Node contributors. All rights reserved. |
| 2 | +# |
| 3 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | +# of this software and associated documentation files (the "Software"), to |
| 5 | +# deal in the Software without restriction, including without limitation the |
| 6 | +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 7 | +# sell copies of the Software, and to permit persons to whom the Software is |
| 8 | +# furnished to do so, subject to the following conditions: |
| 9 | +# |
| 10 | +# The above copyright notice and this permission notice shall be included in |
| 11 | +# all copies or substantial portions of the Software. |
| 12 | +# |
| 13 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 18 | +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 19 | +# IN THE SOFTWARE. |
| 20 | + |
| 21 | +uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
| 22 | + |
| 23 | +ifdef MSVC |
| 24 | +uname_S := MINGW |
| 25 | +endif |
| 26 | + |
| 27 | +CPPFLAGS += -Isrc |
| 28 | + |
| 29 | +CARES_OBJS = |
| 30 | +CARES_OBJS += src/ares__close_sockets.o |
| 31 | +CARES_OBJS += src/ares__get_hostent.o |
| 32 | +CARES_OBJS += src/ares__read_line.o |
| 33 | +CARES_OBJS += src/ares__timeval.o |
| 34 | +CARES_OBJS += src/ares_cancel.o |
| 35 | +CARES_OBJS += src/ares_data.o |
| 36 | +CARES_OBJS += src/ares_destroy.o |
| 37 | +CARES_OBJS += src/ares_expand_name.o |
| 38 | +CARES_OBJS += src/ares_expand_string.o |
| 39 | +CARES_OBJS += src/ares_fds.o |
| 40 | +CARES_OBJS += src/ares_free_hostent.o |
| 41 | +CARES_OBJS += src/ares_free_string.o |
| 42 | +CARES_OBJS += src/ares_gethostbyaddr.o |
| 43 | +CARES_OBJS += src/ares_gethostbyname.o |
| 44 | +CARES_OBJS += src/ares_getnameinfo.o |
| 45 | +CARES_OBJS += src/ares_getopt.o |
| 46 | +CARES_OBJS += src/ares_getsock.o |
| 47 | +CARES_OBJS += src/ares_init.o |
| 48 | +CARES_OBJS += src/ares_library_init.o |
| 49 | +CARES_OBJS += src/ares_llist.o |
| 50 | +CARES_OBJS += src/ares_mkquery.o |
| 51 | +CARES_OBJS += src/ares_nowarn.o |
| 52 | +CARES_OBJS += src/ares_options.o |
| 53 | +CARES_OBJS += src/ares_parse_a_reply.o |
| 54 | +CARES_OBJS += src/ares_parse_aaaa_reply.o |
| 55 | +CARES_OBJS += src/ares_parse_mx_reply.o |
| 56 | +CARES_OBJS += src/ares_parse_naptr_reply.o |
| 57 | +CARES_OBJS += src/ares_parse_ns_reply.o |
| 58 | +CARES_OBJS += src/ares_parse_ptr_reply.o |
| 59 | +CARES_OBJS += src/ares_parse_soa_reply.o |
| 60 | +CARES_OBJS += src/ares_parse_srv_reply.o |
| 61 | +CARES_OBJS += src/ares_parse_txt_reply.o |
| 62 | +CARES_OBJS += src/ares_process.o |
| 63 | +CARES_OBJS += src/ares_query.o |
| 64 | +CARES_OBJS += src/ares_search.o |
| 65 | +CARES_OBJS += src/ares_send.o |
| 66 | +CARES_OBJS += src/ares_strcasecmp.o |
| 67 | +CARES_OBJS += src/ares_strdup.o |
| 68 | +CARES_OBJS += src/ares_strerror.o |
| 69 | +CARES_OBJS += src/ares_timeout.o |
| 70 | +CARES_OBJS += src/ares_version.o |
| 71 | +CARES_OBJS += src/ares_writev.o |
| 72 | +CARES_OBJS += src/bitncmp.o |
| 73 | +CARES_OBJS += src/inet_net_pton.o |
| 74 | +CARES_OBJS += src/inet_ntop.o |
| 75 | + |
| 76 | +ifneq (,$(findstring MINGW,$(uname_S))) |
| 77 | +include config-mingw.mk |
| 78 | +else |
| 79 | +include config-unix.mk |
| 80 | +endif |
| 81 | + |
| 82 | +all: libcares.a |
| 83 | + |
| 84 | +$(CARES_OBJS): %.o: %.c |
| 85 | + $(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H |
| 86 | + |
| 87 | + |
| 88 | +.PHONY: clean distclean |
| 89 | + |
| 90 | +clean: |
| 91 | + $(RM) -f src/*.o *.a |
| 92 | + |
| 93 | +distclean: |
| 94 | + $(RM) -f src/*.o *.a |
| 95 | + |
0 commit comments