Subversion Repositories SvarDOS

Rev

Rev 966 | Rev 976 | 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
 
538 mateuszvis 29
command.com: rmodcore.h command.obj cmd.obj env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj
965 mateusz.vi 30
	# GENERATE CODEPAGE-SPECIFIG VERSIONS OUT OF UTF-8 FILES
31
	CD LANG
32
	utf8tocp 437 EN-UTF8.TXT > EN.TXT
33
	utf8tocp 850 FR-UTF8.TXT > FR.TXT
34
	utf8tocp maz PL-UTF8.TXT > PL.TXT
35
	..\svarlang.lib\tlumacz en fr pl
36
	DEL ??.TXT
37
	MOVE /Y OUT.LNG ..\SVARCOM.LNG
38
	MOVE /Y DEFLANG.C ..
39
	CD ..
40
	# build the final executable
968 mateusz.vi 41
	*wcl $(LDFLAGS) command.obj cmd.obj deflang.c env.obj redir.obj rmodinit.obj sayonara.obj helpers.obj svarlang.lib\svarlngs.lib
349 mateuszvis 42
 
487 mateuszvis 43
cmd.obj: cmd.c cmd\*.c
44
	wcc $(CFLAGS) cmd.c
45
 
516 mateuszvis 46
command.obj: command.c rmodcore.h
47
	wcc $(CFLAGS) command.c
48
 
965 mateusz.vi 49
helpers.obj: helpers.c
513 mateuszvis 50
	wcc $(CFLAGS) helpers.c
51
 
476 mateuszvis 52
.c.obj:
53
	wcc $(CFLAGS) $<
54
 
509 mateuszvis 55
rmodcore.h: file2c.com rmod.bin
56
	file2c /s /l4096 rmod.bin rmodcore.h BUFFER
349 mateuszvis 57
 
58
file2c.com: file2c.c
476 mateuszvis 59
	wcl $(LDFLAGS) file2c.c
349 mateuszvis 60
 
509 mateuszvis 61
rmod.bin: rmod.asm
62
	nasm -f bin -l rmod.lst -o rmod.bin rmod.asm
349 mateuszvis 63
 
64
clean: .SYMBOLIC
65
	del *.com
66
	del *.obj
524 mateuszvis 67
	del rmod.bin
68
	del rmod.lst
69
	del rmodcore.h
965 mateusz.vi 70
	del deflang.c
524 mateuszvis 71
	del command.map
394 mateuszvis 72
 
966 mateusz.vi 73
release: command.com .SYMBOLIC
74
	# drop old packages if present
75
	IF EXIST svarcom.zip DEL svarcom.zip
76
	IF EXIST svarcom.svp DEL svarcom.svp
77
	# source package
965 mateusz.vi 78
	zip -9rkDX svarcom.zip makefile *.c *.h *.txt *.asm cmd lang svarlang.lib
966 mateusz.vi 79
	# SvarDOS binary package
80
	mkdir appinfo
81
	mkdir bin
82
	mkdir doc
83
	mkdir doc\svarcom
84
	mkdir nls
85
	copy command.com bin
86
	copy *.txt doc\svarcom\
87
	copy svarcom.lsm appinfo\
88
	copy svarcom.lng nls\
89
	zip -9rkDX -m svarcom.svp appinfo bin doc nls
90
	rmdir appinfo
91
	rmdir bin
92
	rmdir nls
93
	rmdir doc\svarcom
94
	rmdir doc