# TransBlt makefile
#
# This makefile is in Microsoft NMAKE format.
#
# nmake		builds target EXE
# nmake clean	deletes files that can be regenerated by rebuilding
# 

NAME = transblt

LIBS = libw mlibcew 

##############################

!ifndef DEBUG
DEF  =
CC   = cl -c -W3 -AM -G2sw -Zp -nologo -Ows $(DEF)
ASM  = masm -Mx -t -D?QUIET
LINK = link /NOE/NOD
!else
DEF  = -DDEBUG
CC   = cl -c -W3 -AM -G2sw -Zip -nologo -Od $(DEF)
ASM  = masm -Mx -t -D?QUIET -Zi
LINK = link /NOE/NOD/CO/LI/MAP
!endif

###############################

OBJ1 = $(NAME).obj
OBJ2 = 
OBJ  = $(OBJ1) $(OBJ2)

###############################

.c.obj:
	$(CC) $*.c

.asm.obj:
	$(ASM) $*;

###############################

!ifdef DEBUG
goal: $(NAME).sym $(NAME).exe
!else
goal: $(NAME).exe
!endif

###############################
# Main EXE

$(NAME).exe $(NAME).map: $(OBJ) $(NAME).res $(NAME).def
	$(LINK) @<<
	$(OBJ1) +
	$(OBJ2)
	$(NAME), $(NAME), $(LIBS), $(NAME).def
<<
	rc $(NAME).res
!ifdef DEBUG
	cvpack $(NAME).exe
!endif

$(NAME).res: $(NAME).rc $(NAME).ico $(NAME).h
	rc -r $(NAME).rc

$(NAME).sym: $(NAME).map $(NAME).exe
	mapsym $(NAME).map

###############################
# Depdenencies and segmentation...

$(NAME).obj : $(NAME).c $(NAME).h;	$(CC) -NT _TEXT $*.c

###############################
# Clean...

clean:
	del *.exe
	del *.res
	del *.obj
	del *.map
	del *.sym

###############################
# Copy...

copy:
	copy $(NAME).exe ..\bin
!ifdef DEBUG
	copy $(NAME).sym ..\bin
!endif
