1# 2# c-ares Makefile for djgpp/gcc/Watt-32. 3# By Gisle Vanem <gvanem@yahoo.no> 2004. 4# 5 6 7TOPDIR = .. 8 9DEPEND_PREREQ = ares_config.h 10 11include ../packages/DOS/common.dj 12include Makefile.inc 13 14CFLAGS += -DWATT32 -Dselect=select_s 15 16LDFLAGS = -s 17 18ifeq ($(USE_CURLDEBUG),1) 19 EX_LIBS = ../lib/libcurl.a 20 OBJ_HACK = $(OBJECTS) 21else 22 OBJ_HACK = libcares.a 23endif 24 25ifeq ($(USE_SSL),1) 26 EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a 27endif 28 29ifeq ($(USE_ZLIB),1) 30 EX_LIBS += $(ZLIB_ROOT)/libz.a 31endif 32 33ifeq ($(USE_IDNA),1) 34 EX_LIBS += $(LIBIDN_ROOT)/lib/dj_obj/libidn.a -liconv 35endif 36 37EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a 38 39OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o)) 40 41all: $(OBJ_DIR) ares_config.h libcares.a ahost.exe adig.exe acountry.exe 42 @echo Welcome to c-ares. 43 44libcares.a: $(OBJECTS) 45 ar rs $@ $? 46 47ares_config.h: config-dos.h 48 $(COPY) $^ $@ 49 50ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK) 51 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS) 52 53adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK) 54 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS) 55 56acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK) 57 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS) 58 59# clean generated files 60# 61genclean: 62 - $(DELETE) ares_config.h 63 64# clean object files and subdir 65# 66objclean: genclean 67 - $(DELETE) $(OBJ_DIR)$(DS)*.o 68 - $(RMDIR) $(OBJ_DIR) 69 70# clean without removing built library and programs 71# 72clean: objclean 73 - $(DELETE) depend.dj 74 75# clean everything 76# 77realclean vclean: clean 78 - $(DELETE) libcares.a 79 - $(DELETE) acountry.exe 80 - $(DELETE) adig.exe 81 - $(DELETE) ahost.exe 82 - $(DELETE) libcares.a 83 84-include depend.dj 85 86