Subversion Repositories SvarDOS

Rev

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