Subversion Repositories SvarDOS

Rev

Rev 2193 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
349 mateuszvis 1
#
2
# This is a makefile to build the SVARCOM command interpreter (COMMAND.COM)
421 mateuszvis 3
# using OpenWatcom and nasm.
349 mateuszvis 4
#
5
# You can use following targets:
6
#
7
#  wmake           - compiles the program
8
#  wmake clean     - cleans up all non-source files
9
#
10
 
496 mateuszvis 11
FEATURES =
1745 mateusz.vi 12
 
13
# hidden (debug-oriented) features:
14
 
15
# display debug data within the "ver" screen
1738 mateusz.vi 16
#FEATURES += -DVERDBG
496 mateuszvis 17
 
1745 mateusz.vi 18
# dump the NLS collate table to screen at each DIR
19
#FEATURES += -DDIR_DUMPNLSCOLLATE
20
 
21
 
476 mateuszvis 22
LDFLAGS = -0 -y -wx -mt -lr -we -d0 -ox -fm=command.map
2244 mateusz.vi 23
CFLAGS = -0 -wx -ms -we -d0 -ox -zl $(FEATURES)
349 mateuszvis 24
# -0   generate 8086 compatible code
25
# -y   ignore %WCL% if present
26
# -wx  maximum warnings level
27
# -mt  TINY memory model
28
# -lr  real-mode target
29
# -we  any warning is considered an error
30
# -d0  no debug data
31
# -ox  maximum optimization level
2244 mateusz.vi 32
# -zl  remove default library information
476 mateuszvis 33
#
34
# NOTE: wcc does not understand -mt, that is why -ms must be passed instead
349 mateuszvis 35
 
36
all: command.com
37
 
2244 mateusz.vi 38
command.com: startup.obj rmodcore.h command.obj cmd.obj deflang.obj env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj
1058 mateusz.vi 39
	# build the final executable
2244 mateusz.vi 40
	*wlink SYSTEM DOS COM OPTION MAP FILE startup,command.obj,cmd.obj,deflang.obj,env.obj,redir.obj,rmodinit.obj,sayonara.obj,helpers.obj,svarlang.lib\svarlngs.lib NAME command.com
1058 mateusz.vi 41
 
2244 mateusz.vi 42
startup.obj: startup.asm
43
	wasm startup.asm -DSTACKSIZE=2048
44
 
1058 mateusz.vi 45
deflang.obj: lang\*.txt
1722 bttr 46
	# GENERATE CODEPAGE-SPECIFIC VERSIONS OUT OF UTF-8 FILES
965 mateusz.vi 47
	CD LANG
2085 mateusz.vi 48
	utf8tocp 850 BR-UTF8.TXT BR.TXT
49
	utf8tocp 850 DE-UTF8.TXT DE.TXT
50
	utf8tocp 437 EN-UTF8.TXT EN.TXT
51
	utf8tocp 850 FR-UTF8.TXT FR.TXT
52
	utf8tocp maz PL-UTF8.TXT PL.TXT
53
	utf8tocp 857 TR-UTF8.TXT TR.TXT
1195 mateusz.vi 54
	..\svarlang.lib\tlumacz en br de fr pl tr > tlumacz.log
965 mateusz.vi 55
	DEL ??.TXT
56
	MOVE /Y OUT.LNG ..\SVARCOM.LNG
57
	MOVE /Y DEFLANG.C ..
58
	CD ..
1058 mateusz.vi 59
	wcc $(CFLAGS) deflang.c
349 mateuszvis 60
 
487 mateuszvis 61
cmd.obj: cmd.c cmd\*.c
62
	wcc $(CFLAGS) cmd.c
63
 
516 mateuszvis 64
command.obj: command.c rmodcore.h
65
	wcc $(CFLAGS) command.c
66
 
965 mateusz.vi 67
helpers.obj: helpers.c
513 mateuszvis 68
	wcc $(CFLAGS) helpers.c
69
 
476 mateuszvis 70
.c.obj:
71
	wcc $(CFLAGS) $<
72
 
509 mateuszvis 73
rmodcore.h: file2c.com rmod.bin
2193 mateusz.vi 74
	file2c /s /l4096 rmod.bin rmodcore.h BUFFER
349 mateuszvis 75
 
76
file2c.com: file2c.c
476 mateuszvis 77
	wcl $(LDFLAGS) file2c.c
349 mateuszvis 78
 
509 mateuszvis 79
rmod.bin: rmod.asm
1592 mateusz.vi 80
	bldrmod.bat
349 mateuszvis 81
 
82
clean: .SYMBOLIC
83
	del *.com
84
	del *.obj
524 mateuszvis 85
	del rmod.bin
86
	del rmod.lst
87
	del rmodcore.h
965 mateusz.vi 88
	del deflang.c
524 mateuszvis 89
	del command.map
394 mateuszvis 90
 
966 mateusz.vi 91
release: command.com .SYMBOLIC
92
	# drop old packages if present
93
	IF EXIST svarcom.zip DEL svarcom.zip
94
	IF EXIST svarcom.svp DEL svarcom.svp
95
	# source package
965 mateusz.vi 96
	zip -9rkDX svarcom.zip makefile *.c *.h *.txt *.asm cmd lang svarlang.lib
966 mateusz.vi 97
	# SvarDOS binary package
98
	mkdir appinfo
1629 mateusz.vi 99
	mkdir bin
966 mateusz.vi 100
	mkdir doc
101
	mkdir doc\svarcom
1899 mateusz.vi 102
	copy svarcom.txt doc\svarcom\
103
	copy history.txt doc\svarcom\
966 mateusz.vi 104
	copy svarcom.lsm appinfo\
1629 mateusz.vi 105
	copy svarcom.lng bin\
998 mateusz.vi 106
	upx -9 --8086 command.com
1629 mateusz.vi 107
	zip -9rkDX -m svarcom.svp command.com appinfo bin doc
966 mateusz.vi 108
	rmdir appinfo
1629 mateusz.vi 109
	rmdir bin
966 mateusz.vi 110
	rmdir doc\svarcom
111
	rmdir doc