Subversion Repositories SvarDOS

Rev

Rev 976 | Rev 998 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 976 Rev 986
1
#
1
#
2
# This is a makefile to build the SVARCOM command interpreter (COMMAND.COM)
2
# This is a makefile to build the SVARCOM command interpreter (COMMAND.COM)
3
# using OpenWatcom and nasm.
3
# using OpenWatcom and nasm.
4
#
4
#
5
# You can use following targets:
5
# You can use following targets:
6
#
6
#
7
#  wmake           - compiles the program
7
#  wmake           - compiles the program
8
#  wmake clean     - cleans up all non-source files
8
#  wmake clean     - cleans up all non-source files
9
#
9
#
10
 
10
 
11
FEATURES =
11
FEATURES =
12
FEATURES += -DVERDBG
12
FEATURES += -DVERDBG
13
 
13
 
14
LDFLAGS = -0 -y -wx -mt -lr -we -d0 -ox -fm=command.map
14
LDFLAGS = -0 -y -wx -mt -lr -we -d0 -ox -fm=command.map
15
CFLAGS = -0 -wx -ms -we -d0 -ox $(FEATURES)
15
CFLAGS = -0 -wx -ms -we -d0 -ox $(FEATURES)
16
# -0   generate 8086 compatible code
16
# -0   generate 8086 compatible code
17
# -y   ignore %WCL% if present
17
# -y   ignore %WCL% if present
18
# -wx  maximum warnings level
18
# -wx  maximum warnings level
19
# -mt  TINY memory model
19
# -mt  TINY memory model
20
# -lr  real-mode target
20
# -lr  real-mode target
21
# -we  any warning is considered an error
21
# -we  any warning is considered an error
22
# -d0  no debug data
22
# -d0  no debug data
23
# -ox  maximum optimization level
23
# -ox  maximum optimization level
24
#
24
#
25
# NOTE: wcc does not understand -mt, that is why -ms must be passed instead
25
# NOTE: wcc does not understand -mt, that is why -ms must be passed instead
26
 
26
 
27
all: command.com
27
all: command.com
28
 
28
 
29
command.com: rmodcore.h command.obj cmd.obj env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj
29
command.com: rmodcore.h command.obj cmd.obj env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj
30
	# GENERATE CODEPAGE-SPECIFIG VERSIONS OUT OF UTF-8 FILES
30
	# GENERATE CODEPAGE-SPECIFIG VERSIONS OUT OF UTF-8 FILES
31
	CD LANG
31
	CD LANG
32
	utf8tocp 850 DE-UTF8.TXT > DE.TXT
32
	utf8tocp 850 DE-UTF8.TXT > DE.TXT
33
	utf8tocp 437 EN-UTF8.TXT > EN.TXT
33
	utf8tocp 437 EN-UTF8.TXT > EN.TXT
34
	utf8tocp 850 FR-UTF8.TXT > FR.TXT
34
	utf8tocp 850 FR-UTF8.TXT > FR.TXT
35
	utf8tocp maz PL-UTF8.TXT > PL.TXT
35
	utf8tocp maz PL-UTF8.TXT > PL.TXT
36
	..\svarlang.lib\tlumacz en de fr pl
36
	..\svarlang.lib\tlumacz en de fr pl
37
	DEL ??.TXT
37
	DEL ??.TXT
38
	MOVE /Y OUT.LNG ..\SVARCOM.LNG
38
	MOVE /Y OUT.LNG ..\SVARCOM.LNG
39
	MOVE /Y DEFLANG.C ..
39
	MOVE /Y DEFLANG.C ..
40
	CD ..
40
	CD ..
41
	# build the final executable
41
	# build the final executable
42
	*wcl $(LDFLAGS) command.obj cmd.obj deflang.c env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj svarlang.lib\svarlngs.lib
42
	*wcl $(LDFLAGS) command.obj cmd.obj deflang.c env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj svarlang.lib\svarlngs.lib
43
 
43
 
44
cmd.obj: cmd.c cmd\*.c
44
cmd.obj: cmd.c cmd\*.c
45
	wcc $(CFLAGS) cmd.c
45
	wcc $(CFLAGS) cmd.c
46
 
46
 
47
command.obj: command.c rmodcore.h
47
command.obj: command.c rmodcore.h
48
	wcc $(CFLAGS) command.c
48
	wcc $(CFLAGS) command.c
49
 
49
 
50
helpers.obj: helpers.c
50
helpers.obj: helpers.c
51
	wcc $(CFLAGS) helpers.c
51
	wcc $(CFLAGS) helpers.c
52
 
52
 
53
.c.obj:
53
.c.obj:
54
	wcc $(CFLAGS) $<
54
	wcc $(CFLAGS) $<
55
 
55
 
56
rmodcore.h: file2c.com rmod.bin
56
rmodcore.h: file2c.com rmod.bin
57
	file2c /s /l4096 rmod.bin rmodcore.h BUFFER
57
	file2c /s /l4096 rmod.bin rmodcore.h BUFFER
58
 
58
 
59
file2c.com: file2c.c
59
file2c.com: file2c.c
60
	wcl $(LDFLAGS) file2c.c
60
	wcl $(LDFLAGS) file2c.c
61
 
61
 
62
rmod.bin: rmod.asm
62
rmod.bin: rmod.asm
63
	nasm -f bin -l rmod.lst -o rmod.bin rmod.asm
63
	nasm -f bin -l rmod.lst -o rmod.bin rmod.asm
64
 
64
 
65
clean: .SYMBOLIC
65
clean: .SYMBOLIC
66
	del *.com
66
	del *.com
67
	del *.obj
67
	del *.obj
68
	del rmod.bin
68
	del rmod.bin
69
	del rmod.lst
69
	del rmod.lst
70
	del rmodcore.h
70
	del rmodcore.h
71
	del deflang.c
71
	del deflang.c
72
	del command.map
72
	del command.map
73
 
73
 
74
release: command.com .SYMBOLIC
74
release: command.com .SYMBOLIC
75
	# drop old packages if present
75
	# drop old packages if present
76
	IF EXIST svarcom.zip DEL svarcom.zip
76
	IF EXIST svarcom.zip DEL svarcom.zip
77
	IF EXIST svarcom.svp DEL svarcom.svp
77
	IF EXIST svarcom.svp DEL svarcom.svp
78
	# source package
78
	# source package
79
	zip -9rkDX svarcom.zip makefile *.c *.h *.txt *.asm cmd lang svarlang.lib
79
	zip -9rkDX svarcom.zip makefile *.c *.h *.txt *.asm cmd lang svarlang.lib
80
	# SvarDOS binary package
80
	# SvarDOS binary package
81
	mkdir appinfo
81
	mkdir appinfo
82
	mkdir bin
82
	mkdir bin
83
	mkdir doc
83
	mkdir doc
84
	mkdir doc\svarcom
84
	mkdir doc\svarcom
85
	mkdir nls
85
	mkdir nls
86
	copy command.com bin
86
	copy command.com bin
87
	copy *.txt doc\svarcom\
87
	copy *.txt doc\svarcom\
88
	copy svarcom.lsm appinfo\
88
	copy svarcom.lsm appinfo\
89
	copy svarcom.lng nls\
89
	copy svarcom.lng nls\
-
 
90
	upx -9 --8086 bin\command.com
90
	zip -9rkDX -m svarcom.svp appinfo bin doc nls
91
	zip -9rkDX -m svarcom.svp appinfo bin doc nls
91
	rmdir appinfo
92
	rmdir appinfo
92
	rmdir bin
93
	rmdir bin
93
	rmdir nls
94
	rmdir nls
94
	rmdir doc\svarcom
95
	rmdir doc\svarcom
95
	rmdir doc
96
	rmdir doc
96
 
97