-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAKEFILE
114 lines (80 loc) · 2.89 KB
/
MAKEFILE
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
MODELCHR=L
MODELSTR=large
MTCPROOT=F:\Legacy\PC\SOURCE\mTCP-src_2013-05-23
tcp_h_dir = $(MTCPROOT)\TCPINC
tcp_c_dir = $(MTCPROOT)\TCPLIB
common_h_dir = $(MTCPROOT)\INCLUDE
CC=wcl
CPP=wcl
CFLAGS=-c -m$(MODELCHR) -d__DOS__ -ecw -I. -w=2 -d2 -q
CPPFLAGS=-c -cc++ -m$(MODELCHR) -d__DOS__ -dCFG_H="nwbackup.cfg" -ecw -I.;$(tcp_h_dir) -w=2 -d2 -q
#CFLAGS=-c -m$(MODELCHR) -d__DOS__ -ecw -I. -0 -w=2 -oh -ok -ot -s -oa -ol+ -ei -zp2 -q
#CPPFLAGS=-c -cc++ -m$(MODELCHR) -d__DOS__ -dCFG_H="nwbackup.cfg" -ecw -I.;$(tcp_h_dir) -0 -w=2 -oh -ok -ot -s -oa -ol+ -ei -zp2 -q
AS=wasm
AFLAGS= -0 -m$(MODELCHR) -q
LIB=wlib
LINKER=wcl
LFLAGS=-bcl=dos -q -d2
tcp_objs=packet.obj arp.obj eth.obj ip.obj tcp.obj tcpsockm.obj udp.obj utils.obj dns.obj timer.obj ipasm.obj
OBJS=nwbackup.obj dir.obj mtcpftp.obj control.obj backup.obj restore.obj
EXES=nwbackup.exe
all: clean nwbackup.exe
test: clean-test test\dirtest.exe test\ftptest.exe test\mdirtest.exe test\tmptest.exe
#Include these directories
.asm : $(tcp_c_dir)
.cpp : $(tcp_c_dir)
.asm.obj:
$(AS) $(AFLAGS) $(tcp_c_dir)\$*.asm
.c.obj:
$(CC) $(CFLAGS) $*.c
.cpp.obj:
$(CPP) $(CPPFLAGS) $(tcp_c_dir)\$*.cpp
#Test files
#Dir traversal test
test\dirtest.obj: test\dirtest.c
$(CC) $(CFLAGS) -fo=test\dirtest.obj test\dirtest.c
test\dirtest.exe: test\dirtest.obj dir.obj
$(LINKER) $(LFLAGS) -fe=test\dirtest.exe test\dirtest.obj dir.obj
#FTP test
test\ftptest.obj: test\ftptest.c
$(CC) $(CFLAGS) -I.. -fo=test\ftptest.obj test\ftptest.c
test\ftptest.exe: test\ftptest.obj mtcpftp.obj $(tcp_objs)
$(LINKER) $(LFLAGS) -fe=test\ftptest.exe test\ftptest.obj mtcpftp.obj $(tcp_objs)
#Alternate dir traversal test
test\mdirtest.obj: test\mdirtest.c
$(CC) $(CFLAGS) -Za99 -fo=test\mdirtest.obj test\mdirtest.c
test\mdirtest.exe: test\mdirtest.obj
$(LINKER) $(LFLAGS) -fe=test\mdirtest.exe test\mdirtest.obj
#Temp file test
test\tmptest.obj: test\tmptest.c
$(CC) $(CFLAGS) -fo=test\tmptest.obj test\tmptest.c
test\tmptest.exe: test\tmptest.obj
$(LINKER) $(LFLAGS) -fe=test\tmptest.exe test\tmptest.obj
#Application proper
nwbackup.obj: nwbackup.c
$(CC) $(CFLAGS) -fo=nwbackup.obj nwbackup.c
dir.obj: dir.c
$(CC) $(CFLAGS) -fo=dir.obj dir.c
control.obj: control.c
$(CC) $(CFLAGS) -fo=control.obj control.c
backup.obj: backup.c
$(CC) $(CFLAGS) -fo=backup.obj backup.c
restore.obj: restore.c
$(CC) $(CFLAGS) -fo=restore.obj restore.c
mtcpftp.obj: mtcpftp.cpp
$(CPP) $(CPPFLAGS) -fo=mtcpftp.obj mtcpftp.cpp
nwbackup.exe: $(OBJS) $(tcp_objs)
$(LINKER) $(LFLAGS) -fe=nwbackup.exe $(OBJS) $(tcp_objs)
#$(LIBNAME).LIB : $(OBJS)
#All other exes link against a single object file.
.obj.exe:
$(LINKER) $(LFLAGS) $.exe $(OBJS)
#Assume BIN directory exists.
install: .symbolic
copy /Y *.EXE .\BIN
dbg-clean: .symbolic
del *.obj *.lib *.exe
clean: .symbolic
del *.obj *.lib *.err *.exe
clean-test: .symbolic
del test\*.obj test\*.lib test\*.err test\*.exe