Initail import package wget: A utility for retrieving files using the HTTP or FTP...
[external/wget.git] / msdos / Makefile.DJ
1 #
2 # GNU Makefile for wget / djgpp / MSDOS.
3 # By Gisle Vanem <gvanem@broadpark.no> 2009.
4 #
5 # `cd' to `./src' and issue the command:
6 #    make -f ../msdos/Makefile.dj depend
7 #  followed by:
8 #    make -f ../msdos/Makefile.dj
9 #
10 VERSION = 1.12 (djgpp/DOS)
11
12 .SUFFIXES: .exe
13
14 VPATH = ../lib ../md5 ../msdos
15
16 USE_OPENSSL = 0
17 USE_IPV6    = 1
18
19 #
20 # Change to suite.
21 #
22 OPENSSL_ROOT = e:/net/OpenSSL.099
23 ZLIB_ROOT    = e:/djgpp/contrib/zlib
24
25 OBJ_DIR = djgpp.obj
26 CC      = gcc
27 CFLAGS  = -O2 -g -Wall -Wcast-align -I. -I../msdos -I../lib -I../md5 \
28           -I/dev/env/WATT_ROOT/inc -DHAVE_CONFIG_H -DENABLE_DEBUG \
29           -DUSE_WATT32
30
31 # LDFLAGS = -s
32
33 ifeq ($(USE_OPENSSL),1)
34   CFLAGS  += -DHAVE_OPENSSL -DHAVE_SSL -DOPENSSL_NO_KRB5 -I$(OPENSSL_ROOT)
35   EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a \
36              $(ZLIB_ROOT)/libz.a
37   SOURCES += openssl.c http-ntlm.c
38 endif
39
40 ifeq ($(USE_IPV6),1)
41   CFLAGS += -DENABLE_IPV6
42 endif
43
44 EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a
45
46 SOURCES += cmpt.c connect.c cookies.c exits.c ftp.c ftp-basic.c ftp-ls.c \
47            ftp-opie.c hash.c host.c html-parse.c html-url.c http.c \
48            init.c log.c main.c gen-md5.c netrc.c progress.c recur.c \
49            res.c retr.c snprintf.c url.c utils.c version.c convert.c \
50            ptimer.c spider.c css.c css-url.c build_info.c ../md5/md5.c \
51            ../msdos/msdos.c \
52            $(addprefix ../lib/, error.c exitfail.c quote.c \
53              quotearg.c getopt.c getopt1.c xalloc-die.c xmalloc.c)
54
55 OBJECTS = $(addprefix $(OBJ_DIR)/, $(notdir $(SOURCES:.c=.o)))
56
57 all: $(OBJ_DIR) wget.exe
58         @echo 'Welcome to Wget'
59
60 $(OBJ_DIR):
61         mkdir $(OBJ_DIR)
62
63 wget.exe: $(OBJECTS)
64         $(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS)
65
66 css.c: css.l
67         flex -8 -o$@ $^
68
69 clean:
70         rm -f $(OBJ_DIR)/*.o $(MAPFILE)
71
72 vclean realclean: clean
73         rm -f wget.exe depend.dj version.c
74         - rmdir $(OBJ_DIR)
75
76 $(OBJ_DIR)/%.o: %.c
77         $(CC) $(CFLAGS) -o $@ -c $<
78         @echo
79
80 version.c: ../msdos/Makefile.DJ
81         @echo 'char *version_string     = "$(VERSION)";' > $@
82         @echo 'char *compilation_string = "$(CC) $(CFLAGS)";' >> $@
83         @echo 'char *link_string        = "$(CC) $(LDFLAGS) -o wget.exe $$(OBJECTS) $(EX_LIBS)";' >> $@
84
85 depend: version.c
86         $(CC) -MM $(CFLAGS) $(SOURCES) | \
87         sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
88
89 -include depend.dj
90