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