# Tools:
# MAKE Version 4.0  Copyright (c) 1987, 1996 Borland International
# Borland C++ 5.0 for Win32  Copyright (c) 1993, 1996 Borland International
# Turbo Assembler  Version 3.1  Copyright (c) 1988, 1992 Borland International
# Turbo Link  Version 7.1.30.1  Copyright (c) 1987, 1996 Borland International

AS = tasm /ml /m3 /l
CC = bcc32 -d -O -O2 -S -u-
LD = tlink -m -M -s -C -l -3

LNG = cs de fr it nl ru se sp
OBJ = ext32.obj ext32lib.obj ext32mem.obj ipl.obj fat.obj \
       part.obj part_aux.obj part_cmd.obj part_dsk.obj part_fat.obj \
                part_gui.obj part_msg.obj part_tab.obj part_wiz.obj

def: helper.exe en
all: helper.exe en $(LNG)

ext32.obj: ext32.asm ext32con.inc ext32dpm.inc ext32dsk.inc
part.asm part_aux.asm part_cmd.asm part_dsk.asm part_fat.asm part_gui.asm \
         part_tab.asm part_wiz.asm: ext32.h part.h part_msg.h

.c.asm:
	$(CC) $<
	helper -fix_asm $@

.asm.obj:
	$(AS) $<

en: $(OBJ)
 #	$(LD) $(OBJ), part.exe
 $(LD) @&&!
   $(OBJ)
   part.exe
!
	helper -fix_exe part.exe

part_msg.obj part_msg.h: part_msg.msg helper.exe
	helper -exp_msg en part_msg.c part_msg.h
	$(CC) part_msg.c
	helper -fix_asm  part_msg.asm
	$(AS) part_msg.asm

$(LNG):	$(OBJ)
	helper -exp_msg $@ part_msg.c part_msg.h
	$(CC) part_msg.c
	helper -fix_asm  part_msg.asm
	$(AS) part_msg.asm
 #	$(LD) $(OBJ), part-$@.exe
 $(LD) @&&!
   $(OBJ)
   part-$@.exe
!
	del part_msg.obj

helper.exe: helper.c
	tcc helper.c
	del helper.obj

zip: en clean
	pklite part*.exe
	pkzip -ex sources.zip makefile *.bat *.asm *.inc *.c *.h *.msg
	pkzip -ex partbeta.zip *.txt part*.exe cwsdpmi.exe sources.zip

clean:
	@clean.bat
