forked from SWI-Prolog/packages-clib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mak
175 lines (153 loc) · 5.03 KB
/
Makefile.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
################################################################
# Build the SWI-Prolog tabling package for MS-Windows
#
# Author: Jan Wielemaker
#
# Use:
# nmake /f Makefile.mak
# nmake /f Makefile.mak install
################################################################
PLHOME=..\..
!include $(PLHOME)\src\rules.mk
PKGDLL=socket
SOCKOBJ= socket.obj nonblockio.obj error.obj
CGIOBJ= error.obj form.obj cgi.obj
CRYPTOBJ= error.obj crypt.obj md5.obj md5passwd.obj bsd-crypt.obj
MEMOBJ= error.obj memfile.obj
MIMEOBJ= error.obj mime.obj
MIMELIBS= rfc2045.lib rfc822.lib
TIMEOBJ= error.obj time.obj
READOBJ= readutil.obj
PROCESSOBJ= error.obj process.obj
SHAOBJ= error.obj sha4pl.obj sha1/sha1.obj sha1/sha2.obj \
sha1/hmac_sha1.obj sha1/hmac_sha256.obj
URIOBJ= uri.obj
FILESOBJ= error.obj files.obj
STREAMINFOOBJ= error.obj streaminfo.obj
TIMELIBS= winmm.lib
all: socket.dll cgi.dll memfile.dll mime.dll time.dll readutil.dll \
crypt.dll sha4pl.dll process.dll uri.dll files.dll streaminfo.dll
readutil.dll: $(READOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(READOBJ) $(PLLIB) $(LIBS)
process.dll: $(PROCESSOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(PROCESSOBJ) $(PLLIB) $(LIBS)
socket.dll: $(SOCKOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(SOCKOBJ) $(PLLIB) $(LIBS)
cgi.dll: $(CGIOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(CGIOBJ) $(PLLIB) $(LIBS)
crypt.dll: $(CRYPTOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(CRYPTOBJ) $(PLLIB) $(LIBS)
memfile.dll: $(MEMOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(MEMOBJ) $(PLLIB) $(LIBS)
mime.dll: $(MIMEOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(MIMEOBJ) $(PLLIB) $(LIBS) $(MIMELIBS)
time.dll: $(TIMEOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(TIMEOBJ) $(PLLIB) $(LIBS) $(TIMELIBS)
sha4pl.dll: $(SHAOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(SHAOBJ) $(PLLIB) $(LIBS)
uri.dll: $(URIOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(URIOBJ) $(PLLIB) $(LIBS)
files.dll: $(FILESOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(FILESOBJ) $(PLLIB) $(LIBS)
streaminfo.dll: $(STREAMINFOOBJ)
$(LD) /dll /out:$@ $(LDFLAGS) $(STREAMINFOOBJ) $(PLLIB) $(LIBS)
sha1/hmac_sha1.obj: sha1/hmac.c
$(CC) -I $(PLHOME)\include $(CFLAGS) /DUSE_SHA1 /Fo$@ sha1/hmac.c
sha1/hmac_sha256.obj: sha1/hmac.c
$(CC) -I $(PLHOME)\include $(CFLAGS) /DUSE_SHA256 /Fo$@ sha1/hmac.c
process.obj: win_error.c
files.obj: win_error.c
socket.obj: sockcommon.c
!IF "$(CFG)" == "rt"
install: idll
!ELSE
install: idll ilib
!ENDIF
################################################################
# Testing
################################################################
check: check-socket
torture: torture-socket
check-socket::
"$(PLCON)" -q -f testsocket.pl -F none -g tcp_test,halt -t 'halt(1)'
torture-socket::
"$(PLCON)" -q -f stresssocket.pl -F none -g test,halt -t 'halt(1)'
################################################################
# Installation
################################################################
idll::
copy socket.dll "$(BINDIR)"
copy cgi.dll "$(BINDIR)"
copy crypt.dll "$(BINDIR)"
copy memfile.dll "$(BINDIR)"
copy mime.dll "$(BINDIR)"
copy time.dll "$(BINDIR)"
copy readutil.dll "$(BINDIR)"
copy process.dll "$(BINDIR)"
copy sha4pl.dll "$(BINDIR)"
copy uri.dll "$(BINDIR)"
copy files.dll "$(BINDIR)"
copy streaminfo.dll "$(BINDIR)"
!IF "$(PDB)" == "true"
copy socket.pdb "$(BINDIR)"
copy cgi.pdb "$(BINDIR)"
copy memfile.pdb "$(BINDIR)"
copy mime.pdb "$(BINDIR)"
copy time.pdb "$(BINDIR)"
copy readutil.pdb "$(BINDIR)"
copy process.pdb "$(BINDIR)"
copy sha4pl.pdb "$(BINDIR)"
copy uri.pdb "$(BINDIR)"
copy files.pdb "$(BINDIR)"
copy streaminfo.pdb "$(BINDIR)"
!ENDIF
ilib::
copy socket.pl "$(PLBASE)\library"
copy prolog_server.pl "$(PLBASE)\library"
copy streampool.pl "$(PLBASE)\library"
copy streaminfo.pl "$(PLBASE)\library"
copy cgi.pl "$(PLBASE)\library"
copy crypt.pl "$(PLBASE)\library"
copy memfile.pl "$(PLBASE)\library"
copy mime.pl "$(PLBASE)\library"
copy time.pl "$(PLBASE)\library"
copy sha.pl "$(PLBASE)\library"
copy uri.pl "$(PLBASE)\library"
copy filesex.pl "$(PLBASE)\library"
copy process.pl "$(PLBASE)\library"
copy udp_broadcast.pl "$(PLBASE)\library"
$(MAKEINDEX)
uninstall::
del "$(BINDIR)\socket.dll"
del "$(BINDIR)\streampool.dll"
del "$(BINDIR)\streaminfo.dll"
del "$(BINDIR)\cgi.dll"
del "$(BINDIR)\crypt.dll"
del "$(BINDIR)\memfile.dll"
del "$(BINDIR)\mime.dll"
del "$(BINDIR)\time.dll"
del "$(BINDIR)\readutil.dll"
del "$(BINDIR)\sha4pl.dll"
del "$(BINDIR)\uri.dll"
del "$(BINDIR)\files.dll"
del "$(PLBASE)\library\socket.pl"
del "$(PLBASE)\library\cgi.pl"
del "$(PLBASE)\library\crypt.pl"
del "$(PLBASE)\library\memfile.pl"
del "$(PLBASE)\library\mime.pl"
del "$(PLBASE)\library\time.pl"
del "$(PLBASE)\library\sha.pl"
del "$(PLBASE)\library\uri.pl"
del "$(PLBASE)\library\filesex.pl"
del "$(PLBASE)\library\process.pl"
del "$(PLBASE)\library\udp_broadcast.pl"
$(MAKEINDEX)
html-install::
copy clib.html "$(PKGDOC)"
xpce-install::
clean::
if exist *.obj del *.obj
if exist sha1\*.obj del sha1\*.obj
if exist *~ del *~
distclean: clean
-DEL *.dll *.lib *.exp *.ilk *.pdb 2>nul