Added TOPDIR variable. Put dependencies in external file.
[platform/upstream/c-ares.git] / Makefile.dj
1 #
2 # c-ares Makefile for djgpp/gcc/Watt-32.
3 #   By Gisle Vanem <giva@bgnett.no> 2004.
4 #
5 # $Id$
6
7 TOPDIR = ..
8
9 include ../packages/DOS/common.dj
10
11 include Makefile.inc
12
13 CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_FIONBIO \
14           -DHAVE_STRUCT_IN6_ADDR -DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID \
15           -DHAVE_SYS_TIME_H -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
16           -DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' -DHAVE_PROCESS_H \
17           -DHAVE_ARPA_NAMESER_H -DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND \
18           -DSEND_TYPE_ARG1='int'   -DSEND_QUAL_ARG2='const' \
19           -DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
20           -DSEND_TYPE_ARG4='int'   -DSEND_TYPE_RETV='int' \
21           -DRECV_TYPE_ARG1='int'   -DRECV_TYPE_ARG2='void*' \
22           -DRECV_TYPE_ARG3='int'   -DRECV_TYPE_ARG4='int' \
23           -DRECV_TYPE_RETV='int'   -DHAVE_STRUCT_TIMEVAL \
24           -UHAVE_CONFIG_H
25
26 LDFLAGS = -s
27
28 ifeq ($(USE_DEBUG),1)
29   EX_LIBS = ../lib/libcurl.a
30 endif
31
32 ifeq ($(USE_SSL),1)
33   EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a
34 endif
35
36 ifeq ($(USE_ZLIB),1)
37   EX_LIBS += $(ZLIB_ROOT)/libz.a
38   CFLAGS  += -DUSE_MANUAL
39 endif
40
41 ifeq ($(USE_IDNA),1)
42   EX_LIBS += $(LIBIDN_ROOT)/lib/dj_obj/libidn.a -liconv
43 endif
44
45 EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
46
47 OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
48
49 all: $(OBJ_DIR) libcares.a ahost.exe adig.exe
50         @echo Welcome to c-ares.
51
52 libcares.a: $(OBJECTS)
53         ar rs $@ $?
54
55 ahost.exe: ahost.c libcares.a
56         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
57
58 adig.exe: adig.c libcares.a
59         $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
60
61 clean:
62         rm -f $(OBJECTS) libcares.a
63
64 vclean realclean: clean
65         rm -f ahost.exe adig.exe depend.dj
66         - rmdir $(OBJ_DIR)
67
68 -include depend.dj
69